aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snmp')
-rw-r--r--lib/snmp/.gitignore4
-rw-r--r--lib/snmp/Makefile23
-rw-r--r--lib/snmp/doc/src/MIB_mechanism.ps217
-rw-r--r--lib/snmp/doc/src/Makefile25
-rw-r--r--lib/snmp/doc/src/book.xml25
-rw-r--r--lib/snmp/doc/src/fascicules.xml2
-rw-r--r--lib/snmp/doc/src/files.mk25
-rw-r--r--lib/snmp/doc/src/getnext1.ps2923
-rw-r--r--lib/snmp/doc/src/getnext2.ps2997
-rw-r--r--lib/snmp/doc/src/getnext3.ps3003
-rw-r--r--lib/snmp/doc/src/getnext4.ps3002
-rw-r--r--lib/snmp/doc/src/index.html.src21
-rw-r--r--lib/snmp/doc/src/notes.xml928
-rw-r--r--lib/snmp/doc/src/notes_history.xml25
-rw-r--r--lib/snmp/doc/src/part.xml25
-rw-r--r--lib/snmp/doc/src/part_notes.xml25
-rw-r--r--lib/snmp/doc/src/part_notes_history.xml25
-rw-r--r--lib/snmp/doc/src/ref_man.xml27
-rw-r--r--lib/snmp/doc/src/snmp-um-1-image-1.ps2912
-rw-r--r--lib/snmp/doc/src/snmp-um-1-image-2.ps2866
-rw-r--r--lib/snmp/doc/src/snmp-um-1-image-3.ps3400
-rw-r--r--lib/snmp/doc/src/snmp-um-1-image-8.ps2931
-rw-r--r--lib/snmp/doc/src/snmp.xml105
-rw-r--r--lib/snmp/doc/src/snmp_advanced_agent.xml27
-rw-r--r--lib/snmp/doc/src/snmp_agent_config_files.xml329
-rw-r--r--lib/snmp/doc/src/snmp_agent_funct_descr.xml25
-rw-r--r--lib/snmp/doc/src/snmp_agent_netif.xml56
-rw-r--r--lib/snmp/doc/src/snmp_agent_netif_1.ps2909
-rw-r--r--lib/snmp/doc/src/snmp_app.xml478
-rw-r--r--lib/snmp/doc/src/snmp_app_a.xml25
-rw-r--r--lib/snmp/doc/src/snmp_app_b.xml25
-rw-r--r--lib/snmp/doc/src/snmp_audit_trail_log.xml25
-rw-r--r--lib/snmp/doc/src/snmp_community_mib.xml25
-rw-r--r--lib/snmp/doc/src/snmp_config.xml464
-rw-r--r--lib/snmp/doc/src/snmp_def_instr_functions.xml25
-rw-r--r--lib/snmp/doc/src/snmp_framework_mib.xml25
-rw-r--r--lib/snmp/doc/src/snmp_generic.xml25
-rw-r--r--lib/snmp/doc/src/snmp_impl_example_agent.xml25
-rw-r--r--lib/snmp/doc/src/snmp_impl_example_manager.xml25
-rw-r--r--lib/snmp/doc/src/snmp_index.xml25
-rw-r--r--lib/snmp/doc/src/snmp_instr_functions.xml25
-rw-r--r--lib/snmp/doc/src/snmp_intro.xml25
-rw-r--r--lib/snmp/doc/src/snmp_manager_config_files.xml86
-rw-r--r--lib/snmp/doc/src/snmp_manager_funct_descr.xml25
-rw-r--r--lib/snmp/doc/src/snmp_manager_netif.xml67
-rw-r--r--lib/snmp/doc/src/snmp_manager_netif_1.ps305
-rw-r--r--lib/snmp/doc/src/snmp_mib_compiler.xml25
-rw-r--r--lib/snmp/doc/src/snmp_notification_mib.xml25
-rw-r--r--lib/snmp/doc/src/snmp_pdus.xml25
-rw-r--r--lib/snmp/doc/src/snmp_standard_mib.xml25
-rw-r--r--lib/snmp/doc/src/snmp_target_mib.xml45
-rw-r--r--lib/snmp/doc/src/snmp_user_based_sm_mib.xml25
-rw-r--r--lib/snmp/doc/src/snmp_view_based_acm_mib.xml25
-rw-r--r--lib/snmp/doc/src/snmpa.xml150
-rw-r--r--lib/snmp/doc/src/snmpa_conf.xml89
-rw-r--r--lib/snmp/doc/src/snmpa_discovery_handler.xml25
-rw-r--r--lib/snmp/doc/src/snmpa_error.xml25
-rw-r--r--lib/snmp/doc/src/snmpa_error_io.xml25
-rw-r--r--lib/snmp/doc/src/snmpa_error_logger.xml25
-rw-r--r--lib/snmp/doc/src/snmpa_error_report.xml25
-rw-r--r--lib/snmp/doc/src/snmpa_local_db.xml25
-rw-r--r--lib/snmp/doc/src/snmpa_mib_data.xml393
-rw-r--r--lib/snmp/doc/src/snmpa_mib_storage.xml293
-rw-r--r--lib/snmp/doc/src/snmpa_mpd.xml90
-rw-r--r--lib/snmp/doc/src/snmpa_network_interface.xml25
-rw-r--r--lib/snmp/doc/src/snmpa_network_interface_filter.xml61
-rw-r--r--lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml53
-rw-r--r--lib/snmp/doc/src/snmpa_notification_filter.xml25
-rw-r--r--lib/snmp/doc/src/snmpa_supervisor.xml25
-rw-r--r--lib/snmp/doc/src/snmpc.xml23
-rw-r--r--lib/snmp/doc/src/snmpc_cmd.xml25
-rw-r--r--lib/snmp/doc/src/snmpm.xml91
-rw-r--r--lib/snmp/doc/src/snmpm_conf.xml31
-rw-r--r--lib/snmp/doc/src/snmpm_mpd.xml37
-rw-r--r--lib/snmp/doc/src/snmpm_network_interface.xml35
-rw-r--r--lib/snmp/doc/src/snmpm_network_interface_filter.xml57
-rw-r--r--lib/snmp/doc/src/snmpm_user.xml219
-rw-r--r--lib/snmp/doc/src/structure.ps170
-rw-r--r--lib/snmp/examples/Makefile23
-rw-r--r--lib/snmp/examples/ex1/Makefile23
-rw-r--r--lib/snmp/examples/ex1/ex1.erl19
-rw-r--r--lib/snmp/examples/ex2/Makefile23
-rw-r--r--lib/snmp/examples/ex2/snmp_ex2_manager.erl30
-rw-r--r--lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl23
-rw-r--r--lib/snmp/examples/subdirs.mk23
-rw-r--r--lib/snmp/include/.gitignore4
-rw-r--r--lib/snmp/include/SNMPv2-TC.hrl23
-rw-r--r--lib/snmp/include/snmp_tables.hrl23
-rw-r--r--lib/snmp/include/snmp_types.hrl23
-rw-r--r--lib/snmp/mibs/Makefile.in31
-rw-r--r--lib/snmp/priv/conf/Makefile23
-rw-r--r--lib/snmp/priv/conf/agent/Makefile23
-rw-r--r--lib/snmp/priv/conf/agent/files.mk23
-rw-r--r--lib/snmp/priv/conf/manager/Makefile23
-rw-r--r--lib/snmp/priv/conf/manager/files.mk23
-rw-r--r--lib/snmp/priv/conf/subdirs.mk23
-rw-r--r--lib/snmp/priv/mibs/.gitignore1
-rw-r--r--lib/snmp/src/Makefile23
-rw-r--r--lib/snmp/src/agent/Makefile23
-rw-r--r--lib/snmp/src/agent/depend.mk43
-rw-r--r--lib/snmp/src/agent/modules.mk37
-rw-r--r--lib/snmp/src/agent/snmp_community_mib.erl99
-rw-r--r--lib/snmp/src/agent/snmp_framework_mib.erl136
-rw-r--r--lib/snmp/src/agent/snmp_generic.erl51
-rw-r--r--lib/snmp/src/agent/snmp_generic_mnesia.erl23
-rw-r--r--lib/snmp/src/agent/snmp_index.erl23
-rw-r--r--lib/snmp/src/agent/snmp_notification_mib.erl45
-rw-r--r--lib/snmp/src/agent/snmp_shadow_table.erl30
-rw-r--r--lib/snmp/src/agent/snmp_standard_mib.erl49
-rw-r--r--lib/snmp/src/agent/snmp_target_mib.erl293
-rw-r--r--lib/snmp/src/agent/snmp_user_based_sm_mib.erl97
-rw-r--r--lib/snmp/src/agent/snmp_view_based_acm_mib.erl185
-rw-r--r--lib/snmp/src/agent/snmpa.erl320
-rw-r--r--lib/snmp/src/agent/snmpa_acm.erl27
-rw-r--r--lib/snmp/src/agent/snmpa_agent.erl257
-rw-r--r--lib/snmp/src/agent/snmpa_agent_sup.erl33
-rw-r--r--lib/snmp/src/agent/snmpa_app.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_atl.hrl23
-rw-r--r--lib/snmp/src/agent/snmpa_authentication_service.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_conf.erl634
-rw-r--r--lib/snmp/src/agent/snmpa_discovery_handler.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_discovery_handler_default.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_error.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_error_io.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_error_logger.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_error_report.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_general_db.erl21
-rw-r--r--lib/snmp/src/agent/snmpa_internal.hrl21
-rw-r--r--lib/snmp/src/agent/snmpa_local_db.erl35
-rw-r--r--lib/snmp/src/agent/snmpa_mib.erl271
-rw-r--r--lib/snmp/src/agent/snmpa_mib_data.erl1395
-rw-r--r--lib/snmp/src/agent/snmpa_mib_data_ttln.erl1403
-rw-r--r--lib/snmp/src/agent/snmpa_mib_data_tttn.erl1444
-rw-r--r--lib/snmp/src/agent/snmpa_mib_lib.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage.erl182
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage_dets.erl310
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage_ets.erl342
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl303
-rw-r--r--lib/snmp/src/agent/snmpa_misc_sup.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_mpd.erl160
-rw-r--r--lib/snmp/src/agent/snmpa_net_if.erl1328
-rw-r--r--lib/snmp/src/agent/snmpa_net_if_filter.erl77
-rw-r--r--lib/snmp/src/agent/snmpa_network_interface.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_network_interface_filter.erl34
-rw-r--r--lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_notification_filter.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_set.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_set_lib.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_set_mechanism.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_supervisor.erl130
-rw-r--r--lib/snmp/src/agent/snmpa_svbl.erl23
-rw-r--r--lib/snmp/src/agent/snmpa_symbolic_store.erl312
-rw-r--r--lib/snmp/src/agent/snmpa_target_cache.erl60
-rw-r--r--lib/snmp/src/agent/snmpa_trap.erl191
-rw-r--r--lib/snmp/src/agent/snmpa_usm.erl39
-rw-r--r--lib/snmp/src/agent/snmpa_vacm.erl30
-rw-r--r--lib/snmp/src/agent/snmpa_vacm.hrl23
-rw-r--r--lib/snmp/src/app/Makefile29
-rw-r--r--lib/snmp/src/app/depend.mk23
-rw-r--r--lib/snmp/src/app/modules.mk23
-rw-r--r--lib/snmp/src/app/snmp.app.src45
-rw-r--r--lib/snmp/src/app/snmp.appup.src649
-rw-r--r--lib/snmp/src/app/snmp.erl232
-rw-r--r--lib/snmp/src/app/snmp_app.erl37
-rw-r--r--lib/snmp/src/app/snmp_app_sup.erl23
-rw-r--r--lib/snmp/src/app/snmp_internal.hrl25
-rw-r--r--lib/snmp/src/compile/Makefile23
-rw-r--r--lib/snmp/src/compile/depend.mk27
-rw-r--r--lib/snmp/src/compile/modules.mk23
-rw-r--r--lib/snmp/src/compile/snmpc.erl37
-rw-r--r--lib/snmp/src/compile/snmpc.hrl23
-rw-r--r--lib/snmp/src/compile/snmpc.src23
-rw-r--r--lib/snmp/src/compile/snmpc_lib.erl24
-rw-r--r--lib/snmp/src/compile/snmpc_lib.hrl23
-rw-r--r--lib/snmp/src/compile/snmpc_mib_gram.yrl27
-rw-r--r--lib/snmp/src/compile/snmpc_mib_to_hrl.erl23
-rw-r--r--lib/snmp/src/compile/snmpc_misc.erl43
-rw-r--r--lib/snmp/src/compile/snmpc_misc.hrl23
-rw-r--r--lib/snmp/src/compile/snmpc_tok.erl23
-rw-r--r--lib/snmp/src/manager/Makefile23
-rw-r--r--lib/snmp/src/manager/depend.mk26
-rw-r--r--lib/snmp/src/manager/modules.mk23
-rw-r--r--lib/snmp/src/manager/snmpm.erl912
-rw-r--r--lib/snmp/src/manager/snmpm_atl.hrl23
-rw-r--r--lib/snmp/src/manager/snmpm_conf.erl276
-rw-r--r--lib/snmp/src/manager/snmpm_config.erl1374
-rw-r--r--lib/snmp/src/manager/snmpm_internal.hrl23
-rw-r--r--lib/snmp/src/manager/snmpm_misc_sup.erl23
-rw-r--r--lib/snmp/src/manager/snmpm_mpd.erl109
-rw-r--r--lib/snmp/src/manager/snmpm_net_if.erl1059
-rw-r--r--lib/snmp/src/manager/snmpm_net_if_filter.erl81
-rw-r--r--lib/snmp/src/manager/snmpm_net_if_mt.erl1263
-rw-r--r--lib/snmp/src/manager/snmpm_network_interface.erl23
-rw-r--r--lib/snmp/src/manager/snmpm_network_interface_filter.erl23
-rw-r--r--lib/snmp/src/manager/snmpm_server.erl1025
-rw-r--r--lib/snmp/src/manager/snmpm_server_sup.erl23
-rw-r--r--lib/snmp/src/manager/snmpm_supervisor.erl23
-rw-r--r--lib/snmp/src/manager/snmpm_user.erl199
-rw-r--r--lib/snmp/src/manager/snmpm_user_default.erl41
-rw-r--r--lib/snmp/src/manager/snmpm_user_old.erl23
-rw-r--r--lib/snmp/src/manager/snmpm_usm.erl35
-rw-r--r--lib/snmp/src/manager/snmpm_usm.hrl23
-rw-r--r--lib/snmp/src/misc/Makefile23
-rw-r--r--lib/snmp/src/misc/depend.mk23
-rw-r--r--lib/snmp/src/misc/modules.mk23
-rw-r--r--lib/snmp/src/misc/snmp_conf.erl793
-rw-r--r--lib/snmp/src/misc/snmp_config.erl793
-rw-r--r--lib/snmp/src/misc/snmp_debug.hrl23
-rw-r--r--lib/snmp/src/misc/snmp_log.erl630
-rw-r--r--lib/snmp/src/misc/snmp_mini_mib.erl23
-rw-r--r--lib/snmp/src/misc/snmp_misc.erl61
-rw-r--r--lib/snmp/src/misc/snmp_note_store.erl23
-rw-r--r--lib/snmp/src/misc/snmp_pdus.erl27
-rw-r--r--lib/snmp/src/misc/snmp_usm.erl85
-rw-r--r--lib/snmp/src/misc/snmp_verbosity.erl38
-rw-r--r--lib/snmp/src/misc/snmp_verbosity.hrl23
-rw-r--r--lib/snmp/src/subdirs.mk23
-rw-r--r--lib/snmp/subdirs.mk23
-rw-r--r--lib/snmp/test/Makefile33
-rw-r--r--lib/snmp/test/exp/snmp_agent_bl_test.erl80
-rw-r--r--lib/snmp/test/exp/snmp_agent_ms_test.erl75
-rw-r--r--lib/snmp/test/exp/snmp_agent_mt_test.erl75
-rw-r--r--lib/snmp/test/exp/snmp_agent_v1_test.erl25
-rw-r--r--lib/snmp/test/exp/snmp_agent_v2_test.erl75
-rw-r--r--lib/snmp/test/exp/snmp_agent_v3_test.erl74
-rw-r--r--lib/snmp/test/klas3.erl34
-rw-r--r--lib/snmp/test/modules.mk26
-rw-r--r--lib/snmp/test/sa.erl23
-rw-r--r--lib/snmp/test/snmp.spec.vxworks4
-rw-r--r--lib/snmp/test/snmp_SUITE.erl52
-rw-r--r--lib/snmp/test/snmp_agent_conf_test.erl210
-rw-r--r--lib/snmp/test/snmp_agent_mibs_test.erl308
-rw-r--r--lib/snmp/test/snmp_agent_nfilter_test.erl25
-rw-r--r--lib/snmp/test/snmp_agent_test.erl3190
-rw-r--r--lib/snmp/test/snmp_agent_test_lib.erl520
-rw-r--r--lib/snmp/test/snmp_app_test.erl494
-rw-r--r--lib/snmp/test/snmp_appup_mgr.erl29
-rw-r--r--lib/snmp/test/snmp_appup_test.erl514
-rw-r--r--lib/snmp/test/snmp_compiler_test.erl53
-rw-r--r--lib/snmp/test/snmp_conf_test.erl33
-rw-r--r--lib/snmp/test/snmp_log_test.erl119
-rw-r--r--lib/snmp/test/snmp_manager_config_test.erl93
-rw-r--r--lib/snmp/test/snmp_manager_test.erl769
-rw-r--r--lib/snmp/test/snmp_manager_user.erl365
-rw-r--r--lib/snmp/test/snmp_manager_user_old.erl151
-rw-r--r--lib/snmp/test/snmp_manager_user_test.erl25
-rw-r--r--lib/snmp/test/snmp_manager_user_test_lib.erl25
-rw-r--r--lib/snmp/test/snmp_note_store_test.erl23
-rw-r--r--lib/snmp/test/snmp_pdus_test.erl21
-rw-r--r--lib/snmp/test/snmp_test_data/.gitignore2
-rw-r--r--lib/snmp/test/snmp_test_data/OTP14145-MIB.mib44
-rw-r--r--lib/snmp/test/snmp_test_lib.erl50
-rw-r--r--lib/snmp/test/snmp_test_lib.hrl51
-rw-r--r--lib/snmp/test/snmp_test_manager.erl57
-rw-r--r--lib/snmp/test/snmp_test_mgr.erl67
-rw-r--r--lib/snmp/test/snmp_test_mgr_counter_server.erl153
-rw-r--r--lib/snmp/test/snmp_test_mgr_misc.erl71
-rw-r--r--lib/snmp/test/snmp_test_server.erl23
-rw-r--r--lib/snmp/test/snmp_test_suite.erl23
-rw-r--r--lib/snmp/test/snmp_to_snmpnet_SUITE.erl560
-rw-r--r--lib/snmp/test/snmp_to_snmpnet_SUITE_data/TestTrapv2.binbin0 -> 3640 bytes
-rw-r--r--lib/snmp/test/snmp_to_snmpnet_SUITE_data/TestTrapv2.mib71
-rw-r--r--lib/snmp/test/snmp_to_snmpnet_SUITE_data/snmpd.conf12
-rwxr-xr-xlib/snmp/test/snmp_to_snmpnet_SUITE_data/start_stop_wrapper48
-rw-r--r--lib/snmp/test/test1.erl23
-rw-r--r--lib/snmp/test/test2.erl23
-rw-r--r--lib/snmp/test/test_config/Makefile23
-rw-r--r--lib/snmp/test/test_config/modules.mk21
-rw-r--r--lib/snmp/test/test_config/snmp_test_config.erl21
-rw-r--r--lib/snmp/vsn.mk23
270 files changed, 21139 insertions, 42689 deletions
diff --git a/lib/snmp/.gitignore b/lib/snmp/.gitignore
index b82d23e7bd..aef73491a4 100644
--- a/lib/snmp/.gitignore
+++ b/lib/snmp/.gitignore
@@ -1,4 +1,8 @@
# Match at any level.
*.BKP
+*.orig
+*.rej
+doc/index.html
+mibs/.index
diff --git a/lib/snmp/Makefile b/lib/snmp/Makefile
index ff6fad8ddc..879f1b05c5 100644
--- a/lib/snmp/Makefile
+++ b/lib/snmp/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/doc/src/MIB_mechanism.ps b/lib/snmp/doc/src/MIB_mechanism.ps
deleted file mode 100644
index e45e7d0bad..0000000000
--- a/lib/snmp/doc/src/MIB_mechanism.ps
+++ /dev/null
@@ -1,217 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: bild1.fig
-%%Creator: fig2dev Version 3.1 Patchlevel 2
-%%CreationDate: Tue Dec 28 16:12:39 1999
-%%For: nibe@gundor (Bengt Nilsson, ETX/DN/SP)
-%Magnification: 1.00
-%%Orientation: Portrait
-%%BoundingBox: 0 0 515 300
-%%Pages: 0
-%%BeginSetup
-%%IncludeFeature: *PageSize Letter
-%%EndSetup
-%%EndComments
-/$F2psDict 200 dict def
-$F2psDict begin
-$F2psDict /mtrx matrix put
-/col-1 {0 setgray} bind def
-/col0 {0.000 0.000 0.000 srgb} bind def
-/col1 {0.000 0.000 1.000 srgb} bind def
-/col2 {0.000 1.000 0.000 srgb} bind def
-/col3 {0.000 1.000 1.000 srgb} bind def
-/col4 {1.000 0.000 0.000 srgb} bind def
-/col5 {1.000 0.000 1.000 srgb} bind def
-/col6 {1.000 1.000 0.000 srgb} bind def
-/col7 {1.000 1.000 1.000 srgb} bind def
-/col8 {0.000 0.000 0.560 srgb} bind def
-/col9 {0.000 0.000 0.690 srgb} bind def
-/col10 {0.000 0.000 0.820 srgb} bind def
-/col11 {0.530 0.810 1.000 srgb} bind def
-/col12 {0.000 0.560 0.000 srgb} bind def
-/col13 {0.000 0.690 0.000 srgb} bind def
-/col14 {0.000 0.820 0.000 srgb} bind def
-/col15 {0.000 0.560 0.560 srgb} bind def
-/col16 {0.000 0.690 0.690 srgb} bind def
-/col17 {0.000 0.820 0.820 srgb} bind def
-/col18 {0.560 0.000 0.000 srgb} bind def
-/col19 {0.690 0.000 0.000 srgb} bind def
-/col20 {0.820 0.000 0.000 srgb} bind def
-/col21 {0.560 0.000 0.560 srgb} bind def
-/col22 {0.690 0.000 0.690 srgb} bind def
-/col23 {0.820 0.000 0.820 srgb} bind def
-/col24 {0.500 0.190 0.000 srgb} bind def
-/col25 {0.630 0.250 0.000 srgb} bind def
-/col26 {0.750 0.380 0.000 srgb} bind def
-/col27 {1.000 0.500 0.500 srgb} bind def
-/col28 {1.000 0.630 0.630 srgb} bind def
-/col29 {1.000 0.750 0.750 srgb} bind def
-/col30 {1.000 0.880 0.880 srgb} bind def
-/col31 {1.000 0.840 0.000 srgb} bind def
-
-end
-save
--53.0 312.0 translate
-1 -1 scale
-
-/cp {closepath} bind def
-/ef {eofill} bind def
-/gr {grestore} bind def
-/gs {gsave} bind def
-/sa {save} bind def
-/rs {restore} bind def
-/l {lineto} bind def
-/m {moveto} bind def
-/rm {rmoveto} bind def
-/n {newpath} bind def
-/s {stroke} bind def
-/sh {show} bind def
-/slc {setlinecap} bind def
-/slj {setlinejoin} bind def
-/slw {setlinewidth} bind def
-/srgb {setrgbcolor} bind def
-/rot {rotate} bind def
-/sc {scale} bind def
-/sd {setdash} bind def
-/ff {findfont} bind def
-/sf {setfont} bind def
-/scf {scalefont} bind def
-/sw {stringwidth} bind def
-/tr {translate} bind def
-/tnt {dup dup currentrgbcolor
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
- bind def
-/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
- 4 -2 roll mul srgb} bind def
-/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
-/$F2psEnd {$F2psEnteredState restore end} def
-%%EndProlog
-
-$F2psBegin
-10 setmiterlimit
-n 0 792 m 0 0 l 612 0 l 612 792 l cp clip
- 0.06000 0.06000 sc
-7.500 slw
-% Polyline
-n 3000 600 m 3000 1800 l gs col-1 s gr
-% Polyline
-gs clippath
-3153 570 m 3273 600 l 3153 630 l 3315 630 l 3315 570 l cp clip
-n 3000 600 m 3300 600 l gs col-1 s gr gr
-
-% arrowhead
-n 3153 570 m 3273 600 l 3153 630 l col-1 s
-% Polyline
-gs clippath
-3153 1770 m 3273 1800 l 3153 1830 l 3315 1830 l 3315 1770 l cp clip
-n 3000 1800 m 3300 1800 l gs col-1 s gr gr
-
-% arrowhead
-n 3153 1770 m 3273 1800 l 3153 1830 l col-1 s
-% Polyline
-n 1725 1200 m 3000 1200 l gs col-1 s gr
-% Polyline
-n 3000 3000 m 3000 4200 l gs col-1 s gr
-% Polyline
-gs clippath
-3153 2970 m 3273 3000 l 3153 3030 l 3315 3030 l 3315 2970 l cp clip
-n 3000 3000 m 3300 3000 l gs col-1 s gr gr
-
-% arrowhead
-n 3153 2970 m 3273 3000 l 3153 3030 l col-1 s
-% Polyline
-gs clippath
-3153 4170 m 3273 4200 l 3153 4230 l 3315 4230 l 3315 4170 l cp clip
-n 3000 4200 m 3300 4200 l gs col-1 s gr gr
-
-% arrowhead
-n 3153 4170 m 3273 4200 l 3153 4230 l col-1 s
-% Polyline
-n 1725 3600 m 3000 3600 l gs col-1 s gr
-% Polyline
-n 5250 600 m 5250 1800 l gs col-1 s gr
-% Polyline
-n 4950 1800 m 5250 1800 l gs col-1 s gr
-% Polyline
-n 4950 600 m 5250 600 l gs col-1 s gr
-% Polyline
-gs clippath
-5853 1170 m 5973 1200 l 5853 1230 l 6015 1230 l 6015 1170 l cp clip
-n 5250 1200 m 6000 1200 l gs col-1 s gr gr
-
-% arrowhead
-n 5853 1170 m 5973 1200 l 5853 1230 l col-1 s
-% Polyline
-gs clippath
-3153 2370 m 3273 2400 l 3153 2430 l 3315 2430 l 3315 2370 l cp clip
-n 1800 2400 m 3300 2400 l gs col-1 s gr gr
-
-% arrowhead
-n 3153 2370 m 3273 2400 l 3153 2430 l col-1 s
-% Polyline
-n 4950 2400 m 7800 2400 l gs col-1 s gr
-% Polyline
-n 7200 1200 m 7800 1200 l gs col-1 s gr
-% Polyline
-n 4950 3000 m 7800 3000 l gs col-1 s gr
-% Polyline
-n 4950 4200 m 7800 4200 l gs col-1 s gr
-% Polyline
-gs clippath
-3153 4770 m 3273 4800 l 3153 4830 l 3315 4830 l 3315 4770 l cp clip
-n 1800 4800 m 3300 4800 l gs col-1 s gr gr
-
-% arrowhead
-n 3153 4770 m 3273 4800 l 3153 4830 l col-1 s
-% Polyline
-n 6000 4800 m 7800 4800 l gs col-1 s gr
-% Polyline
-n 7800 1200 m 7800 4800 l gs col-1 s gr
-% Polyline
-gs clippath
-8253 2670 m 8373 2700 l 8253 2730 l 8415 2730 l 8415 2670 l cp clip
-n 7800 2700 m 8400 2700 l gs col-1 s gr gr
-
-% arrowhead
-n 8253 2670 m 8373 2700 l 8253 2730 l col-1 s
-% Polyline
-n 900 225 m 9450 225 l 9450 5175 l 900 5175 l cp gs col-1 s gr
-/Times-Roman ff 180.00 scf sf
-1200 1275 m
-gs 1 -1 sc (who) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-1200 2400 m
-gs 1 -1 sc (where) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-6150 1200 m
-gs 1 -1 sc (groupName) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3600 2400 m
-gs 1 -1 sc (contexrName) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-1200 3600 m
-gs 1 -1 sc (who) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-1275 4800 m
-gs 1 -1 sc (why) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-8475 2700 m
-gs 1 -1 sc (viewName) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3600 600 m
-gs 1 -1 sc (securityModel) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3600 1800 m
-gs 1 -1 sc (securityName) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3600 3000 m
-gs 1 -1 sc (securityModel) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3600 4200 m
-gs 1 -1 sc (securityLevel) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3600 4800 m
-gs 1 -1 sc (viewType \(read/write/notify\)) col-1 sh gr
-$F2psEnd
-rs
diff --git a/lib/snmp/doc/src/Makefile b/lib/snmp/doc/src/Makefile
index 8820565124..9ea5dba0c5 100644
--- a/lib/snmp/doc/src/Makefile
+++ b/lib/snmp/doc/src/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
@@ -118,7 +119,7 @@ clean clean_docs: clean_html clean_man clean_pdf
rm -f errs core *~
$(INDEX_TARGET): $(INDEX_SRC) ../../vsn.mk # Create top make file
- sed -e 's;%VSN%;$(VSN);' $< > $@ # inserting version number
+ $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # inserting version number
man: man1 man3 man6 man7
diff --git a/lib/snmp/doc/src/book.xml b/lib/snmp/doc/src/book.xml
index 2897d25d55..70d426453e 100644
--- a/lib/snmp/doc/src/book.xml
+++ b/lib/snmp/doc/src/book.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE book SYSTEM "book.dtd">
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/fascicules.xml b/lib/snmp/doc/src/fascicules.xml
index 0678195e07..37feca543f 100644
--- a/lib/snmp/doc/src/fascicules.xml
+++ b/lib/snmp/doc/src/fascicules.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE fascicules SYSTEM "fascicules.dtd">
<fascicules>
diff --git a/lib/snmp/doc/src/files.mk b/lib/snmp/doc/src/files.mk
index 61c91c9729..5aeae19105 100644
--- a/lib/snmp/doc/src/files.mk
+++ b/lib/snmp/doc/src/files.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
@@ -41,6 +42,8 @@ XML_AGENT_REF3_FILES = \
snmpa_error_io.xml \
snmpa_error_logger.xml \
snmpa_local_db.xml \
+ snmpa_mib_data.xml \
+ snmpa_mib_storage.xml \
snmpa_mpd.xml \
snmpa_network_interface.xml \
snmpa_network_interface_filter.xml \
diff --git a/lib/snmp/doc/src/getnext1.ps b/lib/snmp/doc/src/getnext1.ps
deleted file mode 100644
index ba6bf18fec..0000000000
--- a/lib/snmp/doc/src/getnext1.ps
+++ /dev/null
@@ -1,2923 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: Adobe Illustrator(r) 6.0
-%%For: (Anna Fedoriw) (Ericsson Telecom)
-%%Title: (Contents.eps)
-%%CreationDate: (97-05-23) (14.03)
-%%BoundingBox: 112 623 440 757
-%%HiResBoundingBox: 112.5 623.5 439.5 756.8677
-%%DocumentProcessColors: Black
-%%DocumentFonts: Univers
-%%DocumentSuppliedResources: procset Adobe_level2_AI5 1.0 0
-%%+ procset Adobe_typography_AI5 1.0 0
-%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6
-%%+ procset Adobe_Illustrator_AI5 1.0 0
-%AI5_FileFormat 2.0
-%AI3_ColorUsage: Black&White
-%%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set)
-%%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1
-%%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 ()
-%AI3_TemplateBox: 306 396 306 396
-%AI3_TileBox: 21 -12 588 802
-%AI3_DocumentPreview: Macintosh_ColorPic
-%AI5_ArtSize: 595.2756 841.8898
-%AI5_RulerUnits: 1
-%AI5_ArtFlags: 0 0 0 1 0 0 1 1 0
-%AI5_TargetResolution: 800
-%AI5_NumLayers: 1
-%AI5_OpenToView: 54 804 2 1146 827 58 1 1 3 40
-%AI5_OpenViewLayers: 7
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset Adobe_level2_AI5 1.2 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation)
-%%Version: 1.2
-%%CreationDate: (04/10/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-userdict /Adobe_level2_AI5 23 dict dup begin
- put
- /packedarray where not
- {
- userdict begin
- /packedarray
- {
- array astore readonly
- } bind def
- /setpacking /pop load def
- /currentpacking false def
- end
- 0
- } if
- pop
- userdict /defaultpacking currentpacking put true setpacking
- /initialize
- {
- Adobe_level2_AI5 begin
- } bind def
- /terminate
- {
- currentdict Adobe_level2_AI5 eq
- {
- end
- } if
- } bind def
- mark
- /setcustomcolor where not
- {
- /findcmykcustomcolor
- {
- 5 packedarray
- } bind def
- /setcustomcolor
- {
- exch aload pop pop
- 4
- {
- 4 index mul 4 1 roll
- } repeat
- 5 -1 roll pop
- setcmykcolor
- }
- def
- } if
-
- /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def
- userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put
- userdict /level2?
- systemdict /languagelevel known dup
- {
- pop systemdict /languagelevel get 2 ge
- } if
- put
-/level2ScreenFreq
-{
- begin
- 60
- HalftoneType 1 eq
- {
- pop Frequency
- } if
- HalftoneType 2 eq
- {
- pop GrayFrequency
- } if
- HalftoneType 5 eq
- {
- pop Default level2ScreenFreq
- } if
- end
-} bind def
-userdict /currentScreenFreq
- level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put
-level2? not
- {
- /setcmykcolor where not
- {
- /setcmykcolor
- {
- exch .11 mul add exch .59 mul add exch .3 mul add
- 1 exch sub setgray
- } def
- } if
- /currentcmykcolor where not
- {
- /currentcmykcolor
- {
- 0 0 0 1 currentgray sub
- } def
- } if
- /setoverprint where not
- {
- /setoverprint /pop load def
- } if
- /selectfont where not
- {
- /selectfont
- {
- exch findfont exch
- dup type /arraytype eq
- {
- makefont
- }
- {
- scalefont
- } ifelse
- setfont
- } bind def
- } if
- /cshow where not
- {
- /cshow
- {
- [
- 0 0 5 -1 roll aload pop
- ] cvx bind forall
- } bind def
- } if
- } if
- cleartomark
- /anyColor?
- {
- add add add 0 ne
- } bind def
- /testColor
- {
- gsave
- setcmykcolor currentcmykcolor
- grestore
- } bind def
- /testCMYKColorThrough
- {
- testColor anyColor?
- } bind def
- userdict /composite?
- level2?
- {
- gsave 1 1 1 1 setcmykcolor currentcmykcolor grestore
- add add add 4 eq
- }
- {
- 1 0 0 0 testCMYKColorThrough
- 0 1 0 0 testCMYKColorThrough
- 0 0 1 0 testCMYKColorThrough
- 0 0 0 1 testCMYKColorThrough
- and and and
- } ifelse
- put
- composite? not
- {
- userdict begin
- gsave
- /cyan? 1 0 0 0 testCMYKColorThrough def
- /magenta? 0 1 0 0 testCMYKColorThrough def
- /yellow? 0 0 1 0 testCMYKColorThrough def
- /black? 0 0 0 1 testCMYKColorThrough def
- grestore
- /isCMYKSep? cyan? magenta? yellow? black? or or or def
- /customColor? isCMYKSep? not def
- end
- } if
- end defaultpacking setpacking
-%%EndResource
-%%BeginResource: procset Adobe_typography_AI5 1.0 1
-%%Title: (Typography Operators)
-%%Version: 1.0
-%%CreationDate:(03/26/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_typography_AI5 54 dict dup begin
-put
-/initialize
-{
- begin
- begin
- Adobe_typography_AI5 begin
- Adobe_typography_AI5
- {
- dup xcheck
- {
- bind
- } if
- pop pop
- } forall
- end
- end
- end
- Adobe_typography_AI5 begin
-} def
-/terminate
-{
- currentdict Adobe_typography_AI5 eq
- {
- end
- } if
-} def
-/modifyEncoding
-{
- /_tempEncode exch ddef
- /_pntr 0 ddef
- {
- counttomark -1 roll
- dup type dup /marktype eq
- {
- pop pop exit
- }
- {
- /nametype eq
- {
- _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
- put
- }
- {
- /_pntr exch ddef
- } ifelse
- } ifelse
- } loop
- _tempEncode
-} def
-/TE
-{
- StandardEncoding 256 array copy modifyEncoding
- /_nativeEncoding exch def
-} def
-%
-/TZ
-{
- dup type /arraytype eq
- {
- /_wv exch def
- }
- {
- /_wv 0 def
- } ifelse
- /_useNativeEncoding exch def
- pop pop
- findfont _wv type /arraytype eq
- {
- _wv makeblendedfont
- } if
- dup length 2 add dict
- begin
- mark exch
- {
- 1 index /FID ne
- {
- def
- } if
- cleartomark mark
- } forall
- pop
- /FontName exch def
- counttomark 0 eq
- {
- 1 _useNativeEncoding eq
- {
- /Encoding _nativeEncoding def
- } if
- cleartomark
- }
- {
- /Encoding load 256 array copy
- modifyEncoding /Encoding exch def
- } ifelse
- FontName currentdict
- end
- definefont pop
-} def
-/tr
-{
- _ax _ay 3 2 roll
-} def
-/trj
-{
- _cx _cy _sp _ax _ay 6 5 roll
-} def
-/a0
-{
- /Tx
- {
- dup
- currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- } ddef
- /Tj
- {
- dup
- currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- } ddef
-} def
-/a1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/e0
-{
- /Tx
- {
- tr _psf
- } ddef
- /Tj
- {
- trj _pjsf
- } ddef
-} def
-/e1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- tr _psf
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- trj _pjsf
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/i0
-{
- /Tx
- {
- tr sp
- } ddef
- /Tj
- {
- trj jsp
- } ddef
-} def
-/i1
-{
- W N
-} def
-/o0
-{
- /Tx
- {
- tr sw rmoveto
- } ddef
- /Tj
- {
- trj swj rmoveto
- } ddef
-} def
-/r0
-{
- /Tx
- {
- tr _ctm _pss
- } ddef
- /Tj
- {
- trj _ctm _pjss
- } ddef
-} def
-/r1
-{
- /Tx
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/To
-{
- pop _ctm currentmatrix pop
-} def
-/TO
-{
- iTe _ctm setmatrix newpath
-} def
-/Tp
-{
- pop _tm astore pop _ctm setmatrix
- _tDict begin
- /W
- {
- } def
- /h
- {
- } def
-} def
-/TP
-{
- end
- iTm 0 0 moveto
-} def
-/Tr
-{
- _render 3 le
- {
- currentpoint newpath moveto
- } if
- dup 8 eq
- {
- pop 0
- }
- {
- dup 9 eq
- {
- pop 1
- } if
- } ifelse
- dup /_render exch ddef
- _renderStart exch get load exec
-} def
-/iTm
-{
- _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
-} def
-/Tm
-{
- _tm astore pop iTm 0 0 moveto
-} def
-/Td
-{
- _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
-} def
-/iTe
-{
- _render -1 eq
- {
- }
- {
- _renderEnd _render get dup null ne
- {
- load exec
- }
- {
- pop
- } ifelse
- } ifelse
- /_render -1 ddef
-} def
-/Ta
-{
- pop
-} def
-/Tf
-{
- dup 1000 div /_fScl exch ddef
-%
- selectfont
-} def
-/Tl
-{
- pop
- 0 exch _leading astore pop
-} def
-/Tt
-{
- pop
-} def
-/TW
-{
- 3 npop
-} def
-/Tw
-{
- /_cx exch ddef
-} def
-/TC
-{
- 3 npop
-} def
-/Tc
-{
- /_ax exch ddef
-} def
-/Ts
-{
- /_rise exch ddef
- currentpoint
- iTm
- moveto
-} def
-/Ti
-{
- 3 npop
-} def
-/Tz
-{
- 100 div /_hs exch ddef
- iTm
-} def
-/TA
-{
- pop
-} def
-/Tq
-{
- pop
-} def
-/Th
-{
- pop pop pop pop pop
-} def
-/TX
-{
- pop
-} def
-/Tk
-{
- exch pop _fScl mul neg 0 rmoveto
-} def
-/TK
-{
- 2 npop
-} def
-/T*
-{
- _leading aload pop neg Td
-} def
-/T*-
-{
- _leading aload pop Td
-} def
-/T-
-{
- _ax neg 0 rmoveto
- _hyphen Tx
-} def
-/T+
-{
-} def
-/TR
-{
- _ctm currentmatrix pop
- _tm astore pop
- iTm 0 0 moveto
-} def
-/TS
-{
- currentfont 3 1 roll
- /_Symbol_ _fScl 1000 mul selectfont
-
- 0 eq
- {
- Tx
- }
- {
- Tj
- } ifelse
- setfont
-} def
-/Xb
-{
- pop pop
-} def
-/Tb /Xb load def
-/Xe
-{
- pop pop pop pop
-} def
-/Te /Xe load def
-/XB
-{
-} def
-/TB /XB load def
-currentdict readonly pop
-end
-setpacking
-%%EndResource
-%%BeginProcSet: Adobe_ColorImage_AI6 1.0 0
-userdict /Adobe_ColorImage_AI6 known not
-{
- userdict /Adobe_ColorImage_AI6 17 dict put
-} if
-userdict /Adobe_ColorImage_AI6 get begin
-
- /initialize
- {
- Adobe_ColorImage_AI6 begin
- Adobe_ColorImage_AI6
- {
- dup type /arraytype eq
- {
- dup xcheck
- {
- bind
- } if
- } if
- pop pop
- } forall
- } def
- /terminate { end } def
-
- currentdict /Adobe_ColorImage_AI6_Vars known not
- {
- /Adobe_ColorImage_AI6_Vars 14 dict def
- } if
-
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 0 def
- /sourcecount 0 def
- /sourcearray 4 array def
- /plateindex -1 def
- /XIMask 0 def
- /XIBinary 0 def
- /XIChannelCount 0 def
- /XIBitsPerPixel 0 def
- /XIImageHeight 0 def
- /XIImageWidth 0 def
- /XIImageMatrix null def
- /XIBuffer null def
- /XIDataProc null def
- end
-
- /WalkRGBString null def
- /WalkCMYKString null def
-
- /StuffRGBIntoGrayString null def
- /RGBToGrayImageProc null def
- /StuffCMYKIntoGrayString null def
- /CMYKToGrayImageProc null def
- /ColorImageCompositeEmulator null def
-
- /SeparateCMYKImageProc null def
-
- /FourEqual null def
- /TestPlateIndex null def
-
- currentdict /_colorimage known not
- {
- /colorimage where
- {
- /colorimage get /_colorimage exch def
- }
- {
- /_colorimage null def
- } ifelse
- } if
-
- /_currenttransfer systemdict /currenttransfer get def
-
- /colorimage null def
- /XI null def
-
-
- /WalkRGBString
- {
- 0 3 index
-
- dup length 1 sub 0 3 3 -1 roll
- {
- 3 getinterval { } forall
-
- 5 index exec
-
- 3 index
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /WalkCMYKString
- {
- 0 3 index
-
- dup length 1 sub 0 4 3 -1 roll
- {
- 4 getinterval { } forall
-
- 6 index exec
-
- 3 index
-
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /StuffRGBIntoGrayString
- {
- .11 mul exch
-
- .59 mul add exch
-
- .3 mul add
-
- cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /RGBToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 3 idiv string
- dup 3 1 roll
-
- /StuffRGBIntoGrayString load exch
- WalkRGBString
- end
- } def
-
-
- /StuffCMYKIntoGrayString
- {
- exch .11 mul add
-
- exch .59 mul add
-
- exch .3 mul add
-
- dup 255 gt { pop 255 } if
-
- 255 exch sub cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /CMYKToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 4 idiv string
- dup 3 1 roll
-
- /StuffCMYKIntoGrayString load exch
- WalkCMYKString
- end
- } def
-
-
- /ColorImageCompositeEmulator
- {
- pop true eq
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
- }
- {
- Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 3 -1 roll put
-
- channelcount 3 eq
- {
- /RGBToGrayImageProc
- }
- {
- /CMYKToGrayImageProc
- } ifelse
- load
- end
- } if
- image
- } ifelse
- } def
-
-
- /SeparateCMYKImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
-
- sourcecount 0 ne
- {
- sourcearray plateindex get exec
- }
- {
- sourcearray 0 get exec
-
- dup length 4 idiv string
-
- 0 2 index
-
- plateindex 4 2 index length 1 sub
- {
- get 255 exch sub
-
- 3 copy put pop 1 add
-
- 2 index
- } for
-
- pop pop exch pop
- } ifelse
- end
- } def
-
-
- /FourEqual
- {
- 4 index ne
- {
- pop pop pop false
- }
- {
- 4 index ne
- {
- pop pop false
- }
- {
- 4 index ne
- {
- pop false
- }
- {
- 4 index eq
- } ifelse
- } ifelse
- } ifelse
- } def
-
-
- /TestPlateIndex
- {
- Adobe_ColorImage_AI6_Vars begin
- /plateindex -1 def
-
- /setcmykcolor where
- {
- pop
- gsave
- 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
- grestore
-
- 1 0 0 0 FourEqual
- {
- /plateindex 0 def
- }
- {
- 0 1 0 0 FourEqual
- {
- /plateindex 1 def
- }
- {
- 0 0 1 0 FourEqual
- {
- /plateindex 2 def
- }
- {
- 0 0 0 1 FourEqual
- {
- /plateindex 3 def
- }
- {
- 0 0 0 0 FourEqual
- {
- /plateindex 5 def
- } if
- } ifelse
- } ifelse
- } ifelse
- } ifelse
- pop pop pop pop
- } if
- plateindex
- end
- } def
-
-
- /colorimage
- {
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 1 index def
- /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
-
- 4 sourcecount add index dup
- 8 eq exch 1 eq or not
- end
-
- {
- /_colorimage load null ne
- {
- _colorimage
- }
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get
- 7 add { pop } repeat
- } ifelse
- }
- {
- dup 3 eq
- TestPlateIndex
- dup -1 eq exch 5 eq or or
- {
- /_colorimage load null eq
- {
- ColorImageCompositeEmulator
- }
- {
- dup 1 eq
- {
- pop pop image
- }
- {
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- gsave
-
- 0 _currenttransfer exec
- 1 _currenttransfer exec
- eq
- { 0 _currenttransfer exec 0.5 lt }
- { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
-
- { { pop 0 } } { { pop 1 } } ifelse
- systemdict /settransfer get exec
- } if
-
- _colorimage
-
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- grestore
- } if
- } ifelse
- } ifelse
- }
- {
- dup 1 eq
- {
- pop pop
- image
- }
- {
- pop pop
-
- Adobe_ColorImage_AI6_Vars begin
- sourcecount -1 0
- {
- exch sourcearray 3 1 roll put
- } for
-
- /SeparateCMYKImageProc load
- end
-
- systemdict /image get exec
- } ifelse
- } ifelse
- } ifelse
- } def
-
- /XI
- {
- Adobe_ColorImage_AI6_Vars begin
- gsave
- /XIMask exch 0 ne def
- /XIBinary exch 0 ne def
- pop
- pop
- /XIChannelCount exch def
- /XIBitsPerPixel exch def
- /XIImageHeight exch def
- /XIImageWidth exch def
- pop pop pop pop
- /XIImageMatrix exch def
-
- XIBitsPerPixel 1 eq
- {
- XIImageWidth 8 div ceiling cvi
- }
- {
- XIImageWidth XIChannelCount mul
- } ifelse
- /XIBuffer exch string def
-
- XIBinary
- {
- /XIDataProc { currentfile XIBuffer readstring pop } def
- currentfile 128 string readline pop pop
- }
- {
- /XIDataProc { currentfile XIBuffer readhexstring pop } def
- } ifelse
-
- 0 0 moveto
- XIImageMatrix concat
- XIImageWidth XIImageHeight scale
-
- XIMask
- {
- XIImageWidth XIImageHeight
- false
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- /_lp /null ddef
- _fc
- /_lp /imagemask ddef
-
- imagemask
- }
- {
- XIImageWidth XIImageHeight
- XIBitsPerPixel
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- XIChannelCount 1 eq
- {
-
- gsave
- 0 setgray
-
- image
-
- grestore
- }
- {
- false
- XIChannelCount
- colorimage
- } ifelse
- } ifelse
- grestore
- end
- } def
-
-end
-%%EndProcSet
-%%BeginResource: procset Adobe_Illustrator_AI5 1.1 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Full Prolog)
-%%Version: 1.1
-%%CreationDate: (3/7/1994) ()
-%%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_Illustrator_AI5_vars 81 dict dup begin
-put
-/_eo false def
-/_lp /none def
-/_pf
-{
-} def
-/_ps
-{
-} def
-/_psf
-{
-} def
-/_pss
-{
-} def
-/_pjsf
-{
-} def
-/_pjss
-{
-} def
-/_pola 0 def
-/_doClip 0 def
-/cf currentflat def
-/_tm matrix def
-/_renderStart
-[
-/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0
-] def
-/_renderEnd
-[
-null null null null /i1 /i1 /i1 /i1
-] def
-/_render -1 def
-/_rise 0 def
-/_ax 0 def
-/_ay 0 def
-/_cx 0 def
-/_cy 0 def
-/_leading
-[
-0 0
-] def
-/_ctm matrix def
-/_mtx matrix def
-/_sp 16#020 def
-/_hyphen (-) def
-/_fScl 0 def
-/_cnt 0 def
-/_hs 1 def
-/_nativeEncoding 0 def
-/_useNativeEncoding 0 def
-/_tempEncode 0 def
-/_pntr 0 def
-/_tDict 2 dict def
-/_wv 0 def
-/Tx
-{
-} def
-/Tj
-{
-} def
-/CRender
-{
-} def
-/_AI3_savepage
-{
-} def
-/_gf null def
-/_cf 4 array def
-/_if null def
-/_of false def
-/_fc
-{
-} def
-/_gs null def
-/_cs 4 array def
-/_is null def
-/_os false def
-/_sc
-{
-} def
-/_pd 1 dict def
-/_ed 15 dict def
-/_pm matrix def
-/_fm null def
-/_fd null def
-/_fdd null def
-/_sm null def
-/_sd null def
-/_sdd null def
-/_i null def
-/discardSave null def
-/buffer 256 string def
-/beginString null def
-/endString null def
-/endStringLength null def
-/layerCnt 1 def
-/layerCount 1 def
-/perCent (%) 0 get def
-/perCentSeen? false def
-/newBuff null def
-/newBuffButFirst null def
-/newBuffLast null def
-/clipForward? false def
-end
-userdict /Adobe_Illustrator_AI5 known not {
- userdict /Adobe_Illustrator_AI5 91 dict put
-} if
-userdict /Adobe_Illustrator_AI5 get begin
-/initialize
-{
- Adobe_Illustrator_AI5 dup begin
- Adobe_Illustrator_AI5_vars begin
- discardDict
- {
- bind pop pop
- } forall
- dup /nc get begin
- {
- dup xcheck 1 index type /operatortype ne and
- {
- bind
- } if
- pop pop
- } forall
- end
- newpath
-} def
-/terminate
-{
- end
- end
-} def
-/_
-null def
-/ddef
-{
- Adobe_Illustrator_AI5_vars 3 1 roll put
-} def
-/xput
-{
- dup load dup length exch maxlength eq
- {
- dup dup load dup
- length 2 mul dict copy def
- } if
- load begin
- def
- end
-} def
-/npop
-{
- {
- pop
- } repeat
-} def
-/sw
-{
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
-} def
-/swj
-{
- dup 4 1 roll
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
- 6 2 roll /_cnt 0 ddef
- {
- 1 index eq
- {
- /_cnt _cnt 1 add ddef
- } if
- } forall
- pop
- exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop
-} def
-/ss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put pop
- gsave
- false charpath currentpoint
- 4 index setmatrix
- stroke
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 3 npop
-} def
-/jss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- gsave
- _sp eq
- {
- exch 6 index 6 index 6 index 5 -1 roll widthshow
- currentpoint
- }
- {
- false charpath currentpoint
- 4 index setmatrix stroke
- } ifelse
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 6 npop
-} def
-/sp
-{
- {
- 2 npop (0) exch
- 2 copy 0 exch put pop
- false charpath
- 2 copy rmoveto
- } exch cshow
- 2 npop
-} def
-/jsp
-{
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- _sp eq
- {
- exch 5 index 5 index 5 index 5 -1 roll widthshow
- }
- {
- false charpath
- } ifelse
- 2 copy rmoveto
- } exch cshow
- 5 npop
-} def
-/pl
-{
- transform
- 0.25 sub round 0.25 add exch
- 0.25 sub round 0.25 add exch
- itransform
-} def
-/setstrokeadjust where
-{
- pop true setstrokeadjust
- /c
- {
- curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll curveto
- } def
- /V
- /v load def
- /y
- {
- 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- lineto
- } def
- /L
- /l load def
- /m
- {
- moveto
- } def
-}
-{
- /c
- {
- pl curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll pl curveto
- } def
- /V
- /v load def
- /y
- {
- pl 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- pl lineto
- } def
- /L
- /l load def
- /m
- {
- pl moveto
- } def
-} ifelse
-/d
-{
- setdash
-} def
-/cf
-{
-} def
-/i
-{
- dup 0 eq
- {
- pop cf
- } if
- setflat
-} def
-/j
-{
- setlinejoin
-} def
-/J
-{
- setlinecap
-} def
-/M
-{
- setmiterlimit
-} def
-/w
-{
- setlinewidth
-} def
-/XR
-{
- 0 ne
- /_eo exch ddef
-} def
-/H
-{
-} def
-/h
-{
- closepath
-} def
-/N
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- _eo {eoclip} {clip} ifelse /_doClip 0 ddef
- } if
- newpath
- }
- {
- /CRender
- {
- N
- } ddef
- } ifelse
-} def
-/n
-{
- N
-} def
-/F
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc
- /_doClip 0 ddef
- }
- {
- _pf
- } ifelse
- }
- {
- /CRender
- {
- F
- } ddef
- } ifelse
-} def
-/f
-{
- closepath
- F
-} def
-/S
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- _ps
- } ifelse
- }
- {
- /CRender
- {
- S
- } ddef
- } ifelse
-} def
-/s
-{
- closepath
- S
-} def
-/B
-{
- _pola 0 eq
- {
- _doClip 1 eq
- gsave F grestore
- {
- gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- S
- } ifelse
- }
- {
- /CRender
- {
- B
- } ddef
- } ifelse
-} def
-/b
-{
- closepath
- B
-} def
-/W
-{
- /_doClip 1 ddef
-} def
-/*
-{
- count 0 ne
- {
- dup type /stringtype eq
- {
- pop
- } if
- } if
- newpath
-} def
-/u
-{
-} def
-/U
-{
-} def
-/q
-{
- _pola 0 eq
- {
- gsave
- } if
-} def
-/Q
-{
- _pola 0 eq
- {
- grestore
- } if
-} def
-/*u
-{
- _pola 1 add /_pola exch ddef
-} def
-/*U
-{
- _pola 1 sub /_pola exch ddef
- _pola 0 eq
- {
- CRender
- } if
-} def
-/D
-{
- pop
-} def
-/*w
-{
-} def
-/*W
-{
-} def
-/`
-{
- /_i save ddef
- clipForward?
- {
- nulldevice
- } if
- 6 1 roll 4 npop
- concat pop
- userdict begin
- /showpage
- {
- } def
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {pop false setstrokeadjust} if
- newpath
- 0 setgray
- false setoverprint
-} def
-/~
-{
- end
- _i restore
-} def
-/O
-{
- 0 ne
- /_of exch ddef
- /_lp /none ddef
-} def
-/R
-{
- 0 ne
- /_os exch ddef
- /_lp /none ddef
-} def
-/g
-{
- /_gf exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _gf setgray
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/G
-{
- /_gs exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _gs setgray
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/k
-{
- _cf astore pop
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _cf aload pop setcmykcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/K
-{
- _cs astore pop
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _cs aload pop setcmykcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/x
-{
- /_gf exch ddef
- findcmykcustomcolor
- /_if exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _if _gf 1 exch sub setcustomcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/X
-{
- /_gs exch ddef
- findcmykcustomcolor
- /_is exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _is _gs 1 exch sub setcustomcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/A
-{
- pop
-} def
-/annotatepage
-{
-userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse
-} def
-/XT {
- pop pop
-} def
-/discard
-{
- save /discardSave exch store
- discardDict begin
- /endString exch store
- gt38?
- {
- 2 add
- } if
- load
- stopped
- pop
- end
- discardSave restore
-} bind def
-userdict /discardDict 7 dict dup begin
-put
-/pre38Initialize
-{
- /endStringLength endString length store
- /newBuff buffer 0 endStringLength getinterval store
- /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store
- /newBuffLast newBuff endStringLength 1 sub 1 getinterval store
-} def
-/shiftBuffer
-{
- newBuff 0 newBuffButFirst putinterval
- newBuffLast 0
- currentfile read not
- {
- stop
- } if
- put
-} def
-0
-{
- pre38Initialize
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff endString eq
- {
- cleartomark stop
- } if
- shiftBuffer
- } loop
- }
- {
- stop
- } ifelse
-} def
-1
-{
- pre38Initialize
- /beginString exch store
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff beginString eq
- {
- /layerCount dup load 1 add store
- }
- {
- newBuff endString eq
- {
- /layerCount dup load 1 sub store
- layerCount 0 eq
- {
- cleartomark stop
- } if
- } if
- } ifelse
- shiftBuffer
- } loop
- } if
-} def
-2
-{
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- endString eq
- {
- cleartomark stop
- } if
- } loop
-} def
-3
-{
- /beginString exch store
- /layerCnt 1 store
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- dup beginString eq
- {
- pop /layerCnt dup load 1 add store
- }
- {
- endString eq
- {
- layerCnt 1 eq
- {
- cleartomark stop
- }
- {
- /layerCnt dup load 1 sub store
- } ifelse
- } if
- } ifelse
- } loop
-} def
-end
-userdict /clipRenderOff 15 dict dup begin
-put
-{
- /n /N /s /S /f /F /b /B
-}
-{
- {
- _doClip 1 eq
- {
- /_doClip 0 ddef _eo {eoclip} {clip} ifelse
- } if
- newpath
- } def
-} forall
-/Tr /pop load def
-/Bb {} def
-/BB /pop load def
-/Bg {12 npop} def
-/Bm {6 npop} def
-/Bc /Bm load def
-/Bh {4 npop} def
-end
-/Lb
-{
- 4 npop
- 6 1 roll
- pop
- 4 1 roll
- pop pop pop
- 0 eq
- {
- 0 eq
- {
- (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard
- }
- {
-
- /clipForward? true def
-
- /Tx /pop load def
- /Tj /pop load def
-
- currentdict end clipRenderOff begin begin
- } ifelse
- }
- {
- 0 eq
- {
- save /discardSave exch store
- } if
- } ifelse
-} bind def
-/LB
-{
- discardSave dup null ne
- {
- restore
- }
- {
- pop
- clipForward?
- {
- currentdict
- end
- end
- begin
-
- /clipForward? false ddef
- } if
- } ifelse
-} bind def
-/Pb
-{
- pop pop
- 0 (%AI5_EndPalette) discard
-} bind def
-/Np
-{
- 0 (%AI5_End_NonPrinting--) discard
-} bind def
-/Ln /pop load def
-/Ap
-/pop load def
-/Ar
-{
- 72 exch div
- 0 dtransform dup mul exch dup mul add sqrt
- dup 1 lt
- {
- pop 1
- } if
- setflat
-} def
-/Mb
-{
- q
-} def
-/Md
-{
-} def
-/MB
-{
- Q
-} def
-/nc 3 dict def
-nc begin
-/setgray
-{
- pop
-} bind def
-/setcmykcolor
-{
- 4 npop
-} bind def
-/setcustomcolor
-{
- 2 npop
-} bind def
-currentdict readonly pop
-end
-end
-setpacking
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%IncludeFont: Univers
-Adobe_level2_AI5 /initialize get exec
-Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec
-Adobe_ColorImage_AI6 /initialize get exec
-Adobe_Illustrator_AI5 /initialize get exec
-[
-39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
-/Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
-/egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
-/oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
-/udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
-/registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
-/.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
-/.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
-/questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
-/guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
-/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
-/.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
-/fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
-/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
-/Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
-/Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
-/hungarumlaut/ogonek/caron
-TE
-%AI3_BeginEncoding: _Univers Univers
-[/_Univers/Univers 0 0 1 TZ
-%AI3_EndEncoding AdobeType
-%AI5_Begin_NonPrinting
-Np
-8 Bn
-%AI5_BeginGradient: (Black & White)
-(Black & White) 0 2 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Green & Blue)
-(Green & Blue) 0 2 Bd
-[
-<
-99999A9A9B9B9B9C9C9D9D9D9E9E9F9F9FA0A0A1A1A1A2A2A3A3A3A4A4A5A5A5A6A6A7A7A7A8A8A9
-A9A9AAAAABABABACACADADADAEAEAFAFAFB0B0B1B1B1B2B2B3B3B3B4B4B5B5B5B6B6B7B7B7B8B8B9
-B9B9BABABBBBBBBCBCBDBDBDBEBEBFBFBFC0C0C1C1C1C2C2C3C3C3C4C4C5C5C5C6C6C7C7C7C8C8C9
-C9C9CACACBCBCBCCCCCDCDCDCECECFCFCFD0D0D1D1D1D2D2D3D3D3D4D4D5D5D5D6D6D7D7D7D8D8D9
-D9D9DADADBDBDBDCDCDDDDDDDEDEDFDFDFE0E0E1E1E1E2E2E3E3E3E4E4E5E5E5E6E6E7E7E7E8E8E9
-E9E9EAEAEBEBEBECECEDEDEDEEEEEFEFEFF0F0F1F1F1F2F2F3F3F3F4F4F5F5F5F6F6F7F7F7F8F8F9
-F9F9FAFAFBFBFBFCFCFDFDFDFEFEFFFF
->
-<
-000102020304050506070808090A0B0B0C0D0E0E0F101111121314141516171718191A1A1B1C1D1D
-1E1F20202122232324252626272829292A2B2C2C2D2E2F2F303132323334353536373838393A3B3B
-3C3D3E3E3F404141424344444546474748494A4A4B4C4D4D4E4F5050515253535455565657585959
-5A5B5C5C5D5E5F5F606162626364656566676868696A6B6B6C6D6E6E6F7071717273747475767777
-78797A7A7B7C7D7D7E7F80808182828384858586878888898A8B8B8C8D8E8E8F9091919293949495
-96979798999A9A9B9C9D9D9E9FA0A0A1A2A3A3A4A5A6A6A7A8A9A9AAABACACADAEAFAFB0B1B2B2B3
-B4B5B5B6B7B8B8B9BABBBBBCBDBEBEBF
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-[
-1 0.75 0 0 1 50 100 %_Bs
-0.6 0 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Pink, Yellow, Green)
-(Pink, Yellow, Green) 0 3 Bd
-[
-<
-00000000000000000000000000000000000000010101010101010101010101010101010101010101
-01010101010202020202020202020202020202020202020202020203030303030303030303030303
-03030303030303030404040404040404040404040404040404040404050505050505050505050505
-05050505050505060606060606060606060606060606060606060707070707070707070707070707
-07070707080808080808080808080808080808080809090909090909090909090909090909090A0A
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0C
-0C0C0C0C0C0C0C0D0D0D0D0D
->
-<
-050506060606070708080809090A0A0A0B0B0C0C0D0D0E0E0F0F1010111112121313141415151617
-17181819191A1A1B1C1C1D1D1E1F1F202021222223232425252626272828292A2A2B2C2C2D2D2E2F
-2F3031313233333435353637373839393A3B3B3C3D3E3E3F4040414242434445454647474849494A
-4B4C4C4D4E4F4F505151525354545556575758595A5A5B5C5C5D5E5F5F6061626363646566666768
-69696A6B6C6C6D6E6F707071727373747576777778797A7B7B7C7D7E7F7F80818283838485868787
-88898A8B8B8C8D8E8F8F9091929394949596979898999A9B9C9D9D9E9FA0A1A2A2A3A4A5A6A7A7A8
-A9AAABACADADAEAFB0B1B2B2
->
-<
-CCCCCBCBCBCACACAC9C9C8C8C7C7C6C6C5C5C4C4C3C2C2C1C1C0C0BFBEBEBDBDBCBBBBBAB9B9B8B7
-B7B6B6B5B4B4B3B2B1B1B0AFAFAEADADACABAAAAA9A8A8A7A6A5A5A4A3A2A2A1A0A09F9E9D9C9C9B
-9A999998979696959493929291908F8E8E8D8C8B8A8A8988878686858483828181807F7E7D7C7C7B
-7A7978777776757473727171706F6E6D6C6B6A6A69686766656463636261605F5E5D5C5B5B5A5958
-5756555453525151504F4E4D4C4B4A49484746464544434241403F3E3D3C3B3A3938383736353433
-3231302F2E2D2C2B2A29282726252423222221201F1E1D1C1B1A191817161514131211100F0E0D0C
-0B0A09080706050403020100
->
-0
-1 %_Br
-<
-737271706F6E6D6C6B6A696867666564636261605F5E5D5C5B5B5A59585756555453525150504F4E
-4D4C4B4A4949484746454443434241403F3E3E3D3C3B3A3A393837363635343333323130302F2E2D
-2D2C2B2A2A29282827262525242323222121201F1F1E1D1D1C1C1B1A1A1918181717161615141413
-1312121111100F0F0E0E0D0D0C0C0C0B0B0A0A090908080807070606060505050404040303030202
-020201010101010000000000
->
-<
-00000000000000000000000001010101010101010101010101010101010101010101010102020202
-02020202020202020202020202020202020202020202030303030303030303030303030303030303
-03030303030303030303030303040404040404040404040404040404040404040404040404040404
-04040404040404040404050505050505050505050505050505050505050505050505050505050505
-050505050505050505050505
->
-<
-BFBFBFC0C0C0C0C0C0C0C0C0C1C1C1C1C1C1C1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C3C3
-C3C4C4C4C4C4C4C4C4C4C4C5C5C5C5C5C5C5C5C5C5C5C6C6C6C6C6C6C6C6C6C6C6C6C7C7C7C7C7C7
-C7C7C7C7C7C7C8C8C8C8C8C8C8C8C8C8C8C8C8C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9CACACACACACA
-CACACACACACACACACACACBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCCCCCCCCCCCCCCCC
-CCCCCCCCCCCCCCCCCCCCCCCC
->
-0
-1 %_Br
-[
-0.05 0.7 0 0 1 50 100 %_Bs
-0 0.02 0.8 0 1 57 36 %_Bs
-0.45 0 0.75 0 1 37 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Purple, Red & Yellow)
-(Purple, Red & Yellow) 0 3 Bd
-[
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A
->
-<
-CCCCCCCDCDCDCDCDCECECECECECFCFCFCFD0D0D0D0D0D1D1D1D1D1D2D2D2D2D2D3D3D3D3D3D4D4D4
-D4D5D5D5D5D5D6D6D6D6D6D7D7D7D7D7D8D8D8D8D8D9D9D9D9DADADADADADBDBDBDBDBDCDCDCDCDC
-DDDDDDDDDDDEDEDEDEDFDFDFDFDFE0E0E0E0E0E1E1E1E1E1E2E2E2E2E2E3E3E3E3E4E4E4E4E4E5E5
-E5E5E5E6E6E6E6E6E7E7E7E7E7E8E8E8E8E9E9E9E9E9EAEAEAEAEAEBEBEBEBEBECECECECECEDEDED
-EDEEEEEEEEEEEFEFEFEFEFF0F0F0F0F0F1F1F1F1F1F2F2F2F2F3F3F3F3F3F4F4F4F4F4F5F5F5F5F5
-F6F6F6F6F6F7F7F7F7F8F8F8F8F8F9F9F9F9F9FAFAFAFAFAFBFBFBFBFBFCFCFCFCFDFDFDFDFDFEFE
-FEFEFEFFFFFF
->
-0
-1 %_Br
-<
-E5E4E3E2E1E0DFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBE
-BDBCBBBAB9B8B7B6B5B4B3B2B1B0AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A99989796
-9594939291908F8E8D8C8B8A898887868584838281807F7E7D7C7B7A797877767574737271706F6E
-6D6C6B6A696867666564636261605F5E5D5C5B5A595857565554535251504F4E4D4C4B4A49484746
-4544434241403F3E3D3C3B3A393837363534333231302F2E2D2C2B2A292827262524232221201F1E
-1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
->
-<
-E5E6E6E6E6E6E6E6E6E7E7E7E7E7E7E7E7E7E8E8E8E8E8E8E8E8E8E9E9E9E9E9E9E9E9E9EAEAEAEA
-EAEAEAEAEAEBEBEBEBEBEBEBEBEBECECECECECECECECECEDEDEDEDEDEDEDEDEDEEEEEEEEEEEEEEEE
-EEEFEFEFEFEFEFEFEFEFF0F0F0F0F0F0F0F0F0F1F1F1F1F1F1F1F1F1F2F2F2F2F2F2F2F2F2F3F3F3
-F3F3F3F3F3F3F4F4F4F4F4F4F4F4F4F5F5F5F5F5F5F5F5F5F6F6F6F6F6F6F6F6F6F7F7F7F7F7F7F7
-F7F7F8F8F8F8F8F8F8F8F8F9F9F9F9F9F9F9F9F9FAFAFAFAFAFAFAFAFAFBFBFBFBFBFBFBFBFBFCFC
-FCFCFCFCFCFCFCFDFDFDFDFDFDFDFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFF
->
-<
-00010203040405060708090A0B0C0C0D0E0F10111213141415161718191A1B1C1D1D1E1F20212223
-242525262728292A2B2C2D2D2E2F30313233343535363738393A3B3C3D3D3E3F4041424344454546
-4748494A4B4C4D4E4E4F50515253545556565758595A5B5C5D5E5E5F60616263646566666768696A
-6B6C6D6E6E6F70717273747576767778797A7B7C7D7E7F7F80818283848586878788898A8B8C8D8E
-8F8F90919293949596979798999A9B9C9D9E9F9FA0A1A2A3A4A5A6A7A7A8A9AAABACADAEAFAFB0B1
-B2B3B4B5B6B7B8B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C8C9CACBCC
->
-0
-1 %_Br
-[
-0 0.04 1 0 1 50 100 %_Bs
-0 1 0.8 0 1 50 50 %_Bs
-0.9 0.9 0 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Rainbow)
-(Rainbow) 0 6 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-0
-1 %_Br
-1
-<
-0708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E
-2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556
-5758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E
-7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6
-A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCE
-CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6
-F7F8F9FAFBFCFDFEFF
->
-0
-0
-1 %_Br
-1
-<
-00000000000000000000000000000000000001010101010101010101010101010101010101010101
-01010101010101010101010101010202020202020202020202020202020202020202020202020202
-02020202020202020202030303030303030303030303030303030303030303030303030303030303
-03030303030304040404040404040404040404040404040404040404040404040404040404040404
-04040505050505050505050505050505050505050505050505050505050505050505050505050606
-06060606060606060606060606060606060606060606060606060606060606060606070707070707
-07070707070707070707070707070707
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0
-1
-0
-1 %_Br
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-1 %_Br
-[
-0 1 0 0 1 50 100 %_Bs
-1 1 0 0 1 50 80 %_Bs
-1 0.0279 0 0 1 50 60 %_Bs
-1 0 1 0 1 50 40 %_Bs
-0 0 1 0 1 50 20 %_Bs
-0 1 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Steel Bar)
-(Steel Bar) 0 3 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 70 %_Bs
-0 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Orange Radial)
-(Yellow & Orange Radial) 1 2 Bd
-[
-0
-<
-0001010203040506060708090A0B0C0C0D0E0F10111213131415161718191A1B1C1D1D1E1F202122
-232425262728292A2B2B2C2D2E2F303132333435363738393A3B3C3D3E3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60606162636465666768696A6B6C6D6E6F
-707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C
->
-<
-FFFFFFFFFEFEFEFEFEFEFEFDFDFDFDFDFDFCFCFCFCFCFCFBFBFBFBFBFBFAFAFAFAFAFAF9F9F9F9F9
-F9F8F8F8F8F8F8F7F7F7F7F7F7F6F6F6F6F6F6F5F5F5F5F5F5F4F4F4F4F4F3F3F3F3F3F3F2F2F2F2
-F2F2F1F1F1F1F1F0F0F0F0F0F0EFEFEFEFEFEFEEEEEEEEEEEDEDEDEDEDEDECECECECECEBEBEBEBEB
-EBEAEAEAEAEAE9E9E9E9E9E9E8E8E8E8E8E8E7E7E7E7E7E6E6E6E6E6E5
->
-0
-1 %_Br
-[
-0 0 1 0 1 52 19 %_Bs
-0 0.55 0.9 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Purple Radial)
-(Yellow & Purple Radial) 1 2 Bd
-[
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-<
-1415161718191A1B1C1D1E1F1F202122232425262728292A2A2B2C2D2E2F30313233343536363738
-393A3B3C3D3E3F40414142434445464748494A4B4C4D4D4E4F50515253545556575858595A5B5C5D
-5E5F60616263646465666768696A6B6C6D6E6F6F707172737475767778797A7B7B7C7D7E7F808182
-83848586868788898A8B8C8D8E8F90919292939495969798999A9B9C9D9D9E9FA0A1A2A3A4A5A6A7
-A8A9A9AAABACADAEAFB0B1B2B3B4B4B5B6B7B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C9CACBCB
-CCCDCECFD0D1D2D3D4D5D6D7D7D8D9DADBDCDDDEDFE0E1E2E2E3E4E5E6E7E8E9EAEBECEDEEEEEFF0
-F1F2F3F4F5F6F7F8F9F9FAFBFCFDFEFF
->
-<
-ABAAAAA9A8A7A7A6A5A5A4A3A3A2A1A1A09F9F9E9D9D9C9B9B9A9999989797969595949393929191
-908F8F8E8D8D8C8B8B8A8989888787868585848383828181807F7F7E7D7D7C7B7B7A797978777776
-7575747373727171706F6F6E6D6D6C6B6B6A6969686767666565646362626160605F5E5E5D5C5C5B
-5A5A5958585756565554545352525150504F4E4E4D4C4C4B4A4A4948484746464544444342424140
-403F3E3E3D3C3C3B3A3A3938383736363534343332323130302F2E2E2D2C2C2B2A2A292828272626
-25242423222121201F1F1E1D1D1C1B1B1A1919181717161515141313121111100F0F0E0D0D0C0B0B
-0A090908070706050504030302010100
->
-0
-1 %_Br
-[
-0 0.08 0.67 0 1 50 14 %_Bs
-1 1 0 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_End_NonPrinting--
-%AI5_BeginPalette
-0 0 Pb
-Pn
-Pc
-1 g
-Pc
-0 g
-Pc
-0 0 0 0 k
-Pc
-0.75 g
-Pc
-0.5 g
-Pc
-0.25 g
-Pc
-0 g
-Pc
-Bb
-2 (Black & White) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0 0 0 k
-Pc
-0.5 0 0 0 k
-Pc
-0.75 0 0 0 k
-Pc
-1 0 0 0 k
-Pc
-0.25 0.25 0 0 k
-Pc
-0.5 0.5 0 0 k
-Pc
-0.75 0.75 0 0 k
-Pc
-1 1 0 0 k
-Pc
-Bb
-2 (Pink, Yellow, Green) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0 0 k
-Pc
-0 0.5 0 0 k
-Pc
-0 0.75 0 0 k
-Pc
-0 1 0 0 k
-Pc
-0 0.25 0.25 0 k
-Pc
-0 0.5 0.5 0 k
-Pc
-0 0.75 0.75 0 k
-Pc
-0 1 1 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Purple Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0 0.25 0 k
-Pc
-0 0 0.5 0 k
-Pc
-0 0 0.75 0 k
-Pc
-0 0 1 0 k
-Pc
-0.25 0 0.25 0 k
-Pc
-0.5 0 0.5 0 k
-Pc
-0.75 0 0.75 0 k
-Pc
-1 0 1 0 k
-Pc
-Bb
-2 (Rainbow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0 0 k
-Pc
-0.5 0.25 0 0 k
-Pc
-0.75 0.375 0 0 k
-Pc
-1 0.5 0 0 k
-Pc
-0.125 0.25 0 0 k
-Pc
-0.25 0.5 0 0 k
-Pc
-0.375 0.75 0 0 k
-Pc
-0.5 1 0 0 k
-Pc
-Bb
-2 (Steel Bar) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0.125 0 k
-Pc
-0 0.5 0.25 0 k
-Pc
-0 0.75 0.375 0 k
-Pc
-0 1 0.5 0 k
-Pc
-0 0.125 0.25 0 k
-Pc
-0 0.25 0.5 0 k
-Pc
-0 0.375 0.75 0 k
-Pc
-0 0.5 1 0 k
-Pc
-Bb
-2 (Purple, Red & Yellow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0 0.25 0 k
-Pc
-0.25 0 0.5 0 k
-Pc
-0.375 0 0.75 0 k
-Pc
-0.5 0 1 0 k
-Pc
-0.25 0 0.125 0 k
-Pc
-0.5 0 0.25 0 k
-Pc
-0.75 0 0.375 0 k
-Pc
-1 0 0.5 0 k
-Pc
-Bb
-2 (Green & Blue) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0.125 0 k
-Pc
-0.5 0.25 0.25 0 k
-Pc
-0.75 0.375 0.375 0 k
-Pc
-1 0.5 0.5 0 k
-Pc
-0.25 0.25 0.125 0 k
-Pc
-0.5 0.5 0.25 0 k
-Pc
-0.75 0.75 0.375 0 k
-Pc
-1 1 0.5 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Orange Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0.25 0.125 0 k
-Pc
-0.25 0.5 0.25 0 k
-Pc
-0.375 0.75 0.375 0 k
-Pc
-0.5 1 0.5 0 k
-Pc
-0.125 0.25 0.25 0 k
-Pc
-0.25 0.5 0.5 0 k
-Pc
-0.375 0.75 0.75 0 k
-Pc
-0.5 1 1 0 k
-Pc
-0 0 0 0 k
-Pc
-0.125 0.125 0.25 0 k
-Pc
-0.25 0.25 0.5 0 k
-Pc
-0.375 0.375 0.75 0 k
-Pc
-0.5 0.5 1 0 k
-Pc
-0.25 0.125 0.25 0 k
-Pc
-0.5 0.25 0.5 0 k
-Pc
-0.75 0.375 0.75 0 k
-Pc
-1 0.5 1 0 k
-Pc
-PB
-%AI5_EndPalette
-%%EndSetup
-%AI5_BeginLayer
-1 1 1 1 0 0 0 79 128 255 Lb
-(Layer 1) Ln
-0 A
-800 Ar
-0 J 0 j 1 w 4 M []0 d
-%AI3_Note:
-0 D
-0 XR
--4014 283.5 m
-4626 283.5 L
-(N) *
-453.5 4716 m
-453.5 -3924 L
-(N) *
-85 4716 m
-85 -3924 L
-(N) *
--4014 765.5 m
-4626 765.5 L
-(N) *
-0 R
-0 G
-113 683.5 m
-439 683.5 l
-S
-113 663.5 m
-439 663.5 l
-S
-113 643.5 m
-439 643.5 l
-S
-113 686 m
-439 686 l
-S
-1 Ap
-439 624 m
-439 709 L
-113 709 L
-113 624 L
-439 624 L
-s
-0 Ap
-178.5 709 m
-178.5 624 l
-S
-243 709 m
-243 624 l
-S
-374 709 m
-374 624 l
-S
-308.5 709 m
-308.5 624 l
-S
-0 To
-1 0 0 1 146 692 0 Tp
-TP
--12.2278 0 Td
-0 Tr
-0 O
-0 g
-/_Univers 10 Tf
-0 Ts
-100 Tz
-0 Tt
-1 TA
-%_ 0 XL
-36 0 Xb
-XB
-0 0 5 TC
-100 100 200 TW
-0 0 0 Ti
-1 Ta
-0 0 2 2 3 Th
-0 Tq
-0 0 Tl
-0 Tc
-0 Tw
-(key 1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 213 692 0 Tp
-TP
--12.2278 0 Td
-0 Tr
-(key 2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 276 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 3) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 225.5 747.5 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 336.5 693.5 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 341 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 4) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 407.5 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 5) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 185.5 736 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 145 669.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 144.5 650.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 145 630 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 669 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 649.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 629.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 669 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(a) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 649.5 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(d) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 629.5 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(g) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 669 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(b) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 649.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(e) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 629.5 0 Tp
-TP
--8.8879 0 Td
-0 Tr
-(N/A) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 669 0 Tp
-TP
--2.5 0 Td
-0 Tr
-(c) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 649.5 0 Tp
-TP
--1.6638 0 Td
-0 Tr
-(f) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 629.5 0 Tp
-TP
--1.3892 0 Td
-0 Tr
-(i) Tx
-(\r) TX
-TO
-LB
-%AI5_EndLayer--
-%%PageTrailer
-gsave annotatepage grestore showpage
-%%Trailer
-Adobe_Illustrator_AI5 /terminate get exec
-Adobe_ColorImage_AI6 /terminate get exec
-Adobe_typography_AI5 /terminate get exec
-Adobe_level2_AI5 /terminate get exec
-%%EOF
diff --git a/lib/snmp/doc/src/getnext2.ps b/lib/snmp/doc/src/getnext2.ps
deleted file mode 100644
index 49721647cf..0000000000
--- a/lib/snmp/doc/src/getnext2.ps
+++ /dev/null
@@ -1,2997 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: Adobe Illustrator(r) 6.0
-%%For: (Anna Fedoriw) (Ericsson Telecom)
-%%Title: (GetNext311.eps)
-%%CreationDate: (97-05-23) (14.04)
-%%BoundingBox: 112 623 440 757
-%%HiResBoundingBox: 112.5 623.5 439.5 756.8677
-%%DocumentProcessColors: Black
-%%DocumentFonts: Univers
-%%DocumentSuppliedResources: procset Adobe_level2_AI5 1.0 0
-%%+ procset Adobe_typography_AI5 1.0 0
-%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6
-%%+ procset Adobe_Illustrator_AI5 1.0 0
-%AI5_FileFormat 2.0
-%AI3_ColorUsage: Black&White
-%%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set)
-%%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1
-%%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 ()
-%AI3_TemplateBox: 306 396 306 396
-%AI3_TileBox: 21 -12 588 802
-%AI3_DocumentPreview: Macintosh_ColorPic
-%AI5_ArtSize: 595.2756 841.8898
-%AI5_RulerUnits: 1
-%AI5_ArtFlags: 0 0 0 1 0 0 1 1 0
-%AI5_TargetResolution: 800
-%AI5_NumLayers: 1
-%AI5_OpenToView: 54 804 2 1146 827 58 1 1 3 40
-%AI5_OpenViewLayers: 7
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset Adobe_level2_AI5 1.2 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation)
-%%Version: 1.2
-%%CreationDate: (04/10/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-userdict /Adobe_level2_AI5 23 dict dup begin
- put
- /packedarray where not
- {
- userdict begin
- /packedarray
- {
- array astore readonly
- } bind def
- /setpacking /pop load def
- /currentpacking false def
- end
- 0
- } if
- pop
- userdict /defaultpacking currentpacking put true setpacking
- /initialize
- {
- Adobe_level2_AI5 begin
- } bind def
- /terminate
- {
- currentdict Adobe_level2_AI5 eq
- {
- end
- } if
- } bind def
- mark
- /setcustomcolor where not
- {
- /findcmykcustomcolor
- {
- 5 packedarray
- } bind def
- /setcustomcolor
- {
- exch aload pop pop
- 4
- {
- 4 index mul 4 1 roll
- } repeat
- 5 -1 roll pop
- setcmykcolor
- }
- def
- } if
-
- /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def
- userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put
- userdict /level2?
- systemdict /languagelevel known dup
- {
- pop systemdict /languagelevel get 2 ge
- } if
- put
-/level2ScreenFreq
-{
- begin
- 60
- HalftoneType 1 eq
- {
- pop Frequency
- } if
- HalftoneType 2 eq
- {
- pop GrayFrequency
- } if
- HalftoneType 5 eq
- {
- pop Default level2ScreenFreq
- } if
- end
-} bind def
-userdict /currentScreenFreq
- level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put
-level2? not
- {
- /setcmykcolor where not
- {
- /setcmykcolor
- {
- exch .11 mul add exch .59 mul add exch .3 mul add
- 1 exch sub setgray
- } def
- } if
- /currentcmykcolor where not
- {
- /currentcmykcolor
- {
- 0 0 0 1 currentgray sub
- } def
- } if
- /setoverprint where not
- {
- /setoverprint /pop load def
- } if
- /selectfont where not
- {
- /selectfont
- {
- exch findfont exch
- dup type /arraytype eq
- {
- makefont
- }
- {
- scalefont
- } ifelse
- setfont
- } bind def
- } if
- /cshow where not
- {
- /cshow
- {
- [
- 0 0 5 -1 roll aload pop
- ] cvx bind forall
- } bind def
- } if
- } if
- cleartomark
- /anyColor?
- {
- add add add 0 ne
- } bind def
- /testColor
- {
- gsave
- setcmykcolor currentcmykcolor
- grestore
- } bind def
- /testCMYKColorThrough
- {
- testColor anyColor?
- } bind def
- userdict /composite?
- level2?
- {
- gsave 1 1 1 1 setcmykcolor currentcmykcolor grestore
- add add add 4 eq
- }
- {
- 1 0 0 0 testCMYKColorThrough
- 0 1 0 0 testCMYKColorThrough
- 0 0 1 0 testCMYKColorThrough
- 0 0 0 1 testCMYKColorThrough
- and and and
- } ifelse
- put
- composite? not
- {
- userdict begin
- gsave
- /cyan? 1 0 0 0 testCMYKColorThrough def
- /magenta? 0 1 0 0 testCMYKColorThrough def
- /yellow? 0 0 1 0 testCMYKColorThrough def
- /black? 0 0 0 1 testCMYKColorThrough def
- grestore
- /isCMYKSep? cyan? magenta? yellow? black? or or or def
- /customColor? isCMYKSep? not def
- end
- } if
- end defaultpacking setpacking
-%%EndResource
-%%BeginResource: procset Adobe_typography_AI5 1.0 1
-%%Title: (Typography Operators)
-%%Version: 1.0
-%%CreationDate:(03/26/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_typography_AI5 54 dict dup begin
-put
-/initialize
-{
- begin
- begin
- Adobe_typography_AI5 begin
- Adobe_typography_AI5
- {
- dup xcheck
- {
- bind
- } if
- pop pop
- } forall
- end
- end
- end
- Adobe_typography_AI5 begin
-} def
-/terminate
-{
- currentdict Adobe_typography_AI5 eq
- {
- end
- } if
-} def
-/modifyEncoding
-{
- /_tempEncode exch ddef
- /_pntr 0 ddef
- {
- counttomark -1 roll
- dup type dup /marktype eq
- {
- pop pop exit
- }
- {
- /nametype eq
- {
- _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
- put
- }
- {
- /_pntr exch ddef
- } ifelse
- } ifelse
- } loop
- _tempEncode
-} def
-/TE
-{
- StandardEncoding 256 array copy modifyEncoding
- /_nativeEncoding exch def
-} def
-%
-/TZ
-{
- dup type /arraytype eq
- {
- /_wv exch def
- }
- {
- /_wv 0 def
- } ifelse
- /_useNativeEncoding exch def
- pop pop
- findfont _wv type /arraytype eq
- {
- _wv makeblendedfont
- } if
- dup length 2 add dict
- begin
- mark exch
- {
- 1 index /FID ne
- {
- def
- } if
- cleartomark mark
- } forall
- pop
- /FontName exch def
- counttomark 0 eq
- {
- 1 _useNativeEncoding eq
- {
- /Encoding _nativeEncoding def
- } if
- cleartomark
- }
- {
- /Encoding load 256 array copy
- modifyEncoding /Encoding exch def
- } ifelse
- FontName currentdict
- end
- definefont pop
-} def
-/tr
-{
- _ax _ay 3 2 roll
-} def
-/trj
-{
- _cx _cy _sp _ax _ay 6 5 roll
-} def
-/a0
-{
- /Tx
- {
- dup
- currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- } ddef
- /Tj
- {
- dup
- currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- } ddef
-} def
-/a1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/e0
-{
- /Tx
- {
- tr _psf
- } ddef
- /Tj
- {
- trj _pjsf
- } ddef
-} def
-/e1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- tr _psf
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- trj _pjsf
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/i0
-{
- /Tx
- {
- tr sp
- } ddef
- /Tj
- {
- trj jsp
- } ddef
-} def
-/i1
-{
- W N
-} def
-/o0
-{
- /Tx
- {
- tr sw rmoveto
- } ddef
- /Tj
- {
- trj swj rmoveto
- } ddef
-} def
-/r0
-{
- /Tx
- {
- tr _ctm _pss
- } ddef
- /Tj
- {
- trj _ctm _pjss
- } ddef
-} def
-/r1
-{
- /Tx
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/To
-{
- pop _ctm currentmatrix pop
-} def
-/TO
-{
- iTe _ctm setmatrix newpath
-} def
-/Tp
-{
- pop _tm astore pop _ctm setmatrix
- _tDict begin
- /W
- {
- } def
- /h
- {
- } def
-} def
-/TP
-{
- end
- iTm 0 0 moveto
-} def
-/Tr
-{
- _render 3 le
- {
- currentpoint newpath moveto
- } if
- dup 8 eq
- {
- pop 0
- }
- {
- dup 9 eq
- {
- pop 1
- } if
- } ifelse
- dup /_render exch ddef
- _renderStart exch get load exec
-} def
-/iTm
-{
- _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
-} def
-/Tm
-{
- _tm astore pop iTm 0 0 moveto
-} def
-/Td
-{
- _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
-} def
-/iTe
-{
- _render -1 eq
- {
- }
- {
- _renderEnd _render get dup null ne
- {
- load exec
- }
- {
- pop
- } ifelse
- } ifelse
- /_render -1 ddef
-} def
-/Ta
-{
- pop
-} def
-/Tf
-{
- dup 1000 div /_fScl exch ddef
-%
- selectfont
-} def
-/Tl
-{
- pop
- 0 exch _leading astore pop
-} def
-/Tt
-{
- pop
-} def
-/TW
-{
- 3 npop
-} def
-/Tw
-{
- /_cx exch ddef
-} def
-/TC
-{
- 3 npop
-} def
-/Tc
-{
- /_ax exch ddef
-} def
-/Ts
-{
- /_rise exch ddef
- currentpoint
- iTm
- moveto
-} def
-/Ti
-{
- 3 npop
-} def
-/Tz
-{
- 100 div /_hs exch ddef
- iTm
-} def
-/TA
-{
- pop
-} def
-/Tq
-{
- pop
-} def
-/Th
-{
- pop pop pop pop pop
-} def
-/TX
-{
- pop
-} def
-/Tk
-{
- exch pop _fScl mul neg 0 rmoveto
-} def
-/TK
-{
- 2 npop
-} def
-/T*
-{
- _leading aload pop neg Td
-} def
-/T*-
-{
- _leading aload pop Td
-} def
-/T-
-{
- _ax neg 0 rmoveto
- _hyphen Tx
-} def
-/T+
-{
-} def
-/TR
-{
- _ctm currentmatrix pop
- _tm astore pop
- iTm 0 0 moveto
-} def
-/TS
-{
- currentfont 3 1 roll
- /_Symbol_ _fScl 1000 mul selectfont
-
- 0 eq
- {
- Tx
- }
- {
- Tj
- } ifelse
- setfont
-} def
-/Xb
-{
- pop pop
-} def
-/Tb /Xb load def
-/Xe
-{
- pop pop pop pop
-} def
-/Te /Xe load def
-/XB
-{
-} def
-/TB /XB load def
-currentdict readonly pop
-end
-setpacking
-%%EndResource
-%%BeginProcSet: Adobe_ColorImage_AI6 1.0 0
-userdict /Adobe_ColorImage_AI6 known not
-{
- userdict /Adobe_ColorImage_AI6 17 dict put
-} if
-userdict /Adobe_ColorImage_AI6 get begin
-
- /initialize
- {
- Adobe_ColorImage_AI6 begin
- Adobe_ColorImage_AI6
- {
- dup type /arraytype eq
- {
- dup xcheck
- {
- bind
- } if
- } if
- pop pop
- } forall
- } def
- /terminate { end } def
-
- currentdict /Adobe_ColorImage_AI6_Vars known not
- {
- /Adobe_ColorImage_AI6_Vars 14 dict def
- } if
-
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 0 def
- /sourcecount 0 def
- /sourcearray 4 array def
- /plateindex -1 def
- /XIMask 0 def
- /XIBinary 0 def
- /XIChannelCount 0 def
- /XIBitsPerPixel 0 def
- /XIImageHeight 0 def
- /XIImageWidth 0 def
- /XIImageMatrix null def
- /XIBuffer null def
- /XIDataProc null def
- end
-
- /WalkRGBString null def
- /WalkCMYKString null def
-
- /StuffRGBIntoGrayString null def
- /RGBToGrayImageProc null def
- /StuffCMYKIntoGrayString null def
- /CMYKToGrayImageProc null def
- /ColorImageCompositeEmulator null def
-
- /SeparateCMYKImageProc null def
-
- /FourEqual null def
- /TestPlateIndex null def
-
- currentdict /_colorimage known not
- {
- /colorimage where
- {
- /colorimage get /_colorimage exch def
- }
- {
- /_colorimage null def
- } ifelse
- } if
-
- /_currenttransfer systemdict /currenttransfer get def
-
- /colorimage null def
- /XI null def
-
-
- /WalkRGBString
- {
- 0 3 index
-
- dup length 1 sub 0 3 3 -1 roll
- {
- 3 getinterval { } forall
-
- 5 index exec
-
- 3 index
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /WalkCMYKString
- {
- 0 3 index
-
- dup length 1 sub 0 4 3 -1 roll
- {
- 4 getinterval { } forall
-
- 6 index exec
-
- 3 index
-
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /StuffRGBIntoGrayString
- {
- .11 mul exch
-
- .59 mul add exch
-
- .3 mul add
-
- cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /RGBToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 3 idiv string
- dup 3 1 roll
-
- /StuffRGBIntoGrayString load exch
- WalkRGBString
- end
- } def
-
-
- /StuffCMYKIntoGrayString
- {
- exch .11 mul add
-
- exch .59 mul add
-
- exch .3 mul add
-
- dup 255 gt { pop 255 } if
-
- 255 exch sub cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /CMYKToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 4 idiv string
- dup 3 1 roll
-
- /StuffCMYKIntoGrayString load exch
- WalkCMYKString
- end
- } def
-
-
- /ColorImageCompositeEmulator
- {
- pop true eq
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
- }
- {
- Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 3 -1 roll put
-
- channelcount 3 eq
- {
- /RGBToGrayImageProc
- }
- {
- /CMYKToGrayImageProc
- } ifelse
- load
- end
- } if
- image
- } ifelse
- } def
-
-
- /SeparateCMYKImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
-
- sourcecount 0 ne
- {
- sourcearray plateindex get exec
- }
- {
- sourcearray 0 get exec
-
- dup length 4 idiv string
-
- 0 2 index
-
- plateindex 4 2 index length 1 sub
- {
- get 255 exch sub
-
- 3 copy put pop 1 add
-
- 2 index
- } for
-
- pop pop exch pop
- } ifelse
- end
- } def
-
-
- /FourEqual
- {
- 4 index ne
- {
- pop pop pop false
- }
- {
- 4 index ne
- {
- pop pop false
- }
- {
- 4 index ne
- {
- pop false
- }
- {
- 4 index eq
- } ifelse
- } ifelse
- } ifelse
- } def
-
-
- /TestPlateIndex
- {
- Adobe_ColorImage_AI6_Vars begin
- /plateindex -1 def
-
- /setcmykcolor where
- {
- pop
- gsave
- 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
- grestore
-
- 1 0 0 0 FourEqual
- {
- /plateindex 0 def
- }
- {
- 0 1 0 0 FourEqual
- {
- /plateindex 1 def
- }
- {
- 0 0 1 0 FourEqual
- {
- /plateindex 2 def
- }
- {
- 0 0 0 1 FourEqual
- {
- /plateindex 3 def
- }
- {
- 0 0 0 0 FourEqual
- {
- /plateindex 5 def
- } if
- } ifelse
- } ifelse
- } ifelse
- } ifelse
- pop pop pop pop
- } if
- plateindex
- end
- } def
-
-
- /colorimage
- {
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 1 index def
- /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
-
- 4 sourcecount add index dup
- 8 eq exch 1 eq or not
- end
-
- {
- /_colorimage load null ne
- {
- _colorimage
- }
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get
- 7 add { pop } repeat
- } ifelse
- }
- {
- dup 3 eq
- TestPlateIndex
- dup -1 eq exch 5 eq or or
- {
- /_colorimage load null eq
- {
- ColorImageCompositeEmulator
- }
- {
- dup 1 eq
- {
- pop pop image
- }
- {
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- gsave
-
- 0 _currenttransfer exec
- 1 _currenttransfer exec
- eq
- { 0 _currenttransfer exec 0.5 lt }
- { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
-
- { { pop 0 } } { { pop 1 } } ifelse
- systemdict /settransfer get exec
- } if
-
- _colorimage
-
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- grestore
- } if
- } ifelse
- } ifelse
- }
- {
- dup 1 eq
- {
- pop pop
- image
- }
- {
- pop pop
-
- Adobe_ColorImage_AI6_Vars begin
- sourcecount -1 0
- {
- exch sourcearray 3 1 roll put
- } for
-
- /SeparateCMYKImageProc load
- end
-
- systemdict /image get exec
- } ifelse
- } ifelse
- } ifelse
- } def
-
- /XI
- {
- Adobe_ColorImage_AI6_Vars begin
- gsave
- /XIMask exch 0 ne def
- /XIBinary exch 0 ne def
- pop
- pop
- /XIChannelCount exch def
- /XIBitsPerPixel exch def
- /XIImageHeight exch def
- /XIImageWidth exch def
- pop pop pop pop
- /XIImageMatrix exch def
-
- XIBitsPerPixel 1 eq
- {
- XIImageWidth 8 div ceiling cvi
- }
- {
- XIImageWidth XIChannelCount mul
- } ifelse
- /XIBuffer exch string def
-
- XIBinary
- {
- /XIDataProc { currentfile XIBuffer readstring pop } def
- currentfile 128 string readline pop pop
- }
- {
- /XIDataProc { currentfile XIBuffer readhexstring pop } def
- } ifelse
-
- 0 0 moveto
- XIImageMatrix concat
- XIImageWidth XIImageHeight scale
-
- XIMask
- {
- XIImageWidth XIImageHeight
- false
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- /_lp /null ddef
- _fc
- /_lp /imagemask ddef
-
- imagemask
- }
- {
- XIImageWidth XIImageHeight
- XIBitsPerPixel
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- XIChannelCount 1 eq
- {
-
- gsave
- 0 setgray
-
- image
-
- grestore
- }
- {
- false
- XIChannelCount
- colorimage
- } ifelse
- } ifelse
- grestore
- end
- } def
-
-end
-%%EndProcSet
-%%BeginResource: procset Adobe_Illustrator_AI5 1.1 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Full Prolog)
-%%Version: 1.1
-%%CreationDate: (3/7/1994) ()
-%%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_Illustrator_AI5_vars 81 dict dup begin
-put
-/_eo false def
-/_lp /none def
-/_pf
-{
-} def
-/_ps
-{
-} def
-/_psf
-{
-} def
-/_pss
-{
-} def
-/_pjsf
-{
-} def
-/_pjss
-{
-} def
-/_pola 0 def
-/_doClip 0 def
-/cf currentflat def
-/_tm matrix def
-/_renderStart
-[
-/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0
-] def
-/_renderEnd
-[
-null null null null /i1 /i1 /i1 /i1
-] def
-/_render -1 def
-/_rise 0 def
-/_ax 0 def
-/_ay 0 def
-/_cx 0 def
-/_cy 0 def
-/_leading
-[
-0 0
-] def
-/_ctm matrix def
-/_mtx matrix def
-/_sp 16#020 def
-/_hyphen (-) def
-/_fScl 0 def
-/_cnt 0 def
-/_hs 1 def
-/_nativeEncoding 0 def
-/_useNativeEncoding 0 def
-/_tempEncode 0 def
-/_pntr 0 def
-/_tDict 2 dict def
-/_wv 0 def
-/Tx
-{
-} def
-/Tj
-{
-} def
-/CRender
-{
-} def
-/_AI3_savepage
-{
-} def
-/_gf null def
-/_cf 4 array def
-/_if null def
-/_of false def
-/_fc
-{
-} def
-/_gs null def
-/_cs 4 array def
-/_is null def
-/_os false def
-/_sc
-{
-} def
-/_pd 1 dict def
-/_ed 15 dict def
-/_pm matrix def
-/_fm null def
-/_fd null def
-/_fdd null def
-/_sm null def
-/_sd null def
-/_sdd null def
-/_i null def
-/discardSave null def
-/buffer 256 string def
-/beginString null def
-/endString null def
-/endStringLength null def
-/layerCnt 1 def
-/layerCount 1 def
-/perCent (%) 0 get def
-/perCentSeen? false def
-/newBuff null def
-/newBuffButFirst null def
-/newBuffLast null def
-/clipForward? false def
-end
-userdict /Adobe_Illustrator_AI5 known not {
- userdict /Adobe_Illustrator_AI5 91 dict put
-} if
-userdict /Adobe_Illustrator_AI5 get begin
-/initialize
-{
- Adobe_Illustrator_AI5 dup begin
- Adobe_Illustrator_AI5_vars begin
- discardDict
- {
- bind pop pop
- } forall
- dup /nc get begin
- {
- dup xcheck 1 index type /operatortype ne and
- {
- bind
- } if
- pop pop
- } forall
- end
- newpath
-} def
-/terminate
-{
- end
- end
-} def
-/_
-null def
-/ddef
-{
- Adobe_Illustrator_AI5_vars 3 1 roll put
-} def
-/xput
-{
- dup load dup length exch maxlength eq
- {
- dup dup load dup
- length 2 mul dict copy def
- } if
- load begin
- def
- end
-} def
-/npop
-{
- {
- pop
- } repeat
-} def
-/sw
-{
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
-} def
-/swj
-{
- dup 4 1 roll
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
- 6 2 roll /_cnt 0 ddef
- {
- 1 index eq
- {
- /_cnt _cnt 1 add ddef
- } if
- } forall
- pop
- exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop
-} def
-/ss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put pop
- gsave
- false charpath currentpoint
- 4 index setmatrix
- stroke
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 3 npop
-} def
-/jss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- gsave
- _sp eq
- {
- exch 6 index 6 index 6 index 5 -1 roll widthshow
- currentpoint
- }
- {
- false charpath currentpoint
- 4 index setmatrix stroke
- } ifelse
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 6 npop
-} def
-/sp
-{
- {
- 2 npop (0) exch
- 2 copy 0 exch put pop
- false charpath
- 2 copy rmoveto
- } exch cshow
- 2 npop
-} def
-/jsp
-{
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- _sp eq
- {
- exch 5 index 5 index 5 index 5 -1 roll widthshow
- }
- {
- false charpath
- } ifelse
- 2 copy rmoveto
- } exch cshow
- 5 npop
-} def
-/pl
-{
- transform
- 0.25 sub round 0.25 add exch
- 0.25 sub round 0.25 add exch
- itransform
-} def
-/setstrokeadjust where
-{
- pop true setstrokeadjust
- /c
- {
- curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll curveto
- } def
- /V
- /v load def
- /y
- {
- 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- lineto
- } def
- /L
- /l load def
- /m
- {
- moveto
- } def
-}
-{
- /c
- {
- pl curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll pl curveto
- } def
- /V
- /v load def
- /y
- {
- pl 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- pl lineto
- } def
- /L
- /l load def
- /m
- {
- pl moveto
- } def
-} ifelse
-/d
-{
- setdash
-} def
-/cf
-{
-} def
-/i
-{
- dup 0 eq
- {
- pop cf
- } if
- setflat
-} def
-/j
-{
- setlinejoin
-} def
-/J
-{
- setlinecap
-} def
-/M
-{
- setmiterlimit
-} def
-/w
-{
- setlinewidth
-} def
-/XR
-{
- 0 ne
- /_eo exch ddef
-} def
-/H
-{
-} def
-/h
-{
- closepath
-} def
-/N
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- _eo {eoclip} {clip} ifelse /_doClip 0 ddef
- } if
- newpath
- }
- {
- /CRender
- {
- N
- } ddef
- } ifelse
-} def
-/n
-{
- N
-} def
-/F
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc
- /_doClip 0 ddef
- }
- {
- _pf
- } ifelse
- }
- {
- /CRender
- {
- F
- } ddef
- } ifelse
-} def
-/f
-{
- closepath
- F
-} def
-/S
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- _ps
- } ifelse
- }
- {
- /CRender
- {
- S
- } ddef
- } ifelse
-} def
-/s
-{
- closepath
- S
-} def
-/B
-{
- _pola 0 eq
- {
- _doClip 1 eq
- gsave F grestore
- {
- gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- S
- } ifelse
- }
- {
- /CRender
- {
- B
- } ddef
- } ifelse
-} def
-/b
-{
- closepath
- B
-} def
-/W
-{
- /_doClip 1 ddef
-} def
-/*
-{
- count 0 ne
- {
- dup type /stringtype eq
- {
- pop
- } if
- } if
- newpath
-} def
-/u
-{
-} def
-/U
-{
-} def
-/q
-{
- _pola 0 eq
- {
- gsave
- } if
-} def
-/Q
-{
- _pola 0 eq
- {
- grestore
- } if
-} def
-/*u
-{
- _pola 1 add /_pola exch ddef
-} def
-/*U
-{
- _pola 1 sub /_pola exch ddef
- _pola 0 eq
- {
- CRender
- } if
-} def
-/D
-{
- pop
-} def
-/*w
-{
-} def
-/*W
-{
-} def
-/`
-{
- /_i save ddef
- clipForward?
- {
- nulldevice
- } if
- 6 1 roll 4 npop
- concat pop
- userdict begin
- /showpage
- {
- } def
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {pop false setstrokeadjust} if
- newpath
- 0 setgray
- false setoverprint
-} def
-/~
-{
- end
- _i restore
-} def
-/O
-{
- 0 ne
- /_of exch ddef
- /_lp /none ddef
-} def
-/R
-{
- 0 ne
- /_os exch ddef
- /_lp /none ddef
-} def
-/g
-{
- /_gf exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _gf setgray
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/G
-{
- /_gs exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _gs setgray
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/k
-{
- _cf astore pop
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _cf aload pop setcmykcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/K
-{
- _cs astore pop
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _cs aload pop setcmykcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/x
-{
- /_gf exch ddef
- findcmykcustomcolor
- /_if exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _if _gf 1 exch sub setcustomcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/X
-{
- /_gs exch ddef
- findcmykcustomcolor
- /_is exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _is _gs 1 exch sub setcustomcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/A
-{
- pop
-} def
-/annotatepage
-{
-userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse
-} def
-/XT {
- pop pop
-} def
-/discard
-{
- save /discardSave exch store
- discardDict begin
- /endString exch store
- gt38?
- {
- 2 add
- } if
- load
- stopped
- pop
- end
- discardSave restore
-} bind def
-userdict /discardDict 7 dict dup begin
-put
-/pre38Initialize
-{
- /endStringLength endString length store
- /newBuff buffer 0 endStringLength getinterval store
- /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store
- /newBuffLast newBuff endStringLength 1 sub 1 getinterval store
-} def
-/shiftBuffer
-{
- newBuff 0 newBuffButFirst putinterval
- newBuffLast 0
- currentfile read not
- {
- stop
- } if
- put
-} def
-0
-{
- pre38Initialize
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff endString eq
- {
- cleartomark stop
- } if
- shiftBuffer
- } loop
- }
- {
- stop
- } ifelse
-} def
-1
-{
- pre38Initialize
- /beginString exch store
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff beginString eq
- {
- /layerCount dup load 1 add store
- }
- {
- newBuff endString eq
- {
- /layerCount dup load 1 sub store
- layerCount 0 eq
- {
- cleartomark stop
- } if
- } if
- } ifelse
- shiftBuffer
- } loop
- } if
-} def
-2
-{
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- endString eq
- {
- cleartomark stop
- } if
- } loop
-} def
-3
-{
- /beginString exch store
- /layerCnt 1 store
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- dup beginString eq
- {
- pop /layerCnt dup load 1 add store
- }
- {
- endString eq
- {
- layerCnt 1 eq
- {
- cleartomark stop
- }
- {
- /layerCnt dup load 1 sub store
- } ifelse
- } if
- } ifelse
- } loop
-} def
-end
-userdict /clipRenderOff 15 dict dup begin
-put
-{
- /n /N /s /S /f /F /b /B
-}
-{
- {
- _doClip 1 eq
- {
- /_doClip 0 ddef _eo {eoclip} {clip} ifelse
- } if
- newpath
- } def
-} forall
-/Tr /pop load def
-/Bb {} def
-/BB /pop load def
-/Bg {12 npop} def
-/Bm {6 npop} def
-/Bc /Bm load def
-/Bh {4 npop} def
-end
-/Lb
-{
- 4 npop
- 6 1 roll
- pop
- 4 1 roll
- pop pop pop
- 0 eq
- {
- 0 eq
- {
- (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard
- }
- {
-
- /clipForward? true def
-
- /Tx /pop load def
- /Tj /pop load def
-
- currentdict end clipRenderOff begin begin
- } ifelse
- }
- {
- 0 eq
- {
- save /discardSave exch store
- } if
- } ifelse
-} bind def
-/LB
-{
- discardSave dup null ne
- {
- restore
- }
- {
- pop
- clipForward?
- {
- currentdict
- end
- end
- begin
-
- /clipForward? false ddef
- } if
- } ifelse
-} bind def
-/Pb
-{
- pop pop
- 0 (%AI5_EndPalette) discard
-} bind def
-/Np
-{
- 0 (%AI5_End_NonPrinting--) discard
-} bind def
-/Ln /pop load def
-/Ap
-/pop load def
-/Ar
-{
- 72 exch div
- 0 dtransform dup mul exch dup mul add sqrt
- dup 1 lt
- {
- pop 1
- } if
- setflat
-} def
-/Mb
-{
- q
-} def
-/Md
-{
-} def
-/MB
-{
- Q
-} def
-/nc 3 dict def
-nc begin
-/setgray
-{
- pop
-} bind def
-/setcmykcolor
-{
- 4 npop
-} bind def
-/setcustomcolor
-{
- 2 npop
-} bind def
-currentdict readonly pop
-end
-end
-setpacking
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%IncludeFont: Univers
-Adobe_level2_AI5 /initialize get exec
-Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec
-Adobe_ColorImage_AI6 /initialize get exec
-Adobe_Illustrator_AI5 /initialize get exec
-[
-39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
-/Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
-/egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
-/oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
-/udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
-/registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
-/.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
-/.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
-/questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
-/guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
-/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
-/.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
-/fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
-/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
-/Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
-/Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
-/hungarumlaut/ogonek/caron
-TE
-%AI3_BeginEncoding: _Univers Univers
-[/_Univers/Univers 0 0 1 TZ
-%AI3_EndEncoding AdobeType
-%AI5_Begin_NonPrinting
-Np
-8 Bn
-%AI5_BeginGradient: (Black & White)
-(Black & White) 0 2 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Green & Blue)
-(Green & Blue) 0 2 Bd
-[
-<
-99999A9A9B9B9B9C9C9D9D9D9E9E9F9F9FA0A0A1A1A1A2A2A3A3A3A4A4A5A5A5A6A6A7A7A7A8A8A9
-A9A9AAAAABABABACACADADADAEAEAFAFAFB0B0B1B1B1B2B2B3B3B3B4B4B5B5B5B6B6B7B7B7B8B8B9
-B9B9BABABBBBBBBCBCBDBDBDBEBEBFBFBFC0C0C1C1C1C2C2C3C3C3C4C4C5C5C5C6C6C7C7C7C8C8C9
-C9C9CACACBCBCBCCCCCDCDCDCECECFCFCFD0D0D1D1D1D2D2D3D3D3D4D4D5D5D5D6D6D7D7D7D8D8D9
-D9D9DADADBDBDBDCDCDDDDDDDEDEDFDFDFE0E0E1E1E1E2E2E3E3E3E4E4E5E5E5E6E6E7E7E7E8E8E9
-E9E9EAEAEBEBEBECECEDEDEDEEEEEFEFEFF0F0F1F1F1F2F2F3F3F3F4F4F5F5F5F6F6F7F7F7F8F8F9
-F9F9FAFAFBFBFBFCFCFDFDFDFEFEFFFF
->
-<
-000102020304050506070808090A0B0B0C0D0E0E0F101111121314141516171718191A1A1B1C1D1D
-1E1F20202122232324252626272829292A2B2C2C2D2E2F2F303132323334353536373838393A3B3B
-3C3D3E3E3F404141424344444546474748494A4A4B4C4D4D4E4F5050515253535455565657585959
-5A5B5C5C5D5E5F5F606162626364656566676868696A6B6B6C6D6E6E6F7071717273747475767777
-78797A7A7B7C7D7D7E7F80808182828384858586878888898A8B8B8C8D8E8E8F9091919293949495
-96979798999A9A9B9C9D9D9E9FA0A0A1A2A3A3A4A5A6A6A7A8A9A9AAABACACADAEAFAFB0B1B2B2B3
-B4B5B5B6B7B8B8B9BABBBBBCBDBEBEBF
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-[
-1 0.75 0 0 1 50 100 %_Bs
-0.6 0 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Pink, Yellow, Green)
-(Pink, Yellow, Green) 0 3 Bd
-[
-<
-00000000000000000000000000000000000000010101010101010101010101010101010101010101
-01010101010202020202020202020202020202020202020202020203030303030303030303030303
-03030303030303030404040404040404040404040404040404040404050505050505050505050505
-05050505050505060606060606060606060606060606060606060707070707070707070707070707
-07070707080808080808080808080808080808080809090909090909090909090909090909090A0A
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0C
-0C0C0C0C0C0C0C0D0D0D0D0D
->
-<
-050506060606070708080809090A0A0A0B0B0C0C0D0D0E0E0F0F1010111112121313141415151617
-17181819191A1A1B1C1C1D1D1E1F1F202021222223232425252626272828292A2A2B2C2C2D2D2E2F
-2F3031313233333435353637373839393A3B3B3C3D3E3E3F4040414242434445454647474849494A
-4B4C4C4D4E4F4F505151525354545556575758595A5A5B5C5C5D5E5F5F6061626363646566666768
-69696A6B6C6C6D6E6F707071727373747576777778797A7B7B7C7D7E7F7F80818283838485868787
-88898A8B8B8C8D8E8F8F9091929394949596979898999A9B9C9D9D9E9FA0A1A2A2A3A4A5A6A7A7A8
-A9AAABACADADAEAFB0B1B2B2
->
-<
-CCCCCBCBCBCACACAC9C9C8C8C7C7C6C6C5C5C4C4C3C2C2C1C1C0C0BFBEBEBDBDBCBBBBBAB9B9B8B7
-B7B6B6B5B4B4B3B2B1B1B0AFAFAEADADACABAAAAA9A8A8A7A6A5A5A4A3A2A2A1A0A09F9E9D9C9C9B
-9A999998979696959493929291908F8E8E8D8C8B8A8A8988878686858483828181807F7E7D7C7C7B
-7A7978777776757473727171706F6E6D6C6B6A6A69686766656463636261605F5E5D5C5B5B5A5958
-5756555453525151504F4E4D4C4B4A49484746464544434241403F3E3D3C3B3A3938383736353433
-3231302F2E2D2C2B2A29282726252423222221201F1E1D1C1B1A191817161514131211100F0E0D0C
-0B0A09080706050403020100
->
-0
-1 %_Br
-<
-737271706F6E6D6C6B6A696867666564636261605F5E5D5C5B5B5A59585756555453525150504F4E
-4D4C4B4A4949484746454443434241403F3E3E3D3C3B3A3A393837363635343333323130302F2E2D
-2D2C2B2A2A29282827262525242323222121201F1F1E1D1D1C1C1B1A1A1918181717161615141413
-1312121111100F0F0E0E0D0D0C0C0C0B0B0A0A090908080807070606060505050404040303030202
-020201010101010000000000
->
-<
-00000000000000000000000001010101010101010101010101010101010101010101010102020202
-02020202020202020202020202020202020202020202030303030303030303030303030303030303
-03030303030303030303030303040404040404040404040404040404040404040404040404040404
-04040404040404040404050505050505050505050505050505050505050505050505050505050505
-050505050505050505050505
->
-<
-BFBFBFC0C0C0C0C0C0C0C0C0C1C1C1C1C1C1C1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C3C3
-C3C4C4C4C4C4C4C4C4C4C4C5C5C5C5C5C5C5C5C5C5C5C6C6C6C6C6C6C6C6C6C6C6C6C7C7C7C7C7C7
-C7C7C7C7C7C7C8C8C8C8C8C8C8C8C8C8C8C8C8C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9CACACACACACA
-CACACACACACACACACACACBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCCCCCCCCCCCCCCCC
-CCCCCCCCCCCCCCCCCCCCCCCC
->
-0
-1 %_Br
-[
-0.05 0.7 0 0 1 50 100 %_Bs
-0 0.02 0.8 0 1 57 36 %_Bs
-0.45 0 0.75 0 1 37 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Purple, Red & Yellow)
-(Purple, Red & Yellow) 0 3 Bd
-[
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A
->
-<
-CCCCCCCDCDCDCDCDCECECECECECFCFCFCFD0D0D0D0D0D1D1D1D1D1D2D2D2D2D2D3D3D3D3D3D4D4D4
-D4D5D5D5D5D5D6D6D6D6D6D7D7D7D7D7D8D8D8D8D8D9D9D9D9DADADADADADBDBDBDBDBDCDCDCDCDC
-DDDDDDDDDDDEDEDEDEDFDFDFDFDFE0E0E0E0E0E1E1E1E1E1E2E2E2E2E2E3E3E3E3E4E4E4E4E4E5E5
-E5E5E5E6E6E6E6E6E7E7E7E7E7E8E8E8E8E9E9E9E9E9EAEAEAEAEAEBEBEBEBEBECECECECECEDEDED
-EDEEEEEEEEEEEFEFEFEFEFF0F0F0F0F0F1F1F1F1F1F2F2F2F2F3F3F3F3F3F4F4F4F4F4F5F5F5F5F5
-F6F6F6F6F6F7F7F7F7F8F8F8F8F8F9F9F9F9F9FAFAFAFAFAFBFBFBFBFBFCFCFCFCFDFDFDFDFDFEFE
-FEFEFEFFFFFF
->
-0
-1 %_Br
-<
-E5E4E3E2E1E0DFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBE
-BDBCBBBAB9B8B7B6B5B4B3B2B1B0AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A99989796
-9594939291908F8E8D8C8B8A898887868584838281807F7E7D7C7B7A797877767574737271706F6E
-6D6C6B6A696867666564636261605F5E5D5C5B5A595857565554535251504F4E4D4C4B4A49484746
-4544434241403F3E3D3C3B3A393837363534333231302F2E2D2C2B2A292827262524232221201F1E
-1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
->
-<
-E5E6E6E6E6E6E6E6E6E7E7E7E7E7E7E7E7E7E8E8E8E8E8E8E8E8E8E9E9E9E9E9E9E9E9E9EAEAEAEA
-EAEAEAEAEAEBEBEBEBEBEBEBEBEBECECECECECECECECECEDEDEDEDEDEDEDEDEDEEEEEEEEEEEEEEEE
-EEEFEFEFEFEFEFEFEFEFF0F0F0F0F0F0F0F0F0F1F1F1F1F1F1F1F1F1F2F2F2F2F2F2F2F2F2F3F3F3
-F3F3F3F3F3F3F4F4F4F4F4F4F4F4F4F5F5F5F5F5F5F5F5F5F6F6F6F6F6F6F6F6F6F7F7F7F7F7F7F7
-F7F7F8F8F8F8F8F8F8F8F8F9F9F9F9F9F9F9F9F9FAFAFAFAFAFAFAFAFAFBFBFBFBFBFBFBFBFBFCFC
-FCFCFCFCFCFCFCFDFDFDFDFDFDFDFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFF
->
-<
-00010203040405060708090A0B0C0C0D0E0F10111213141415161718191A1B1C1D1D1E1F20212223
-242525262728292A2B2C2D2D2E2F30313233343535363738393A3B3C3D3D3E3F4041424344454546
-4748494A4B4C4D4E4E4F50515253545556565758595A5B5C5D5E5E5F60616263646566666768696A
-6B6C6D6E6E6F70717273747576767778797A7B7C7D7E7F7F80818283848586878788898A8B8C8D8E
-8F8F90919293949596979798999A9B9C9D9E9F9FA0A1A2A3A4A5A6A7A7A8A9AAABACADAEAFAFB0B1
-B2B3B4B5B6B7B8B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C8C9CACBCC
->
-0
-1 %_Br
-[
-0 0.04 1 0 1 50 100 %_Bs
-0 1 0.8 0 1 50 50 %_Bs
-0.9 0.9 0 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Rainbow)
-(Rainbow) 0 6 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-0
-1 %_Br
-1
-<
-0708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E
-2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556
-5758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E
-7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6
-A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCE
-CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6
-F7F8F9FAFBFCFDFEFF
->
-0
-0
-1 %_Br
-1
-<
-00000000000000000000000000000000000001010101010101010101010101010101010101010101
-01010101010101010101010101010202020202020202020202020202020202020202020202020202
-02020202020202020202030303030303030303030303030303030303030303030303030303030303
-03030303030304040404040404040404040404040404040404040404040404040404040404040404
-04040505050505050505050505050505050505050505050505050505050505050505050505050606
-06060606060606060606060606060606060606060606060606060606060606060606070707070707
-07070707070707070707070707070707
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0
-1
-0
-1 %_Br
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-1 %_Br
-[
-0 1 0 0 1 50 100 %_Bs
-1 1 0 0 1 50 80 %_Bs
-1 0.0279 0 0 1 50 60 %_Bs
-1 0 1 0 1 50 40 %_Bs
-0 0 1 0 1 50 20 %_Bs
-0 1 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Steel Bar)
-(Steel Bar) 0 3 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 70 %_Bs
-0 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Orange Radial)
-(Yellow & Orange Radial) 1 2 Bd
-[
-0
-<
-0001010203040506060708090A0B0C0C0D0E0F10111213131415161718191A1B1C1D1D1E1F202122
-232425262728292A2B2B2C2D2E2F303132333435363738393A3B3C3D3E3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60606162636465666768696A6B6C6D6E6F
-707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C
->
-<
-FFFFFFFFFEFEFEFEFEFEFEFDFDFDFDFDFDFCFCFCFCFCFCFBFBFBFBFBFBFAFAFAFAFAFAF9F9F9F9F9
-F9F8F8F8F8F8F8F7F7F7F7F7F7F6F6F6F6F6F6F5F5F5F5F5F5F4F4F4F4F4F3F3F3F3F3F3F2F2F2F2
-F2F2F1F1F1F1F1F0F0F0F0F0F0EFEFEFEFEFEFEEEEEEEEEEEDEDEDEDEDEDECECECECECEBEBEBEBEB
-EBEAEAEAEAEAE9E9E9E9E9E9E8E8E8E8E8E8E7E7E7E7E7E6E6E6E6E6E5
->
-0
-1 %_Br
-[
-0 0 1 0 1 52 19 %_Bs
-0 0.55 0.9 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Purple Radial)
-(Yellow & Purple Radial) 1 2 Bd
-[
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-<
-1415161718191A1B1C1D1E1F1F202122232425262728292A2A2B2C2D2E2F30313233343536363738
-393A3B3C3D3E3F40414142434445464748494A4B4C4D4D4E4F50515253545556575858595A5B5C5D
-5E5F60616263646465666768696A6B6C6D6E6F6F707172737475767778797A7B7B7C7D7E7F808182
-83848586868788898A8B8C8D8E8F90919292939495969798999A9B9C9D9D9E9FA0A1A2A3A4A5A6A7
-A8A9A9AAABACADAEAFB0B1B2B3B4B4B5B6B7B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C9CACBCB
-CCCDCECFD0D1D2D3D4D5D6D7D7D8D9DADBDCDDDEDFE0E1E2E2E3E4E5E6E7E8E9EAEBECEDEEEEEFF0
-F1F2F3F4F5F6F7F8F9F9FAFBFCFDFEFF
->
-<
-ABAAAAA9A8A7A7A6A5A5A4A3A3A2A1A1A09F9F9E9D9D9C9B9B9A9999989797969595949393929191
-908F8F8E8D8D8C8B8B8A8989888787868585848383828181807F7F7E7D7D7C7B7B7A797978777776
-7575747373727171706F6F6E6D6D6C6B6B6A6969686767666565646362626160605F5E5E5D5C5C5B
-5A5A5958585756565554545352525150504F4E4E4D4C4C4B4A4A4948484746464544444342424140
-403F3E3E3D3C3C3B3A3A3938383736363534343332323130302F2E2E2D2C2C2B2A2A292828272626
-25242423222121201F1F1E1D1D1C1B1B1A1919181717161515141313121111100F0F0E0D0D0C0B0B
-0A090908070706050504030302010100
->
-0
-1 %_Br
-[
-0 0.08 0.67 0 1 50 14 %_Bs
-1 1 0 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_End_NonPrinting--
-%AI5_BeginPalette
-0 2 Pb
-Pn
-Pc
-1 g
-Pc
-0 g
-Pc
-0 0 0 0 k
-Pc
-0.75 g
-Pc
-0.5 g
-Pc
-0.25 g
-Pc
-0 g
-Pc
-Bb
-2 (Black & White) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0 0 0 k
-Pc
-0.5 0 0 0 k
-Pc
-0.75 0 0 0 k
-Pc
-1 0 0 0 k
-Pc
-0.25 0.25 0 0 k
-Pc
-0.5 0.5 0 0 k
-Pc
-0.75 0.75 0 0 k
-Pc
-1 1 0 0 k
-Pc
-Bb
-2 (Pink, Yellow, Green) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0 0 k
-Pc
-0 0.5 0 0 k
-Pc
-0 0.75 0 0 k
-Pc
-0 1 0 0 k
-Pc
-0 0.25 0.25 0 k
-Pc
-0 0.5 0.5 0 k
-Pc
-0 0.75 0.75 0 k
-Pc
-0 1 1 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Purple Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0 0.25 0 k
-Pc
-0 0 0.5 0 k
-Pc
-0 0 0.75 0 k
-Pc
-0 0 1 0 k
-Pc
-0.25 0 0.25 0 k
-Pc
-0.5 0 0.5 0 k
-Pc
-0.75 0 0.75 0 k
-Pc
-1 0 1 0 k
-Pc
-Bb
-2 (Rainbow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0 0 k
-Pc
-0.5 0.25 0 0 k
-Pc
-0.75 0.375 0 0 k
-Pc
-1 0.5 0 0 k
-Pc
-0.125 0.25 0 0 k
-Pc
-0.25 0.5 0 0 k
-Pc
-0.375 0.75 0 0 k
-Pc
-0.5 1 0 0 k
-Pc
-Bb
-2 (Steel Bar) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0.125 0 k
-Pc
-0 0.5 0.25 0 k
-Pc
-0 0.75 0.375 0 k
-Pc
-0 1 0.5 0 k
-Pc
-0 0.125 0.25 0 k
-Pc
-0 0.25 0.5 0 k
-Pc
-0 0.375 0.75 0 k
-Pc
-0 0.5 1 0 k
-Pc
-Bb
-2 (Purple, Red & Yellow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0 0.25 0 k
-Pc
-0.25 0 0.5 0 k
-Pc
-0.375 0 0.75 0 k
-Pc
-0.5 0 1 0 k
-Pc
-0.25 0 0.125 0 k
-Pc
-0.5 0 0.25 0 k
-Pc
-0.75 0 0.375 0 k
-Pc
-1 0 0.5 0 k
-Pc
-Bb
-2 (Green & Blue) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0.125 0 k
-Pc
-0.5 0.25 0.25 0 k
-Pc
-0.75 0.375 0.375 0 k
-Pc
-1 0.5 0.5 0 k
-Pc
-0.25 0.25 0.125 0 k
-Pc
-0.5 0.5 0.25 0 k
-Pc
-0.75 0.75 0.375 0 k
-Pc
-1 1 0.5 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Orange Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0.25 0.125 0 k
-Pc
-0.25 0.5 0.25 0 k
-Pc
-0.375 0.75 0.375 0 k
-Pc
-0.5 1 0.5 0 k
-Pc
-0.125 0.25 0.25 0 k
-Pc
-0.25 0.5 0.5 0 k
-Pc
-0.375 0.75 0.75 0 k
-Pc
-0.5 1 1 0 k
-Pc
-0 0 0 0 k
-Pc
-0.125 0.125 0.25 0 k
-Pc
-0.25 0.25 0.5 0 k
-Pc
-0.375 0.375 0.75 0 k
-Pc
-0.5 0.5 1 0 k
-Pc
-0.25 0.125 0.25 0 k
-Pc
-0.5 0.25 0.5 0 k
-Pc
-0.75 0.375 0.75 0 k
-Pc
-1 0.5 1 0 k
-Pc
-PB
-%AI5_EndPalette
-%%EndSetup
-%AI5_BeginLayer
-1 1 1 1 0 0 0 79 128 255 Lb
-(Layer 1) Ln
-0 A
-800 Ar
-0 J 0 j 1 w 4 M []0 d
-%AI3_Note:
-0 D
-0 XR
--4014 283.5 m
-4626 283.5 L
-(N) *
-453.5 4716 m
-453.5 -3924 L
-(N) *
-85 4716 m
-85 -3924 L
-(N) *
--4014 765.5 m
-4626 765.5 L
-(N) *
-0 R
-0 G
-113 683.5 m
-439 683.5 l
-S
-113 663.5 m
-439 663.5 l
-S
-113 643.5 m
-439 643.5 l
-S
-113 686 m
-439 686 l
-S
-1 Ap
-439 624 m
-439 709 L
-113 709 L
-113 624 L
-439 624 L
-s
-0 Ap
-178.5 709 m
-178.5 624 l
-S
-243 709 m
-243 624 l
-S
-374 709 m
-374 624 l
-S
-308.5 709 m
-308.5 624 l
-S
-0 To
-1 0 0 1 146 692 0 Tp
-TP
--12.2278 0 Td
-0 Tr
-0 O
-0 g
-/_Univers 10 Tf
-0 Ts
-100 Tz
-0 Tt
-1 TA
-%_ 0 XL
-36 0 Xb
-XB
-0 0 5 TC
-100 100 200 TW
-0 0 0 Ti
-1 Ta
-0 0 2 2 3 Th
-0 Tq
-0 0 Tl
-0 Tc
-0 Tw
-(key 1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 213 692 0 Tp
-TP
--12.2278 0 Td
-0 Tr
-(key 2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 276 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 3) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 225.5 747.5 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 336.5 693.5 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 341 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 4) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 407.5 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 5) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 185.5 736 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 145 669.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 144.5 650.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 145 630 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 669 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 649.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 629.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 669 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(a) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 649.5 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(d) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 629.5 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(g) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 669 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(b) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 649.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(e) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 629.5 0 Tp
-TP
--8.8879 0 Td
-0 Tr
-(N/A) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 669 0 Tp
-TP
--2.5 0 Td
-0 Tr
-(c) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 649.5 0 Tp
-TP
--1.6638 0 Td
-0 Tr
-(f) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 629.5 0 Tp
-TP
--1.3892 0 Td
-0 Tr
-(i) Tx
-(\r) TX
-TO
-u
-1 Ap
-0 R
-0 G
-274.4998 662.9963 m
-279.1963 662.9963 283.0037 666.8037 283.0037 671.5002 c
-283.0037 676.1968 279.1963 680.0042 274.4998 680.0042 c
-269.8032 680.0042 265.9958 676.1968 265.9958 671.5002 c
-265.9958 666.8037 269.8032 662.9963 274.4998 662.9963 c
-s
-[3 4 3 4 3 4 ]0 d
-274.4998 643.4963 m
-279.1963 643.4963 283.0037 647.3037 283.0037 652.0002 c
-283.0037 656.6968 279.1963 660.5042 274.4998 660.5042 c
-269.8032 660.5042 265.9958 656.6968 265.9958 652.0002 c
-265.9958 647.3037 269.8032 643.4963 274.4998 643.4963 c
-s
-u
-u
-0 Ap
-[]0 d
-265.9958 671.5002 m
-251 671.5 250.5 662 v
-250.1312 654.9919 257.5 653 y
-S
-0 O
-0 g
-260.0476 653.373 m
-258.5818 654.2863 257.6645 655.0108 256.5229 655.8709 c
-255.2066 651.0014 l
-255.7237 651.0949 257.7835 651.333 259.5097 651.3831 c
-261.3573 651.4376 263.0016 651.3718 264.0403 651.2262 c
-263.0697 651.6237 261.6162 652.3953 260.0476 653.373 c
-f
-U
-U
-U
-u
-1 Ap
-0 R
-0 G
-404.9998 662.9963 m
-409.6963 662.9963 413.5037 666.8037 413.5037 671.5002 c
-413.5037 676.1968 409.6963 680.0042 404.9998 680.0042 c
-400.3032 680.0042 396.4958 676.1968 396.4958 671.5002 c
-396.4958 666.8037 400.3032 662.9963 404.9998 662.9963 c
-s
-[3 4 3 4 3 4 ]0 d
-404.9998 643.4963 m
-409.6963 643.4963 413.5037 647.3037 413.5037 652.0002 c
-413.5037 656.6968 409.6963 660.5042 404.9998 660.5042 c
-400.3032 660.5042 396.4958 656.6968 396.4958 652.0002 c
-396.4958 647.3037 400.3032 643.4963 404.9998 643.4963 c
-s
-u
-u
-0 Ap
-[]0 d
-396.4958 671.5002 m
-381.5 671.5 381 662 v
-380.6312 654.9919 388 653 y
-S
-0 O
-0 g
-390.5476 653.373 m
-389.0818 654.2863 388.1645 655.0108 387.0229 655.8709 c
-385.7066 651.0014 l
-386.2237 651.0949 388.2835 651.333 390.0097 651.3831 c
-391.8573 651.4376 393.5016 651.3718 394.5403 651.2262 c
-393.5697 651.6237 392.1162 652.3953 390.5476 653.373 c
-f
-U
-U
-U
-LB
-%AI5_EndLayer--
-%%PageTrailer
-gsave annotatepage grestore showpage
-%%Trailer
-Adobe_Illustrator_AI5 /terminate get exec
-Adobe_ColorImage_AI6 /terminate get exec
-Adobe_typography_AI5 /terminate get exec
-Adobe_level2_AI5 /terminate get exec
-%%EOF
diff --git a/lib/snmp/doc/src/getnext3.ps b/lib/snmp/doc/src/getnext3.ps
deleted file mode 100644
index 1d1be88a12..0000000000
--- a/lib/snmp/doc/src/getnext3.ps
+++ /dev/null
@@ -1,3003 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: Adobe Illustrator(r) 6.0
-%%For: (Anna Fedoriw) (Ericsson Telecom)
-%%Title: (GetNext321.eps)
-%%CreationDate: (97-05-23) (14.04)
-%%BoundingBox: 112 579 440 757
-%%HiResBoundingBox: 112.5 579.5 439.5 756.8677
-%%DocumentProcessColors: Black
-%%DocumentFonts: Univers
-%%DocumentSuppliedResources: procset Adobe_level2_AI5 1.0 0
-%%+ procset Adobe_typography_AI5 1.0 0
-%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6
-%%+ procset Adobe_Illustrator_AI5 1.0 0
-%AI5_FileFormat 2.0
-%AI3_ColorUsage: Black&White
-%%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set)
-%%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1
-%%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 ()
-%AI3_TemplateBox: 306 396 306 396
-%AI3_TileBox: 21 -12 588 802
-%AI3_DocumentPreview: Macintosh_ColorPic
-%AI5_ArtSize: 595.2756 841.8898
-%AI5_RulerUnits: 1
-%AI5_ArtFlags: 0 0 0 1 0 0 1 1 0
-%AI5_TargetResolution: 800
-%AI5_NumLayers: 1
-%AI5_OpenToView: 54 804 2 1146 827 58 1 1 3 40
-%AI5_OpenViewLayers: 7
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset Adobe_level2_AI5 1.2 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation)
-%%Version: 1.2
-%%CreationDate: (04/10/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-userdict /Adobe_level2_AI5 23 dict dup begin
- put
- /packedarray where not
- {
- userdict begin
- /packedarray
- {
- array astore readonly
- } bind def
- /setpacking /pop load def
- /currentpacking false def
- end
- 0
- } if
- pop
- userdict /defaultpacking currentpacking put true setpacking
- /initialize
- {
- Adobe_level2_AI5 begin
- } bind def
- /terminate
- {
- currentdict Adobe_level2_AI5 eq
- {
- end
- } if
- } bind def
- mark
- /setcustomcolor where not
- {
- /findcmykcustomcolor
- {
- 5 packedarray
- } bind def
- /setcustomcolor
- {
- exch aload pop pop
- 4
- {
- 4 index mul 4 1 roll
- } repeat
- 5 -1 roll pop
- setcmykcolor
- }
- def
- } if
-
- /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def
- userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put
- userdict /level2?
- systemdict /languagelevel known dup
- {
- pop systemdict /languagelevel get 2 ge
- } if
- put
-/level2ScreenFreq
-{
- begin
- 60
- HalftoneType 1 eq
- {
- pop Frequency
- } if
- HalftoneType 2 eq
- {
- pop GrayFrequency
- } if
- HalftoneType 5 eq
- {
- pop Default level2ScreenFreq
- } if
- end
-} bind def
-userdict /currentScreenFreq
- level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put
-level2? not
- {
- /setcmykcolor where not
- {
- /setcmykcolor
- {
- exch .11 mul add exch .59 mul add exch .3 mul add
- 1 exch sub setgray
- } def
- } if
- /currentcmykcolor where not
- {
- /currentcmykcolor
- {
- 0 0 0 1 currentgray sub
- } def
- } if
- /setoverprint where not
- {
- /setoverprint /pop load def
- } if
- /selectfont where not
- {
- /selectfont
- {
- exch findfont exch
- dup type /arraytype eq
- {
- makefont
- }
- {
- scalefont
- } ifelse
- setfont
- } bind def
- } if
- /cshow where not
- {
- /cshow
- {
- [
- 0 0 5 -1 roll aload pop
- ] cvx bind forall
- } bind def
- } if
- } if
- cleartomark
- /anyColor?
- {
- add add add 0 ne
- } bind def
- /testColor
- {
- gsave
- setcmykcolor currentcmykcolor
- grestore
- } bind def
- /testCMYKColorThrough
- {
- testColor anyColor?
- } bind def
- userdict /composite?
- level2?
- {
- gsave 1 1 1 1 setcmykcolor currentcmykcolor grestore
- add add add 4 eq
- }
- {
- 1 0 0 0 testCMYKColorThrough
- 0 1 0 0 testCMYKColorThrough
- 0 0 1 0 testCMYKColorThrough
- 0 0 0 1 testCMYKColorThrough
- and and and
- } ifelse
- put
- composite? not
- {
- userdict begin
- gsave
- /cyan? 1 0 0 0 testCMYKColorThrough def
- /magenta? 0 1 0 0 testCMYKColorThrough def
- /yellow? 0 0 1 0 testCMYKColorThrough def
- /black? 0 0 0 1 testCMYKColorThrough def
- grestore
- /isCMYKSep? cyan? magenta? yellow? black? or or or def
- /customColor? isCMYKSep? not def
- end
- } if
- end defaultpacking setpacking
-%%EndResource
-%%BeginResource: procset Adobe_typography_AI5 1.0 1
-%%Title: (Typography Operators)
-%%Version: 1.0
-%%CreationDate:(03/26/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_typography_AI5 54 dict dup begin
-put
-/initialize
-{
- begin
- begin
- Adobe_typography_AI5 begin
- Adobe_typography_AI5
- {
- dup xcheck
- {
- bind
- } if
- pop pop
- } forall
- end
- end
- end
- Adobe_typography_AI5 begin
-} def
-/terminate
-{
- currentdict Adobe_typography_AI5 eq
- {
- end
- } if
-} def
-/modifyEncoding
-{
- /_tempEncode exch ddef
- /_pntr 0 ddef
- {
- counttomark -1 roll
- dup type dup /marktype eq
- {
- pop pop exit
- }
- {
- /nametype eq
- {
- _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
- put
- }
- {
- /_pntr exch ddef
- } ifelse
- } ifelse
- } loop
- _tempEncode
-} def
-/TE
-{
- StandardEncoding 256 array copy modifyEncoding
- /_nativeEncoding exch def
-} def
-%
-/TZ
-{
- dup type /arraytype eq
- {
- /_wv exch def
- }
- {
- /_wv 0 def
- } ifelse
- /_useNativeEncoding exch def
- pop pop
- findfont _wv type /arraytype eq
- {
- _wv makeblendedfont
- } if
- dup length 2 add dict
- begin
- mark exch
- {
- 1 index /FID ne
- {
- def
- } if
- cleartomark mark
- } forall
- pop
- /FontName exch def
- counttomark 0 eq
- {
- 1 _useNativeEncoding eq
- {
- /Encoding _nativeEncoding def
- } if
- cleartomark
- }
- {
- /Encoding load 256 array copy
- modifyEncoding /Encoding exch def
- } ifelse
- FontName currentdict
- end
- definefont pop
-} def
-/tr
-{
- _ax _ay 3 2 roll
-} def
-/trj
-{
- _cx _cy _sp _ax _ay 6 5 roll
-} def
-/a0
-{
- /Tx
- {
- dup
- currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- } ddef
- /Tj
- {
- dup
- currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- } ddef
-} def
-/a1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/e0
-{
- /Tx
- {
- tr _psf
- } ddef
- /Tj
- {
- trj _pjsf
- } ddef
-} def
-/e1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- tr _psf
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- trj _pjsf
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/i0
-{
- /Tx
- {
- tr sp
- } ddef
- /Tj
- {
- trj jsp
- } ddef
-} def
-/i1
-{
- W N
-} def
-/o0
-{
- /Tx
- {
- tr sw rmoveto
- } ddef
- /Tj
- {
- trj swj rmoveto
- } ddef
-} def
-/r0
-{
- /Tx
- {
- tr _ctm _pss
- } ddef
- /Tj
- {
- trj _ctm _pjss
- } ddef
-} def
-/r1
-{
- /Tx
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/To
-{
- pop _ctm currentmatrix pop
-} def
-/TO
-{
- iTe _ctm setmatrix newpath
-} def
-/Tp
-{
- pop _tm astore pop _ctm setmatrix
- _tDict begin
- /W
- {
- } def
- /h
- {
- } def
-} def
-/TP
-{
- end
- iTm 0 0 moveto
-} def
-/Tr
-{
- _render 3 le
- {
- currentpoint newpath moveto
- } if
- dup 8 eq
- {
- pop 0
- }
- {
- dup 9 eq
- {
- pop 1
- } if
- } ifelse
- dup /_render exch ddef
- _renderStart exch get load exec
-} def
-/iTm
-{
- _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
-} def
-/Tm
-{
- _tm astore pop iTm 0 0 moveto
-} def
-/Td
-{
- _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
-} def
-/iTe
-{
- _render -1 eq
- {
- }
- {
- _renderEnd _render get dup null ne
- {
- load exec
- }
- {
- pop
- } ifelse
- } ifelse
- /_render -1 ddef
-} def
-/Ta
-{
- pop
-} def
-/Tf
-{
- dup 1000 div /_fScl exch ddef
-%
- selectfont
-} def
-/Tl
-{
- pop
- 0 exch _leading astore pop
-} def
-/Tt
-{
- pop
-} def
-/TW
-{
- 3 npop
-} def
-/Tw
-{
- /_cx exch ddef
-} def
-/TC
-{
- 3 npop
-} def
-/Tc
-{
- /_ax exch ddef
-} def
-/Ts
-{
- /_rise exch ddef
- currentpoint
- iTm
- moveto
-} def
-/Ti
-{
- 3 npop
-} def
-/Tz
-{
- 100 div /_hs exch ddef
- iTm
-} def
-/TA
-{
- pop
-} def
-/Tq
-{
- pop
-} def
-/Th
-{
- pop pop pop pop pop
-} def
-/TX
-{
- pop
-} def
-/Tk
-{
- exch pop _fScl mul neg 0 rmoveto
-} def
-/TK
-{
- 2 npop
-} def
-/T*
-{
- _leading aload pop neg Td
-} def
-/T*-
-{
- _leading aload pop Td
-} def
-/T-
-{
- _ax neg 0 rmoveto
- _hyphen Tx
-} def
-/T+
-{
-} def
-/TR
-{
- _ctm currentmatrix pop
- _tm astore pop
- iTm 0 0 moveto
-} def
-/TS
-{
- currentfont 3 1 roll
- /_Symbol_ _fScl 1000 mul selectfont
-
- 0 eq
- {
- Tx
- }
- {
- Tj
- } ifelse
- setfont
-} def
-/Xb
-{
- pop pop
-} def
-/Tb /Xb load def
-/Xe
-{
- pop pop pop pop
-} def
-/Te /Xe load def
-/XB
-{
-} def
-/TB /XB load def
-currentdict readonly pop
-end
-setpacking
-%%EndResource
-%%BeginProcSet: Adobe_ColorImage_AI6 1.0 0
-userdict /Adobe_ColorImage_AI6 known not
-{
- userdict /Adobe_ColorImage_AI6 17 dict put
-} if
-userdict /Adobe_ColorImage_AI6 get begin
-
- /initialize
- {
- Adobe_ColorImage_AI6 begin
- Adobe_ColorImage_AI6
- {
- dup type /arraytype eq
- {
- dup xcheck
- {
- bind
- } if
- } if
- pop pop
- } forall
- } def
- /terminate { end } def
-
- currentdict /Adobe_ColorImage_AI6_Vars known not
- {
- /Adobe_ColorImage_AI6_Vars 14 dict def
- } if
-
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 0 def
- /sourcecount 0 def
- /sourcearray 4 array def
- /plateindex -1 def
- /XIMask 0 def
- /XIBinary 0 def
- /XIChannelCount 0 def
- /XIBitsPerPixel 0 def
- /XIImageHeight 0 def
- /XIImageWidth 0 def
- /XIImageMatrix null def
- /XIBuffer null def
- /XIDataProc null def
- end
-
- /WalkRGBString null def
- /WalkCMYKString null def
-
- /StuffRGBIntoGrayString null def
- /RGBToGrayImageProc null def
- /StuffCMYKIntoGrayString null def
- /CMYKToGrayImageProc null def
- /ColorImageCompositeEmulator null def
-
- /SeparateCMYKImageProc null def
-
- /FourEqual null def
- /TestPlateIndex null def
-
- currentdict /_colorimage known not
- {
- /colorimage where
- {
- /colorimage get /_colorimage exch def
- }
- {
- /_colorimage null def
- } ifelse
- } if
-
- /_currenttransfer systemdict /currenttransfer get def
-
- /colorimage null def
- /XI null def
-
-
- /WalkRGBString
- {
- 0 3 index
-
- dup length 1 sub 0 3 3 -1 roll
- {
- 3 getinterval { } forall
-
- 5 index exec
-
- 3 index
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /WalkCMYKString
- {
- 0 3 index
-
- dup length 1 sub 0 4 3 -1 roll
- {
- 4 getinterval { } forall
-
- 6 index exec
-
- 3 index
-
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /StuffRGBIntoGrayString
- {
- .11 mul exch
-
- .59 mul add exch
-
- .3 mul add
-
- cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /RGBToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 3 idiv string
- dup 3 1 roll
-
- /StuffRGBIntoGrayString load exch
- WalkRGBString
- end
- } def
-
-
- /StuffCMYKIntoGrayString
- {
- exch .11 mul add
-
- exch .59 mul add
-
- exch .3 mul add
-
- dup 255 gt { pop 255 } if
-
- 255 exch sub cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /CMYKToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 4 idiv string
- dup 3 1 roll
-
- /StuffCMYKIntoGrayString load exch
- WalkCMYKString
- end
- } def
-
-
- /ColorImageCompositeEmulator
- {
- pop true eq
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
- }
- {
- Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 3 -1 roll put
-
- channelcount 3 eq
- {
- /RGBToGrayImageProc
- }
- {
- /CMYKToGrayImageProc
- } ifelse
- load
- end
- } if
- image
- } ifelse
- } def
-
-
- /SeparateCMYKImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
-
- sourcecount 0 ne
- {
- sourcearray plateindex get exec
- }
- {
- sourcearray 0 get exec
-
- dup length 4 idiv string
-
- 0 2 index
-
- plateindex 4 2 index length 1 sub
- {
- get 255 exch sub
-
- 3 copy put pop 1 add
-
- 2 index
- } for
-
- pop pop exch pop
- } ifelse
- end
- } def
-
-
- /FourEqual
- {
- 4 index ne
- {
- pop pop pop false
- }
- {
- 4 index ne
- {
- pop pop false
- }
- {
- 4 index ne
- {
- pop false
- }
- {
- 4 index eq
- } ifelse
- } ifelse
- } ifelse
- } def
-
-
- /TestPlateIndex
- {
- Adobe_ColorImage_AI6_Vars begin
- /plateindex -1 def
-
- /setcmykcolor where
- {
- pop
- gsave
- 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
- grestore
-
- 1 0 0 0 FourEqual
- {
- /plateindex 0 def
- }
- {
- 0 1 0 0 FourEqual
- {
- /plateindex 1 def
- }
- {
- 0 0 1 0 FourEqual
- {
- /plateindex 2 def
- }
- {
- 0 0 0 1 FourEqual
- {
- /plateindex 3 def
- }
- {
- 0 0 0 0 FourEqual
- {
- /plateindex 5 def
- } if
- } ifelse
- } ifelse
- } ifelse
- } ifelse
- pop pop pop pop
- } if
- plateindex
- end
- } def
-
-
- /colorimage
- {
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 1 index def
- /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
-
- 4 sourcecount add index dup
- 8 eq exch 1 eq or not
- end
-
- {
- /_colorimage load null ne
- {
- _colorimage
- }
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get
- 7 add { pop } repeat
- } ifelse
- }
- {
- dup 3 eq
- TestPlateIndex
- dup -1 eq exch 5 eq or or
- {
- /_colorimage load null eq
- {
- ColorImageCompositeEmulator
- }
- {
- dup 1 eq
- {
- pop pop image
- }
- {
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- gsave
-
- 0 _currenttransfer exec
- 1 _currenttransfer exec
- eq
- { 0 _currenttransfer exec 0.5 lt }
- { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
-
- { { pop 0 } } { { pop 1 } } ifelse
- systemdict /settransfer get exec
- } if
-
- _colorimage
-
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- grestore
- } if
- } ifelse
- } ifelse
- }
- {
- dup 1 eq
- {
- pop pop
- image
- }
- {
- pop pop
-
- Adobe_ColorImage_AI6_Vars begin
- sourcecount -1 0
- {
- exch sourcearray 3 1 roll put
- } for
-
- /SeparateCMYKImageProc load
- end
-
- systemdict /image get exec
- } ifelse
- } ifelse
- } ifelse
- } def
-
- /XI
- {
- Adobe_ColorImage_AI6_Vars begin
- gsave
- /XIMask exch 0 ne def
- /XIBinary exch 0 ne def
- pop
- pop
- /XIChannelCount exch def
- /XIBitsPerPixel exch def
- /XIImageHeight exch def
- /XIImageWidth exch def
- pop pop pop pop
- /XIImageMatrix exch def
-
- XIBitsPerPixel 1 eq
- {
- XIImageWidth 8 div ceiling cvi
- }
- {
- XIImageWidth XIChannelCount mul
- } ifelse
- /XIBuffer exch string def
-
- XIBinary
- {
- /XIDataProc { currentfile XIBuffer readstring pop } def
- currentfile 128 string readline pop pop
- }
- {
- /XIDataProc { currentfile XIBuffer readhexstring pop } def
- } ifelse
-
- 0 0 moveto
- XIImageMatrix concat
- XIImageWidth XIImageHeight scale
-
- XIMask
- {
- XIImageWidth XIImageHeight
- false
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- /_lp /null ddef
- _fc
- /_lp /imagemask ddef
-
- imagemask
- }
- {
- XIImageWidth XIImageHeight
- XIBitsPerPixel
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- XIChannelCount 1 eq
- {
-
- gsave
- 0 setgray
-
- image
-
- grestore
- }
- {
- false
- XIChannelCount
- colorimage
- } ifelse
- } ifelse
- grestore
- end
- } def
-
-end
-%%EndProcSet
-%%BeginResource: procset Adobe_Illustrator_AI5 1.1 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Full Prolog)
-%%Version: 1.1
-%%CreationDate: (3/7/1994) ()
-%%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_Illustrator_AI5_vars 81 dict dup begin
-put
-/_eo false def
-/_lp /none def
-/_pf
-{
-} def
-/_ps
-{
-} def
-/_psf
-{
-} def
-/_pss
-{
-} def
-/_pjsf
-{
-} def
-/_pjss
-{
-} def
-/_pola 0 def
-/_doClip 0 def
-/cf currentflat def
-/_tm matrix def
-/_renderStart
-[
-/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0
-] def
-/_renderEnd
-[
-null null null null /i1 /i1 /i1 /i1
-] def
-/_render -1 def
-/_rise 0 def
-/_ax 0 def
-/_ay 0 def
-/_cx 0 def
-/_cy 0 def
-/_leading
-[
-0 0
-] def
-/_ctm matrix def
-/_mtx matrix def
-/_sp 16#020 def
-/_hyphen (-) def
-/_fScl 0 def
-/_cnt 0 def
-/_hs 1 def
-/_nativeEncoding 0 def
-/_useNativeEncoding 0 def
-/_tempEncode 0 def
-/_pntr 0 def
-/_tDict 2 dict def
-/_wv 0 def
-/Tx
-{
-} def
-/Tj
-{
-} def
-/CRender
-{
-} def
-/_AI3_savepage
-{
-} def
-/_gf null def
-/_cf 4 array def
-/_if null def
-/_of false def
-/_fc
-{
-} def
-/_gs null def
-/_cs 4 array def
-/_is null def
-/_os false def
-/_sc
-{
-} def
-/_pd 1 dict def
-/_ed 15 dict def
-/_pm matrix def
-/_fm null def
-/_fd null def
-/_fdd null def
-/_sm null def
-/_sd null def
-/_sdd null def
-/_i null def
-/discardSave null def
-/buffer 256 string def
-/beginString null def
-/endString null def
-/endStringLength null def
-/layerCnt 1 def
-/layerCount 1 def
-/perCent (%) 0 get def
-/perCentSeen? false def
-/newBuff null def
-/newBuffButFirst null def
-/newBuffLast null def
-/clipForward? false def
-end
-userdict /Adobe_Illustrator_AI5 known not {
- userdict /Adobe_Illustrator_AI5 91 dict put
-} if
-userdict /Adobe_Illustrator_AI5 get begin
-/initialize
-{
- Adobe_Illustrator_AI5 dup begin
- Adobe_Illustrator_AI5_vars begin
- discardDict
- {
- bind pop pop
- } forall
- dup /nc get begin
- {
- dup xcheck 1 index type /operatortype ne and
- {
- bind
- } if
- pop pop
- } forall
- end
- newpath
-} def
-/terminate
-{
- end
- end
-} def
-/_
-null def
-/ddef
-{
- Adobe_Illustrator_AI5_vars 3 1 roll put
-} def
-/xput
-{
- dup load dup length exch maxlength eq
- {
- dup dup load dup
- length 2 mul dict copy def
- } if
- load begin
- def
- end
-} def
-/npop
-{
- {
- pop
- } repeat
-} def
-/sw
-{
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
-} def
-/swj
-{
- dup 4 1 roll
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
- 6 2 roll /_cnt 0 ddef
- {
- 1 index eq
- {
- /_cnt _cnt 1 add ddef
- } if
- } forall
- pop
- exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop
-} def
-/ss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put pop
- gsave
- false charpath currentpoint
- 4 index setmatrix
- stroke
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 3 npop
-} def
-/jss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- gsave
- _sp eq
- {
- exch 6 index 6 index 6 index 5 -1 roll widthshow
- currentpoint
- }
- {
- false charpath currentpoint
- 4 index setmatrix stroke
- } ifelse
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 6 npop
-} def
-/sp
-{
- {
- 2 npop (0) exch
- 2 copy 0 exch put pop
- false charpath
- 2 copy rmoveto
- } exch cshow
- 2 npop
-} def
-/jsp
-{
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- _sp eq
- {
- exch 5 index 5 index 5 index 5 -1 roll widthshow
- }
- {
- false charpath
- } ifelse
- 2 copy rmoveto
- } exch cshow
- 5 npop
-} def
-/pl
-{
- transform
- 0.25 sub round 0.25 add exch
- 0.25 sub round 0.25 add exch
- itransform
-} def
-/setstrokeadjust where
-{
- pop true setstrokeadjust
- /c
- {
- curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll curveto
- } def
- /V
- /v load def
- /y
- {
- 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- lineto
- } def
- /L
- /l load def
- /m
- {
- moveto
- } def
-}
-{
- /c
- {
- pl curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll pl curveto
- } def
- /V
- /v load def
- /y
- {
- pl 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- pl lineto
- } def
- /L
- /l load def
- /m
- {
- pl moveto
- } def
-} ifelse
-/d
-{
- setdash
-} def
-/cf
-{
-} def
-/i
-{
- dup 0 eq
- {
- pop cf
- } if
- setflat
-} def
-/j
-{
- setlinejoin
-} def
-/J
-{
- setlinecap
-} def
-/M
-{
- setmiterlimit
-} def
-/w
-{
- setlinewidth
-} def
-/XR
-{
- 0 ne
- /_eo exch ddef
-} def
-/H
-{
-} def
-/h
-{
- closepath
-} def
-/N
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- _eo {eoclip} {clip} ifelse /_doClip 0 ddef
- } if
- newpath
- }
- {
- /CRender
- {
- N
- } ddef
- } ifelse
-} def
-/n
-{
- N
-} def
-/F
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc
- /_doClip 0 ddef
- }
- {
- _pf
- } ifelse
- }
- {
- /CRender
- {
- F
- } ddef
- } ifelse
-} def
-/f
-{
- closepath
- F
-} def
-/S
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- _ps
- } ifelse
- }
- {
- /CRender
- {
- S
- } ddef
- } ifelse
-} def
-/s
-{
- closepath
- S
-} def
-/B
-{
- _pola 0 eq
- {
- _doClip 1 eq
- gsave F grestore
- {
- gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- S
- } ifelse
- }
- {
- /CRender
- {
- B
- } ddef
- } ifelse
-} def
-/b
-{
- closepath
- B
-} def
-/W
-{
- /_doClip 1 ddef
-} def
-/*
-{
- count 0 ne
- {
- dup type /stringtype eq
- {
- pop
- } if
- } if
- newpath
-} def
-/u
-{
-} def
-/U
-{
-} def
-/q
-{
- _pola 0 eq
- {
- gsave
- } if
-} def
-/Q
-{
- _pola 0 eq
- {
- grestore
- } if
-} def
-/*u
-{
- _pola 1 add /_pola exch ddef
-} def
-/*U
-{
- _pola 1 sub /_pola exch ddef
- _pola 0 eq
- {
- CRender
- } if
-} def
-/D
-{
- pop
-} def
-/*w
-{
-} def
-/*W
-{
-} def
-/`
-{
- /_i save ddef
- clipForward?
- {
- nulldevice
- } if
- 6 1 roll 4 npop
- concat pop
- userdict begin
- /showpage
- {
- } def
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {pop false setstrokeadjust} if
- newpath
- 0 setgray
- false setoverprint
-} def
-/~
-{
- end
- _i restore
-} def
-/O
-{
- 0 ne
- /_of exch ddef
- /_lp /none ddef
-} def
-/R
-{
- 0 ne
- /_os exch ddef
- /_lp /none ddef
-} def
-/g
-{
- /_gf exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _gf setgray
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/G
-{
- /_gs exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _gs setgray
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/k
-{
- _cf astore pop
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _cf aload pop setcmykcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/K
-{
- _cs astore pop
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _cs aload pop setcmykcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/x
-{
- /_gf exch ddef
- findcmykcustomcolor
- /_if exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _if _gf 1 exch sub setcustomcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/X
-{
- /_gs exch ddef
- findcmykcustomcolor
- /_is exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _is _gs 1 exch sub setcustomcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/A
-{
- pop
-} def
-/annotatepage
-{
-userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse
-} def
-/XT {
- pop pop
-} def
-/discard
-{
- save /discardSave exch store
- discardDict begin
- /endString exch store
- gt38?
- {
- 2 add
- } if
- load
- stopped
- pop
- end
- discardSave restore
-} bind def
-userdict /discardDict 7 dict dup begin
-put
-/pre38Initialize
-{
- /endStringLength endString length store
- /newBuff buffer 0 endStringLength getinterval store
- /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store
- /newBuffLast newBuff endStringLength 1 sub 1 getinterval store
-} def
-/shiftBuffer
-{
- newBuff 0 newBuffButFirst putinterval
- newBuffLast 0
- currentfile read not
- {
- stop
- } if
- put
-} def
-0
-{
- pre38Initialize
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff endString eq
- {
- cleartomark stop
- } if
- shiftBuffer
- } loop
- }
- {
- stop
- } ifelse
-} def
-1
-{
- pre38Initialize
- /beginString exch store
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff beginString eq
- {
- /layerCount dup load 1 add store
- }
- {
- newBuff endString eq
- {
- /layerCount dup load 1 sub store
- layerCount 0 eq
- {
- cleartomark stop
- } if
- } if
- } ifelse
- shiftBuffer
- } loop
- } if
-} def
-2
-{
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- endString eq
- {
- cleartomark stop
- } if
- } loop
-} def
-3
-{
- /beginString exch store
- /layerCnt 1 store
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- dup beginString eq
- {
- pop /layerCnt dup load 1 add store
- }
- {
- endString eq
- {
- layerCnt 1 eq
- {
- cleartomark stop
- }
- {
- /layerCnt dup load 1 sub store
- } ifelse
- } if
- } ifelse
- } loop
-} def
-end
-userdict /clipRenderOff 15 dict dup begin
-put
-{
- /n /N /s /S /f /F /b /B
-}
-{
- {
- _doClip 1 eq
- {
- /_doClip 0 ddef _eo {eoclip} {clip} ifelse
- } if
- newpath
- } def
-} forall
-/Tr /pop load def
-/Bb {} def
-/BB /pop load def
-/Bg {12 npop} def
-/Bm {6 npop} def
-/Bc /Bm load def
-/Bh {4 npop} def
-end
-/Lb
-{
- 4 npop
- 6 1 roll
- pop
- 4 1 roll
- pop pop pop
- 0 eq
- {
- 0 eq
- {
- (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard
- }
- {
-
- /clipForward? true def
-
- /Tx /pop load def
- /Tj /pop load def
-
- currentdict end clipRenderOff begin begin
- } ifelse
- }
- {
- 0 eq
- {
- save /discardSave exch store
- } if
- } ifelse
-} bind def
-/LB
-{
- discardSave dup null ne
- {
- restore
- }
- {
- pop
- clipForward?
- {
- currentdict
- end
- end
- begin
-
- /clipForward? false ddef
- } if
- } ifelse
-} bind def
-/Pb
-{
- pop pop
- 0 (%AI5_EndPalette) discard
-} bind def
-/Np
-{
- 0 (%AI5_End_NonPrinting--) discard
-} bind def
-/Ln /pop load def
-/Ap
-/pop load def
-/Ar
-{
- 72 exch div
- 0 dtransform dup mul exch dup mul add sqrt
- dup 1 lt
- {
- pop 1
- } if
- setflat
-} def
-/Mb
-{
- q
-} def
-/Md
-{
-} def
-/MB
-{
- Q
-} def
-/nc 3 dict def
-nc begin
-/setgray
-{
- pop
-} bind def
-/setcmykcolor
-{
- 4 npop
-} bind def
-/setcustomcolor
-{
- 2 npop
-} bind def
-currentdict readonly pop
-end
-end
-setpacking
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%IncludeFont: Univers
-Adobe_level2_AI5 /initialize get exec
-Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec
-Adobe_ColorImage_AI6 /initialize get exec
-Adobe_Illustrator_AI5 /initialize get exec
-[
-39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
-/Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
-/egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
-/oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
-/udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
-/registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
-/.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
-/.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
-/questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
-/guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
-/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
-/.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
-/fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
-/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
-/Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
-/Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
-/hungarumlaut/ogonek/caron
-TE
-%AI3_BeginEncoding: _Univers Univers
-[/_Univers/Univers 0 0 1 TZ
-%AI3_EndEncoding AdobeType
-%AI5_Begin_NonPrinting
-Np
-8 Bn
-%AI5_BeginGradient: (Black & White)
-(Black & White) 0 2 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Green & Blue)
-(Green & Blue) 0 2 Bd
-[
-<
-99999A9A9B9B9B9C9C9D9D9D9E9E9F9F9FA0A0A1A1A1A2A2A3A3A3A4A4A5A5A5A6A6A7A7A7A8A8A9
-A9A9AAAAABABABACACADADADAEAEAFAFAFB0B0B1B1B1B2B2B3B3B3B4B4B5B5B5B6B6B7B7B7B8B8B9
-B9B9BABABBBBBBBCBCBDBDBDBEBEBFBFBFC0C0C1C1C1C2C2C3C3C3C4C4C5C5C5C6C6C7C7C7C8C8C9
-C9C9CACACBCBCBCCCCCDCDCDCECECFCFCFD0D0D1D1D1D2D2D3D3D3D4D4D5D5D5D6D6D7D7D7D8D8D9
-D9D9DADADBDBDBDCDCDDDDDDDEDEDFDFDFE0E0E1E1E1E2E2E3E3E3E4E4E5E5E5E6E6E7E7E7E8E8E9
-E9E9EAEAEBEBEBECECEDEDEDEEEEEFEFEFF0F0F1F1F1F2F2F3F3F3F4F4F5F5F5F6F6F7F7F7F8F8F9
-F9F9FAFAFBFBFBFCFCFDFDFDFEFEFFFF
->
-<
-000102020304050506070808090A0B0B0C0D0E0E0F101111121314141516171718191A1A1B1C1D1D
-1E1F20202122232324252626272829292A2B2C2C2D2E2F2F303132323334353536373838393A3B3B
-3C3D3E3E3F404141424344444546474748494A4A4B4C4D4D4E4F5050515253535455565657585959
-5A5B5C5C5D5E5F5F606162626364656566676868696A6B6B6C6D6E6E6F7071717273747475767777
-78797A7A7B7C7D7D7E7F80808182828384858586878888898A8B8B8C8D8E8E8F9091919293949495
-96979798999A9A9B9C9D9D9E9FA0A0A1A2A3A3A4A5A6A6A7A8A9A9AAABACACADAEAFAFB0B1B2B2B3
-B4B5B5B6B7B8B8B9BABBBBBCBDBEBEBF
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-[
-1 0.75 0 0 1 50 100 %_Bs
-0.6 0 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Pink, Yellow, Green)
-(Pink, Yellow, Green) 0 3 Bd
-[
-<
-00000000000000000000000000000000000000010101010101010101010101010101010101010101
-01010101010202020202020202020202020202020202020202020203030303030303030303030303
-03030303030303030404040404040404040404040404040404040404050505050505050505050505
-05050505050505060606060606060606060606060606060606060707070707070707070707070707
-07070707080808080808080808080808080808080809090909090909090909090909090909090A0A
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0C
-0C0C0C0C0C0C0C0D0D0D0D0D
->
-<
-050506060606070708080809090A0A0A0B0B0C0C0D0D0E0E0F0F1010111112121313141415151617
-17181819191A1A1B1C1C1D1D1E1F1F202021222223232425252626272828292A2A2B2C2C2D2D2E2F
-2F3031313233333435353637373839393A3B3B3C3D3E3E3F4040414242434445454647474849494A
-4B4C4C4D4E4F4F505151525354545556575758595A5A5B5C5C5D5E5F5F6061626363646566666768
-69696A6B6C6C6D6E6F707071727373747576777778797A7B7B7C7D7E7F7F80818283838485868787
-88898A8B8B8C8D8E8F8F9091929394949596979898999A9B9C9D9D9E9FA0A1A2A2A3A4A5A6A7A7A8
-A9AAABACADADAEAFB0B1B2B2
->
-<
-CCCCCBCBCBCACACAC9C9C8C8C7C7C6C6C5C5C4C4C3C2C2C1C1C0C0BFBEBEBDBDBCBBBBBAB9B9B8B7
-B7B6B6B5B4B4B3B2B1B1B0AFAFAEADADACABAAAAA9A8A8A7A6A5A5A4A3A2A2A1A0A09F9E9D9C9C9B
-9A999998979696959493929291908F8E8E8D8C8B8A8A8988878686858483828181807F7E7D7C7C7B
-7A7978777776757473727171706F6E6D6C6B6A6A69686766656463636261605F5E5D5C5B5B5A5958
-5756555453525151504F4E4D4C4B4A49484746464544434241403F3E3D3C3B3A3938383736353433
-3231302F2E2D2C2B2A29282726252423222221201F1E1D1C1B1A191817161514131211100F0E0D0C
-0B0A09080706050403020100
->
-0
-1 %_Br
-<
-737271706F6E6D6C6B6A696867666564636261605F5E5D5C5B5B5A59585756555453525150504F4E
-4D4C4B4A4949484746454443434241403F3E3E3D3C3B3A3A393837363635343333323130302F2E2D
-2D2C2B2A2A29282827262525242323222121201F1F1E1D1D1C1C1B1A1A1918181717161615141413
-1312121111100F0F0E0E0D0D0C0C0C0B0B0A0A090908080807070606060505050404040303030202
-020201010101010000000000
->
-<
-00000000000000000000000001010101010101010101010101010101010101010101010102020202
-02020202020202020202020202020202020202020202030303030303030303030303030303030303
-03030303030303030303030303040404040404040404040404040404040404040404040404040404
-04040404040404040404050505050505050505050505050505050505050505050505050505050505
-050505050505050505050505
->
-<
-BFBFBFC0C0C0C0C0C0C0C0C0C1C1C1C1C1C1C1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C3C3
-C3C4C4C4C4C4C4C4C4C4C4C5C5C5C5C5C5C5C5C5C5C5C6C6C6C6C6C6C6C6C6C6C6C6C7C7C7C7C7C7
-C7C7C7C7C7C7C8C8C8C8C8C8C8C8C8C8C8C8C8C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9CACACACACACA
-CACACACACACACACACACACBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCCCCCCCCCCCCCCCC
-CCCCCCCCCCCCCCCCCCCCCCCC
->
-0
-1 %_Br
-[
-0.05 0.7 0 0 1 50 100 %_Bs
-0 0.02 0.8 0 1 57 36 %_Bs
-0.45 0 0.75 0 1 37 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Purple, Red & Yellow)
-(Purple, Red & Yellow) 0 3 Bd
-[
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A
->
-<
-CCCCCCCDCDCDCDCDCECECECECECFCFCFCFD0D0D0D0D0D1D1D1D1D1D2D2D2D2D2D3D3D3D3D3D4D4D4
-D4D5D5D5D5D5D6D6D6D6D6D7D7D7D7D7D8D8D8D8D8D9D9D9D9DADADADADADBDBDBDBDBDCDCDCDCDC
-DDDDDDDDDDDEDEDEDEDFDFDFDFDFE0E0E0E0E0E1E1E1E1E1E2E2E2E2E2E3E3E3E3E4E4E4E4E4E5E5
-E5E5E5E6E6E6E6E6E7E7E7E7E7E8E8E8E8E9E9E9E9E9EAEAEAEAEAEBEBEBEBEBECECECECECEDEDED
-EDEEEEEEEEEEEFEFEFEFEFF0F0F0F0F0F1F1F1F1F1F2F2F2F2F3F3F3F3F3F4F4F4F4F4F5F5F5F5F5
-F6F6F6F6F6F7F7F7F7F8F8F8F8F8F9F9F9F9F9FAFAFAFAFAFBFBFBFBFBFCFCFCFCFDFDFDFDFDFEFE
-FEFEFEFFFFFF
->
-0
-1 %_Br
-<
-E5E4E3E2E1E0DFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBE
-BDBCBBBAB9B8B7B6B5B4B3B2B1B0AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A99989796
-9594939291908F8E8D8C8B8A898887868584838281807F7E7D7C7B7A797877767574737271706F6E
-6D6C6B6A696867666564636261605F5E5D5C5B5A595857565554535251504F4E4D4C4B4A49484746
-4544434241403F3E3D3C3B3A393837363534333231302F2E2D2C2B2A292827262524232221201F1E
-1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
->
-<
-E5E6E6E6E6E6E6E6E6E7E7E7E7E7E7E7E7E7E8E8E8E8E8E8E8E8E8E9E9E9E9E9E9E9E9E9EAEAEAEA
-EAEAEAEAEAEBEBEBEBEBEBEBEBEBECECECECECECECECECEDEDEDEDEDEDEDEDEDEEEEEEEEEEEEEEEE
-EEEFEFEFEFEFEFEFEFEFF0F0F0F0F0F0F0F0F0F1F1F1F1F1F1F1F1F1F2F2F2F2F2F2F2F2F2F3F3F3
-F3F3F3F3F3F3F4F4F4F4F4F4F4F4F4F5F5F5F5F5F5F5F5F5F6F6F6F6F6F6F6F6F6F7F7F7F7F7F7F7
-F7F7F8F8F8F8F8F8F8F8F8F9F9F9F9F9F9F9F9F9FAFAFAFAFAFAFAFAFAFBFBFBFBFBFBFBFBFBFCFC
-FCFCFCFCFCFCFCFDFDFDFDFDFDFDFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFF
->
-<
-00010203040405060708090A0B0C0C0D0E0F10111213141415161718191A1B1C1D1D1E1F20212223
-242525262728292A2B2C2D2D2E2F30313233343535363738393A3B3C3D3D3E3F4041424344454546
-4748494A4B4C4D4E4E4F50515253545556565758595A5B5C5D5E5E5F60616263646566666768696A
-6B6C6D6E6E6F70717273747576767778797A7B7C7D7E7F7F80818283848586878788898A8B8C8D8E
-8F8F90919293949596979798999A9B9C9D9E9F9FA0A1A2A3A4A5A6A7A7A8A9AAABACADAEAFAFB0B1
-B2B3B4B5B6B7B8B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C8C9CACBCC
->
-0
-1 %_Br
-[
-0 0.04 1 0 1 50 100 %_Bs
-0 1 0.8 0 1 50 50 %_Bs
-0.9 0.9 0 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Rainbow)
-(Rainbow) 0 6 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-0
-1 %_Br
-1
-<
-0708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E
-2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556
-5758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E
-7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6
-A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCE
-CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6
-F7F8F9FAFBFCFDFEFF
->
-0
-0
-1 %_Br
-1
-<
-00000000000000000000000000000000000001010101010101010101010101010101010101010101
-01010101010101010101010101010202020202020202020202020202020202020202020202020202
-02020202020202020202030303030303030303030303030303030303030303030303030303030303
-03030303030304040404040404040404040404040404040404040404040404040404040404040404
-04040505050505050505050505050505050505050505050505050505050505050505050505050606
-06060606060606060606060606060606060606060606060606060606060606060606070707070707
-07070707070707070707070707070707
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0
-1
-0
-1 %_Br
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-1 %_Br
-[
-0 1 0 0 1 50 100 %_Bs
-1 1 0 0 1 50 80 %_Bs
-1 0.0279 0 0 1 50 60 %_Bs
-1 0 1 0 1 50 40 %_Bs
-0 0 1 0 1 50 20 %_Bs
-0 1 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Steel Bar)
-(Steel Bar) 0 3 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 70 %_Bs
-0 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Orange Radial)
-(Yellow & Orange Radial) 1 2 Bd
-[
-0
-<
-0001010203040506060708090A0B0C0C0D0E0F10111213131415161718191A1B1C1D1D1E1F202122
-232425262728292A2B2B2C2D2E2F303132333435363738393A3B3C3D3E3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60606162636465666768696A6B6C6D6E6F
-707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C
->
-<
-FFFFFFFFFEFEFEFEFEFEFEFDFDFDFDFDFDFCFCFCFCFCFCFBFBFBFBFBFBFAFAFAFAFAFAF9F9F9F9F9
-F9F8F8F8F8F8F8F7F7F7F7F7F7F6F6F6F6F6F6F5F5F5F5F5F5F4F4F4F4F4F3F3F3F3F3F3F2F2F2F2
-F2F2F1F1F1F1F1F0F0F0F0F0F0EFEFEFEFEFEFEEEEEEEEEEEDEDEDEDEDEDECECECECECEBEBEBEBEB
-EBEAEAEAEAEAE9E9E9E9E9E9E8E8E8E8E8E8E7E7E7E7E7E6E6E6E6E6E5
->
-0
-1 %_Br
-[
-0 0 1 0 1 52 19 %_Bs
-0 0.55 0.9 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Purple Radial)
-(Yellow & Purple Radial) 1 2 Bd
-[
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-<
-1415161718191A1B1C1D1E1F1F202122232425262728292A2A2B2C2D2E2F30313233343536363738
-393A3B3C3D3E3F40414142434445464748494A4B4C4D4D4E4F50515253545556575858595A5B5C5D
-5E5F60616263646465666768696A6B6C6D6E6F6F707172737475767778797A7B7B7C7D7E7F808182
-83848586868788898A8B8C8D8E8F90919292939495969798999A9B9C9D9D9E9FA0A1A2A3A4A5A6A7
-A8A9A9AAABACADAEAFB0B1B2B3B4B4B5B6B7B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C9CACBCB
-CCCDCECFD0D1D2D3D4D5D6D7D7D8D9DADBDCDDDEDFE0E1E2E2E3E4E5E6E7E8E9EAEBECEDEEEEEFF0
-F1F2F3F4F5F6F7F8F9F9FAFBFCFDFEFF
->
-<
-ABAAAAA9A8A7A7A6A5A5A4A3A3A2A1A1A09F9F9E9D9D9C9B9B9A9999989797969595949393929191
-908F8F8E8D8D8C8B8B8A8989888787868585848383828181807F7F7E7D7D7C7B7B7A797978777776
-7575747373727171706F6F6E6D6D6C6B6B6A6969686767666565646362626160605F5E5E5D5C5C5B
-5A5A5958585756565554545352525150504F4E4E4D4C4C4B4A4A4948484746464544444342424140
-403F3E3E3D3C3C3B3A3A3938383736363534343332323130302F2E2E2D2C2C2B2A2A292828272626
-25242423222121201F1F1E1D1D1C1B1B1A1919181717161515141313121111100F0F0E0D0D0C0B0B
-0A090908070706050504030302010100
->
-0
-1 %_Br
-[
-0 0.08 0.67 0 1 50 14 %_Bs
-1 1 0 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_End_NonPrinting--
-%AI5_BeginPalette
-0 2 Pb
-Pn
-Pc
-1 g
-Pc
-0 g
-Pc
-0 0 0 0 k
-Pc
-0.75 g
-Pc
-0.5 g
-Pc
-0.25 g
-Pc
-0 g
-Pc
-Bb
-2 (Black & White) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0 0 0 k
-Pc
-0.5 0 0 0 k
-Pc
-0.75 0 0 0 k
-Pc
-1 0 0 0 k
-Pc
-0.25 0.25 0 0 k
-Pc
-0.5 0.5 0 0 k
-Pc
-0.75 0.75 0 0 k
-Pc
-1 1 0 0 k
-Pc
-Bb
-2 (Pink, Yellow, Green) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0 0 k
-Pc
-0 0.5 0 0 k
-Pc
-0 0.75 0 0 k
-Pc
-0 1 0 0 k
-Pc
-0 0.25 0.25 0 k
-Pc
-0 0.5 0.5 0 k
-Pc
-0 0.75 0.75 0 k
-Pc
-0 1 1 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Purple Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0 0.25 0 k
-Pc
-0 0 0.5 0 k
-Pc
-0 0 0.75 0 k
-Pc
-0 0 1 0 k
-Pc
-0.25 0 0.25 0 k
-Pc
-0.5 0 0.5 0 k
-Pc
-0.75 0 0.75 0 k
-Pc
-1 0 1 0 k
-Pc
-Bb
-2 (Rainbow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0 0 k
-Pc
-0.5 0.25 0 0 k
-Pc
-0.75 0.375 0 0 k
-Pc
-1 0.5 0 0 k
-Pc
-0.125 0.25 0 0 k
-Pc
-0.25 0.5 0 0 k
-Pc
-0.375 0.75 0 0 k
-Pc
-0.5 1 0 0 k
-Pc
-Bb
-2 (Steel Bar) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0.125 0 k
-Pc
-0 0.5 0.25 0 k
-Pc
-0 0.75 0.375 0 k
-Pc
-0 1 0.5 0 k
-Pc
-0 0.125 0.25 0 k
-Pc
-0 0.25 0.5 0 k
-Pc
-0 0.375 0.75 0 k
-Pc
-0 0.5 1 0 k
-Pc
-Bb
-2 (Purple, Red & Yellow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0 0.25 0 k
-Pc
-0.25 0 0.5 0 k
-Pc
-0.375 0 0.75 0 k
-Pc
-0.5 0 1 0 k
-Pc
-0.25 0 0.125 0 k
-Pc
-0.5 0 0.25 0 k
-Pc
-0.75 0 0.375 0 k
-Pc
-1 0 0.5 0 k
-Pc
-Bb
-2 (Green & Blue) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0.125 0 k
-Pc
-0.5 0.25 0.25 0 k
-Pc
-0.75 0.375 0.375 0 k
-Pc
-1 0.5 0.5 0 k
-Pc
-0.25 0.25 0.125 0 k
-Pc
-0.5 0.5 0.25 0 k
-Pc
-0.75 0.75 0.375 0 k
-Pc
-1 1 0.5 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Orange Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0.25 0.125 0 k
-Pc
-0.25 0.5 0.25 0 k
-Pc
-0.375 0.75 0.375 0 k
-Pc
-0.5 1 0.5 0 k
-Pc
-0.125 0.25 0.25 0 k
-Pc
-0.25 0.5 0.5 0 k
-Pc
-0.375 0.75 0.75 0 k
-Pc
-0.5 1 1 0 k
-Pc
-0 0 0 0 k
-Pc
-0.125 0.125 0.25 0 k
-Pc
-0.25 0.25 0.5 0 k
-Pc
-0.375 0.375 0.75 0 k
-Pc
-0.5 0.5 1 0 k
-Pc
-0.25 0.125 0.25 0 k
-Pc
-0.5 0.25 0.5 0 k
-Pc
-0.75 0.375 0.75 0 k
-Pc
-1 0.5 1 0 k
-Pc
-PB
-%AI5_EndPalette
-%%EndSetup
-%AI5_BeginLayer
-1 1 1 1 0 0 0 79 128 255 Lb
-(Layer 1) Ln
-0 A
-800 Ar
-0 J 0 j 1 w 4 M []0 d
-%AI3_Note:
-0 D
-0 XR
--4014 283.5 m
-4626 283.5 L
-(N) *
-453.5 4716 m
-453.5 -3924 L
-(N) *
-85 4716 m
-85 -3924 L
-(N) *
--4014 765.5 m
-4626 765.5 L
-(N) *
-0 R
-0 G
-113 683.5 m
-439 683.5 l
-S
-113 663.5 m
-439 663.5 l
-S
-113 643.5 m
-439 643.5 l
-S
-113 686 m
-439 686 l
-S
-1 Ap
-439 624 m
-439 709 L
-113 709 L
-113 624 L
-439 624 L
-s
-0 Ap
-178.5 709 m
-178.5 624 l
-S
-243 709 m
-243 624 l
-S
-374 709 m
-374 624 l
-S
-308.5 709 m
-308.5 624 l
-S
-0 To
-1 0 0 1 146 692 0 Tp
-TP
--12.2278 0 Td
-0 Tr
-0 O
-0 g
-/_Univers 10 Tf
-0 Ts
-100 Tz
-0 Tt
-1 TA
-%_ 0 XL
-36 0 Xb
-XB
-0 0 5 TC
-100 100 200 TW
-0 0 0 Ti
-1 Ta
-0 0 2 2 3 Th
-0 Tq
-0 0 Tl
-0 Tc
-0 Tw
-(key 1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 213 692 0 Tp
-TP
--12.2278 0 Td
-0 Tr
-(key 2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 276 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 3) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 225.5 747.5 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 336.5 693.5 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 341 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 4) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 407.5 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 5) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 185.5 736 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 145 669.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 144.5 650.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 145 630 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 669 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 649.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 629.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 669 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(a) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 649.5 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(d) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 629.5 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(g) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 669 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(b) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 649.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(e) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 629.5 0 Tp
-TP
--8.8879 0 Td
-0 Tr
-(N/A) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 669 0 Tp
-TP
--2.5 0 Td
-0 Tr
-(c) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 649.5 0 Tp
-TP
--1.6638 0 Td
-0 Tr
-(f) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 629.5 0 Tp
-TP
--1.3892 0 Td
-0 Tr
-(i) Tx
-(\r) TX
-TO
-1 Ap
-0 R
-0 G
-274.4998 623.4963 m
-279.1963 623.4963 283.0037 627.3037 283.0037 632.0002 c
-283.0037 636.6968 279.1963 640.5042 274.4998 640.5042 c
-269.8032 640.5042 265.9958 636.6968 265.9958 632.0002 c
-265.9958 627.3037 269.8032 623.4963 274.4998 623.4963 c
-s
-[3 4 3 4 3 4 ]0 d
-339.9998 663.4963 m
-344.6963 663.4963 348.5037 667.3037 348.5037 672.0002 c
-348.5037 676.6968 344.6963 680.5042 339.9998 680.5042 c
-335.3032 680.5042 331.4958 676.6968 331.4958 672.0002 c
-331.4958 667.3037 335.3032 663.4963 339.9998 663.4963 c
-s
-u
-u
-u
-u
-u
-u
-u
-0 Ap
-[]0 d
-274.4998 623.4963 m
-277 615.5 297 615.5 v
-317 615.5 313.6364 635.614 316.5 648.5 c
-318.5 657.5 326 662 y
-S
-0 O
-0 g
-327.4981 664.0941 m
-325.8236 663.6715 324.6654 663.5131 323.254 663.2872 c
-325.8493 658.9617 l
-326.1406 659.3991 327.3976 661.0481 328.5586 662.3265 c
-329.8008 663.6954 330.9886 664.8344 331.8138 665.4817 c
-330.8543 665.0582 329.2904 664.5461 327.4981 664.0941 c
-f
-U
-U
-U
-U
-U
-U
-U
-1 Ap
-0 R
-0 G
-404.9998 624.4963 m
-409.6963 624.4963 413.5037 628.3037 413.5037 633.0002 c
-413.5037 637.6968 409.6963 641.5042 404.9998 641.5042 c
-400.3032 641.5042 396.4958 637.6968 396.4958 633.0002 c
-396.4958 628.3037 400.3032 624.4963 404.9998 624.4963 c
-s
-u
-0 Ap
-396.4958 633.0002 m
-384.5 634.5089 384.5 620.5 v
-383.5 603 l
-S
-0 O
-0 g
-384.3884 600.5834 m
-384.9812 602.2055 385.5017 603.2521 386.1089 604.5461 c
-381.0729 604.8338 l
-381.2706 604.347 381.9268 602.38 382.3305 600.701 c
-382.7634 598.904 383.0369 597.2812 383.1078 596.2348 c
-383.2974 597.2663 383.7539 598.8474 384.3884 600.5834 c
-f
-U
-0 To
-1 0 0 1 383 582 0 Tp
-TP
--26.9788 0 Td
-0 Tr
-(endOfT) Tx 1 104 Tk
-(able) Tx
-(\r) TX
-TO
-LB
-%AI5_EndLayer--
-%%PageTrailer
-gsave annotatepage grestore showpage
-%%Trailer
-Adobe_Illustrator_AI5 /terminate get exec
-Adobe_ColorImage_AI6 /terminate get exec
-Adobe_typography_AI5 /terminate get exec
-Adobe_level2_AI5 /terminate get exec
-%%EOF
diff --git a/lib/snmp/doc/src/getnext4.ps b/lib/snmp/doc/src/getnext4.ps
deleted file mode 100644
index 8ef3ccf709..0000000000
--- a/lib/snmp/doc/src/getnext4.ps
+++ /dev/null
@@ -1,3002 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: Adobe Illustrator(r) 6.0
-%%For: (Anna Fedoriw) (Ericsson Telecom)
-%%Title: (GetNext312.eps)
-%%CreationDate: (97-05-23) (14.04)
-%%BoundingBox: 112 605 440 757
-%%HiResBoundingBox: 112.5 605.1454 439.5 756.8677
-%%DocumentProcessColors: Black
-%%DocumentFonts: Univers
-%%DocumentSuppliedResources: procset Adobe_level2_AI5 1.0 0
-%%+ procset Adobe_typography_AI5 1.0 0
-%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6
-%%+ procset Adobe_Illustrator_AI5 1.0 0
-%AI5_FileFormat 2.0
-%AI3_ColorUsage: Black&White
-%%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set)
-%%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1
-%%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 ()
-%AI3_TemplateBox: 306 396 306 396
-%AI3_TileBox: 21 -12 588 802
-%AI3_DocumentPreview: Macintosh_ColorPic
-%AI5_ArtSize: 595.2756 841.8898
-%AI5_RulerUnits: 1
-%AI5_ArtFlags: 0 0 0 1 0 0 1 1 0
-%AI5_TargetResolution: 800
-%AI5_NumLayers: 1
-%AI5_OpenToView: 54 804 2 1146 827 58 1 1 3 40
-%AI5_OpenViewLayers: 7
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset Adobe_level2_AI5 1.2 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation)
-%%Version: 1.2
-%%CreationDate: (04/10/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-userdict /Adobe_level2_AI5 23 dict dup begin
- put
- /packedarray where not
- {
- userdict begin
- /packedarray
- {
- array astore readonly
- } bind def
- /setpacking /pop load def
- /currentpacking false def
- end
- 0
- } if
- pop
- userdict /defaultpacking currentpacking put true setpacking
- /initialize
- {
- Adobe_level2_AI5 begin
- } bind def
- /terminate
- {
- currentdict Adobe_level2_AI5 eq
- {
- end
- } if
- } bind def
- mark
- /setcustomcolor where not
- {
- /findcmykcustomcolor
- {
- 5 packedarray
- } bind def
- /setcustomcolor
- {
- exch aload pop pop
- 4
- {
- 4 index mul 4 1 roll
- } repeat
- 5 -1 roll pop
- setcmykcolor
- }
- def
- } if
-
- /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def
- userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put
- userdict /level2?
- systemdict /languagelevel known dup
- {
- pop systemdict /languagelevel get 2 ge
- } if
- put
-/level2ScreenFreq
-{
- begin
- 60
- HalftoneType 1 eq
- {
- pop Frequency
- } if
- HalftoneType 2 eq
- {
- pop GrayFrequency
- } if
- HalftoneType 5 eq
- {
- pop Default level2ScreenFreq
- } if
- end
-} bind def
-userdict /currentScreenFreq
- level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put
-level2? not
- {
- /setcmykcolor where not
- {
- /setcmykcolor
- {
- exch .11 mul add exch .59 mul add exch .3 mul add
- 1 exch sub setgray
- } def
- } if
- /currentcmykcolor where not
- {
- /currentcmykcolor
- {
- 0 0 0 1 currentgray sub
- } def
- } if
- /setoverprint where not
- {
- /setoverprint /pop load def
- } if
- /selectfont where not
- {
- /selectfont
- {
- exch findfont exch
- dup type /arraytype eq
- {
- makefont
- }
- {
- scalefont
- } ifelse
- setfont
- } bind def
- } if
- /cshow where not
- {
- /cshow
- {
- [
- 0 0 5 -1 roll aload pop
- ] cvx bind forall
- } bind def
- } if
- } if
- cleartomark
- /anyColor?
- {
- add add add 0 ne
- } bind def
- /testColor
- {
- gsave
- setcmykcolor currentcmykcolor
- grestore
- } bind def
- /testCMYKColorThrough
- {
- testColor anyColor?
- } bind def
- userdict /composite?
- level2?
- {
- gsave 1 1 1 1 setcmykcolor currentcmykcolor grestore
- add add add 4 eq
- }
- {
- 1 0 0 0 testCMYKColorThrough
- 0 1 0 0 testCMYKColorThrough
- 0 0 1 0 testCMYKColorThrough
- 0 0 0 1 testCMYKColorThrough
- and and and
- } ifelse
- put
- composite? not
- {
- userdict begin
- gsave
- /cyan? 1 0 0 0 testCMYKColorThrough def
- /magenta? 0 1 0 0 testCMYKColorThrough def
- /yellow? 0 0 1 0 testCMYKColorThrough def
- /black? 0 0 0 1 testCMYKColorThrough def
- grestore
- /isCMYKSep? cyan? magenta? yellow? black? or or or def
- /customColor? isCMYKSep? not def
- end
- } if
- end defaultpacking setpacking
-%%EndResource
-%%BeginResource: procset Adobe_typography_AI5 1.0 1
-%%Title: (Typography Operators)
-%%Version: 1.0
-%%CreationDate:(03/26/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_typography_AI5 54 dict dup begin
-put
-/initialize
-{
- begin
- begin
- Adobe_typography_AI5 begin
- Adobe_typography_AI5
- {
- dup xcheck
- {
- bind
- } if
- pop pop
- } forall
- end
- end
- end
- Adobe_typography_AI5 begin
-} def
-/terminate
-{
- currentdict Adobe_typography_AI5 eq
- {
- end
- } if
-} def
-/modifyEncoding
-{
- /_tempEncode exch ddef
- /_pntr 0 ddef
- {
- counttomark -1 roll
- dup type dup /marktype eq
- {
- pop pop exit
- }
- {
- /nametype eq
- {
- _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
- put
- }
- {
- /_pntr exch ddef
- } ifelse
- } ifelse
- } loop
- _tempEncode
-} def
-/TE
-{
- StandardEncoding 256 array copy modifyEncoding
- /_nativeEncoding exch def
-} def
-%
-/TZ
-{
- dup type /arraytype eq
- {
- /_wv exch def
- }
- {
- /_wv 0 def
- } ifelse
- /_useNativeEncoding exch def
- pop pop
- findfont _wv type /arraytype eq
- {
- _wv makeblendedfont
- } if
- dup length 2 add dict
- begin
- mark exch
- {
- 1 index /FID ne
- {
- def
- } if
- cleartomark mark
- } forall
- pop
- /FontName exch def
- counttomark 0 eq
- {
- 1 _useNativeEncoding eq
- {
- /Encoding _nativeEncoding def
- } if
- cleartomark
- }
- {
- /Encoding load 256 array copy
- modifyEncoding /Encoding exch def
- } ifelse
- FontName currentdict
- end
- definefont pop
-} def
-/tr
-{
- _ax _ay 3 2 roll
-} def
-/trj
-{
- _cx _cy _sp _ax _ay 6 5 roll
-} def
-/a0
-{
- /Tx
- {
- dup
- currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- } ddef
- /Tj
- {
- dup
- currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- } ddef
-} def
-/a1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/e0
-{
- /Tx
- {
- tr _psf
- } ddef
- /Tj
- {
- trj _pjsf
- } ddef
-} def
-/e1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- tr _psf
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- trj _pjsf
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/i0
-{
- /Tx
- {
- tr sp
- } ddef
- /Tj
- {
- trj jsp
- } ddef
-} def
-/i1
-{
- W N
-} def
-/o0
-{
- /Tx
- {
- tr sw rmoveto
- } ddef
- /Tj
- {
- trj swj rmoveto
- } ddef
-} def
-/r0
-{
- /Tx
- {
- tr _ctm _pss
- } ddef
- /Tj
- {
- trj _ctm _pjss
- } ddef
-} def
-/r1
-{
- /Tx
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/To
-{
- pop _ctm currentmatrix pop
-} def
-/TO
-{
- iTe _ctm setmatrix newpath
-} def
-/Tp
-{
- pop _tm astore pop _ctm setmatrix
- _tDict begin
- /W
- {
- } def
- /h
- {
- } def
-} def
-/TP
-{
- end
- iTm 0 0 moveto
-} def
-/Tr
-{
- _render 3 le
- {
- currentpoint newpath moveto
- } if
- dup 8 eq
- {
- pop 0
- }
- {
- dup 9 eq
- {
- pop 1
- } if
- } ifelse
- dup /_render exch ddef
- _renderStart exch get load exec
-} def
-/iTm
-{
- _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
-} def
-/Tm
-{
- _tm astore pop iTm 0 0 moveto
-} def
-/Td
-{
- _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
-} def
-/iTe
-{
- _render -1 eq
- {
- }
- {
- _renderEnd _render get dup null ne
- {
- load exec
- }
- {
- pop
- } ifelse
- } ifelse
- /_render -1 ddef
-} def
-/Ta
-{
- pop
-} def
-/Tf
-{
- dup 1000 div /_fScl exch ddef
-%
- selectfont
-} def
-/Tl
-{
- pop
- 0 exch _leading astore pop
-} def
-/Tt
-{
- pop
-} def
-/TW
-{
- 3 npop
-} def
-/Tw
-{
- /_cx exch ddef
-} def
-/TC
-{
- 3 npop
-} def
-/Tc
-{
- /_ax exch ddef
-} def
-/Ts
-{
- /_rise exch ddef
- currentpoint
- iTm
- moveto
-} def
-/Ti
-{
- 3 npop
-} def
-/Tz
-{
- 100 div /_hs exch ddef
- iTm
-} def
-/TA
-{
- pop
-} def
-/Tq
-{
- pop
-} def
-/Th
-{
- pop pop pop pop pop
-} def
-/TX
-{
- pop
-} def
-/Tk
-{
- exch pop _fScl mul neg 0 rmoveto
-} def
-/TK
-{
- 2 npop
-} def
-/T*
-{
- _leading aload pop neg Td
-} def
-/T*-
-{
- _leading aload pop Td
-} def
-/T-
-{
- _ax neg 0 rmoveto
- _hyphen Tx
-} def
-/T+
-{
-} def
-/TR
-{
- _ctm currentmatrix pop
- _tm astore pop
- iTm 0 0 moveto
-} def
-/TS
-{
- currentfont 3 1 roll
- /_Symbol_ _fScl 1000 mul selectfont
-
- 0 eq
- {
- Tx
- }
- {
- Tj
- } ifelse
- setfont
-} def
-/Xb
-{
- pop pop
-} def
-/Tb /Xb load def
-/Xe
-{
- pop pop pop pop
-} def
-/Te /Xe load def
-/XB
-{
-} def
-/TB /XB load def
-currentdict readonly pop
-end
-setpacking
-%%EndResource
-%%BeginProcSet: Adobe_ColorImage_AI6 1.0 0
-userdict /Adobe_ColorImage_AI6 known not
-{
- userdict /Adobe_ColorImage_AI6 17 dict put
-} if
-userdict /Adobe_ColorImage_AI6 get begin
-
- /initialize
- {
- Adobe_ColorImage_AI6 begin
- Adobe_ColorImage_AI6
- {
- dup type /arraytype eq
- {
- dup xcheck
- {
- bind
- } if
- } if
- pop pop
- } forall
- } def
- /terminate { end } def
-
- currentdict /Adobe_ColorImage_AI6_Vars known not
- {
- /Adobe_ColorImage_AI6_Vars 14 dict def
- } if
-
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 0 def
- /sourcecount 0 def
- /sourcearray 4 array def
- /plateindex -1 def
- /XIMask 0 def
- /XIBinary 0 def
- /XIChannelCount 0 def
- /XIBitsPerPixel 0 def
- /XIImageHeight 0 def
- /XIImageWidth 0 def
- /XIImageMatrix null def
- /XIBuffer null def
- /XIDataProc null def
- end
-
- /WalkRGBString null def
- /WalkCMYKString null def
-
- /StuffRGBIntoGrayString null def
- /RGBToGrayImageProc null def
- /StuffCMYKIntoGrayString null def
- /CMYKToGrayImageProc null def
- /ColorImageCompositeEmulator null def
-
- /SeparateCMYKImageProc null def
-
- /FourEqual null def
- /TestPlateIndex null def
-
- currentdict /_colorimage known not
- {
- /colorimage where
- {
- /colorimage get /_colorimage exch def
- }
- {
- /_colorimage null def
- } ifelse
- } if
-
- /_currenttransfer systemdict /currenttransfer get def
-
- /colorimage null def
- /XI null def
-
-
- /WalkRGBString
- {
- 0 3 index
-
- dup length 1 sub 0 3 3 -1 roll
- {
- 3 getinterval { } forall
-
- 5 index exec
-
- 3 index
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /WalkCMYKString
- {
- 0 3 index
-
- dup length 1 sub 0 4 3 -1 roll
- {
- 4 getinterval { } forall
-
- 6 index exec
-
- 3 index
-
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /StuffRGBIntoGrayString
- {
- .11 mul exch
-
- .59 mul add exch
-
- .3 mul add
-
- cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /RGBToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 3 idiv string
- dup 3 1 roll
-
- /StuffRGBIntoGrayString load exch
- WalkRGBString
- end
- } def
-
-
- /StuffCMYKIntoGrayString
- {
- exch .11 mul add
-
- exch .59 mul add
-
- exch .3 mul add
-
- dup 255 gt { pop 255 } if
-
- 255 exch sub cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /CMYKToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 4 idiv string
- dup 3 1 roll
-
- /StuffCMYKIntoGrayString load exch
- WalkCMYKString
- end
- } def
-
-
- /ColorImageCompositeEmulator
- {
- pop true eq
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
- }
- {
- Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 3 -1 roll put
-
- channelcount 3 eq
- {
- /RGBToGrayImageProc
- }
- {
- /CMYKToGrayImageProc
- } ifelse
- load
- end
- } if
- image
- } ifelse
- } def
-
-
- /SeparateCMYKImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
-
- sourcecount 0 ne
- {
- sourcearray plateindex get exec
- }
- {
- sourcearray 0 get exec
-
- dup length 4 idiv string
-
- 0 2 index
-
- plateindex 4 2 index length 1 sub
- {
- get 255 exch sub
-
- 3 copy put pop 1 add
-
- 2 index
- } for
-
- pop pop exch pop
- } ifelse
- end
- } def
-
-
- /FourEqual
- {
- 4 index ne
- {
- pop pop pop false
- }
- {
- 4 index ne
- {
- pop pop false
- }
- {
- 4 index ne
- {
- pop false
- }
- {
- 4 index eq
- } ifelse
- } ifelse
- } ifelse
- } def
-
-
- /TestPlateIndex
- {
- Adobe_ColorImage_AI6_Vars begin
- /plateindex -1 def
-
- /setcmykcolor where
- {
- pop
- gsave
- 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
- grestore
-
- 1 0 0 0 FourEqual
- {
- /plateindex 0 def
- }
- {
- 0 1 0 0 FourEqual
- {
- /plateindex 1 def
- }
- {
- 0 0 1 0 FourEqual
- {
- /plateindex 2 def
- }
- {
- 0 0 0 1 FourEqual
- {
- /plateindex 3 def
- }
- {
- 0 0 0 0 FourEqual
- {
- /plateindex 5 def
- } if
- } ifelse
- } ifelse
- } ifelse
- } ifelse
- pop pop pop pop
- } if
- plateindex
- end
- } def
-
-
- /colorimage
- {
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 1 index def
- /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
-
- 4 sourcecount add index dup
- 8 eq exch 1 eq or not
- end
-
- {
- /_colorimage load null ne
- {
- _colorimage
- }
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get
- 7 add { pop } repeat
- } ifelse
- }
- {
- dup 3 eq
- TestPlateIndex
- dup -1 eq exch 5 eq or or
- {
- /_colorimage load null eq
- {
- ColorImageCompositeEmulator
- }
- {
- dup 1 eq
- {
- pop pop image
- }
- {
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- gsave
-
- 0 _currenttransfer exec
- 1 _currenttransfer exec
- eq
- { 0 _currenttransfer exec 0.5 lt }
- { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
-
- { { pop 0 } } { { pop 1 } } ifelse
- systemdict /settransfer get exec
- } if
-
- _colorimage
-
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- grestore
- } if
- } ifelse
- } ifelse
- }
- {
- dup 1 eq
- {
- pop pop
- image
- }
- {
- pop pop
-
- Adobe_ColorImage_AI6_Vars begin
- sourcecount -1 0
- {
- exch sourcearray 3 1 roll put
- } for
-
- /SeparateCMYKImageProc load
- end
-
- systemdict /image get exec
- } ifelse
- } ifelse
- } ifelse
- } def
-
- /XI
- {
- Adobe_ColorImage_AI6_Vars begin
- gsave
- /XIMask exch 0 ne def
- /XIBinary exch 0 ne def
- pop
- pop
- /XIChannelCount exch def
- /XIBitsPerPixel exch def
- /XIImageHeight exch def
- /XIImageWidth exch def
- pop pop pop pop
- /XIImageMatrix exch def
-
- XIBitsPerPixel 1 eq
- {
- XIImageWidth 8 div ceiling cvi
- }
- {
- XIImageWidth XIChannelCount mul
- } ifelse
- /XIBuffer exch string def
-
- XIBinary
- {
- /XIDataProc { currentfile XIBuffer readstring pop } def
- currentfile 128 string readline pop pop
- }
- {
- /XIDataProc { currentfile XIBuffer readhexstring pop } def
- } ifelse
-
- 0 0 moveto
- XIImageMatrix concat
- XIImageWidth XIImageHeight scale
-
- XIMask
- {
- XIImageWidth XIImageHeight
- false
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- /_lp /null ddef
- _fc
- /_lp /imagemask ddef
-
- imagemask
- }
- {
- XIImageWidth XIImageHeight
- XIBitsPerPixel
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- XIChannelCount 1 eq
- {
-
- gsave
- 0 setgray
-
- image
-
- grestore
- }
- {
- false
- XIChannelCount
- colorimage
- } ifelse
- } ifelse
- grestore
- end
- } def
-
-end
-%%EndProcSet
-%%BeginResource: procset Adobe_Illustrator_AI5 1.1 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Full Prolog)
-%%Version: 1.1
-%%CreationDate: (3/7/1994) ()
-%%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_Illustrator_AI5_vars 81 dict dup begin
-put
-/_eo false def
-/_lp /none def
-/_pf
-{
-} def
-/_ps
-{
-} def
-/_psf
-{
-} def
-/_pss
-{
-} def
-/_pjsf
-{
-} def
-/_pjss
-{
-} def
-/_pola 0 def
-/_doClip 0 def
-/cf currentflat def
-/_tm matrix def
-/_renderStart
-[
-/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0
-] def
-/_renderEnd
-[
-null null null null /i1 /i1 /i1 /i1
-] def
-/_render -1 def
-/_rise 0 def
-/_ax 0 def
-/_ay 0 def
-/_cx 0 def
-/_cy 0 def
-/_leading
-[
-0 0
-] def
-/_ctm matrix def
-/_mtx matrix def
-/_sp 16#020 def
-/_hyphen (-) def
-/_fScl 0 def
-/_cnt 0 def
-/_hs 1 def
-/_nativeEncoding 0 def
-/_useNativeEncoding 0 def
-/_tempEncode 0 def
-/_pntr 0 def
-/_tDict 2 dict def
-/_wv 0 def
-/Tx
-{
-} def
-/Tj
-{
-} def
-/CRender
-{
-} def
-/_AI3_savepage
-{
-} def
-/_gf null def
-/_cf 4 array def
-/_if null def
-/_of false def
-/_fc
-{
-} def
-/_gs null def
-/_cs 4 array def
-/_is null def
-/_os false def
-/_sc
-{
-} def
-/_pd 1 dict def
-/_ed 15 dict def
-/_pm matrix def
-/_fm null def
-/_fd null def
-/_fdd null def
-/_sm null def
-/_sd null def
-/_sdd null def
-/_i null def
-/discardSave null def
-/buffer 256 string def
-/beginString null def
-/endString null def
-/endStringLength null def
-/layerCnt 1 def
-/layerCount 1 def
-/perCent (%) 0 get def
-/perCentSeen? false def
-/newBuff null def
-/newBuffButFirst null def
-/newBuffLast null def
-/clipForward? false def
-end
-userdict /Adobe_Illustrator_AI5 known not {
- userdict /Adobe_Illustrator_AI5 91 dict put
-} if
-userdict /Adobe_Illustrator_AI5 get begin
-/initialize
-{
- Adobe_Illustrator_AI5 dup begin
- Adobe_Illustrator_AI5_vars begin
- discardDict
- {
- bind pop pop
- } forall
- dup /nc get begin
- {
- dup xcheck 1 index type /operatortype ne and
- {
- bind
- } if
- pop pop
- } forall
- end
- newpath
-} def
-/terminate
-{
- end
- end
-} def
-/_
-null def
-/ddef
-{
- Adobe_Illustrator_AI5_vars 3 1 roll put
-} def
-/xput
-{
- dup load dup length exch maxlength eq
- {
- dup dup load dup
- length 2 mul dict copy def
- } if
- load begin
- def
- end
-} def
-/npop
-{
- {
- pop
- } repeat
-} def
-/sw
-{
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
-} def
-/swj
-{
- dup 4 1 roll
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
- 6 2 roll /_cnt 0 ddef
- {
- 1 index eq
- {
- /_cnt _cnt 1 add ddef
- } if
- } forall
- pop
- exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop
-} def
-/ss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put pop
- gsave
- false charpath currentpoint
- 4 index setmatrix
- stroke
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 3 npop
-} def
-/jss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- gsave
- _sp eq
- {
- exch 6 index 6 index 6 index 5 -1 roll widthshow
- currentpoint
- }
- {
- false charpath currentpoint
- 4 index setmatrix stroke
- } ifelse
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 6 npop
-} def
-/sp
-{
- {
- 2 npop (0) exch
- 2 copy 0 exch put pop
- false charpath
- 2 copy rmoveto
- } exch cshow
- 2 npop
-} def
-/jsp
-{
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- _sp eq
- {
- exch 5 index 5 index 5 index 5 -1 roll widthshow
- }
- {
- false charpath
- } ifelse
- 2 copy rmoveto
- } exch cshow
- 5 npop
-} def
-/pl
-{
- transform
- 0.25 sub round 0.25 add exch
- 0.25 sub round 0.25 add exch
- itransform
-} def
-/setstrokeadjust where
-{
- pop true setstrokeadjust
- /c
- {
- curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll curveto
- } def
- /V
- /v load def
- /y
- {
- 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- lineto
- } def
- /L
- /l load def
- /m
- {
- moveto
- } def
-}
-{
- /c
- {
- pl curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll pl curveto
- } def
- /V
- /v load def
- /y
- {
- pl 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- pl lineto
- } def
- /L
- /l load def
- /m
- {
- pl moveto
- } def
-} ifelse
-/d
-{
- setdash
-} def
-/cf
-{
-} def
-/i
-{
- dup 0 eq
- {
- pop cf
- } if
- setflat
-} def
-/j
-{
- setlinejoin
-} def
-/J
-{
- setlinecap
-} def
-/M
-{
- setmiterlimit
-} def
-/w
-{
- setlinewidth
-} def
-/XR
-{
- 0 ne
- /_eo exch ddef
-} def
-/H
-{
-} def
-/h
-{
- closepath
-} def
-/N
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- _eo {eoclip} {clip} ifelse /_doClip 0 ddef
- } if
- newpath
- }
- {
- /CRender
- {
- N
- } ddef
- } ifelse
-} def
-/n
-{
- N
-} def
-/F
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc
- /_doClip 0 ddef
- }
- {
- _pf
- } ifelse
- }
- {
- /CRender
- {
- F
- } ddef
- } ifelse
-} def
-/f
-{
- closepath
- F
-} def
-/S
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- _ps
- } ifelse
- }
- {
- /CRender
- {
- S
- } ddef
- } ifelse
-} def
-/s
-{
- closepath
- S
-} def
-/B
-{
- _pola 0 eq
- {
- _doClip 1 eq
- gsave F grestore
- {
- gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- S
- } ifelse
- }
- {
- /CRender
- {
- B
- } ddef
- } ifelse
-} def
-/b
-{
- closepath
- B
-} def
-/W
-{
- /_doClip 1 ddef
-} def
-/*
-{
- count 0 ne
- {
- dup type /stringtype eq
- {
- pop
- } if
- } if
- newpath
-} def
-/u
-{
-} def
-/U
-{
-} def
-/q
-{
- _pola 0 eq
- {
- gsave
- } if
-} def
-/Q
-{
- _pola 0 eq
- {
- grestore
- } if
-} def
-/*u
-{
- _pola 1 add /_pola exch ddef
-} def
-/*U
-{
- _pola 1 sub /_pola exch ddef
- _pola 0 eq
- {
- CRender
- } if
-} def
-/D
-{
- pop
-} def
-/*w
-{
-} def
-/*W
-{
-} def
-/`
-{
- /_i save ddef
- clipForward?
- {
- nulldevice
- } if
- 6 1 roll 4 npop
- concat pop
- userdict begin
- /showpage
- {
- } def
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {pop false setstrokeadjust} if
- newpath
- 0 setgray
- false setoverprint
-} def
-/~
-{
- end
- _i restore
-} def
-/O
-{
- 0 ne
- /_of exch ddef
- /_lp /none ddef
-} def
-/R
-{
- 0 ne
- /_os exch ddef
- /_lp /none ddef
-} def
-/g
-{
- /_gf exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _gf setgray
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/G
-{
- /_gs exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _gs setgray
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/k
-{
- _cf astore pop
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _cf aload pop setcmykcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/K
-{
- _cs astore pop
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _cs aload pop setcmykcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/x
-{
- /_gf exch ddef
- findcmykcustomcolor
- /_if exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _if _gf 1 exch sub setcustomcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/X
-{
- /_gs exch ddef
- findcmykcustomcolor
- /_is exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _is _gs 1 exch sub setcustomcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/A
-{
- pop
-} def
-/annotatepage
-{
-userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse
-} def
-/XT {
- pop pop
-} def
-/discard
-{
- save /discardSave exch store
- discardDict begin
- /endString exch store
- gt38?
- {
- 2 add
- } if
- load
- stopped
- pop
- end
- discardSave restore
-} bind def
-userdict /discardDict 7 dict dup begin
-put
-/pre38Initialize
-{
- /endStringLength endString length store
- /newBuff buffer 0 endStringLength getinterval store
- /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store
- /newBuffLast newBuff endStringLength 1 sub 1 getinterval store
-} def
-/shiftBuffer
-{
- newBuff 0 newBuffButFirst putinterval
- newBuffLast 0
- currentfile read not
- {
- stop
- } if
- put
-} def
-0
-{
- pre38Initialize
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff endString eq
- {
- cleartomark stop
- } if
- shiftBuffer
- } loop
- }
- {
- stop
- } ifelse
-} def
-1
-{
- pre38Initialize
- /beginString exch store
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff beginString eq
- {
- /layerCount dup load 1 add store
- }
- {
- newBuff endString eq
- {
- /layerCount dup load 1 sub store
- layerCount 0 eq
- {
- cleartomark stop
- } if
- } if
- } ifelse
- shiftBuffer
- } loop
- } if
-} def
-2
-{
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- endString eq
- {
- cleartomark stop
- } if
- } loop
-} def
-3
-{
- /beginString exch store
- /layerCnt 1 store
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- dup beginString eq
- {
- pop /layerCnt dup load 1 add store
- }
- {
- endString eq
- {
- layerCnt 1 eq
- {
- cleartomark stop
- }
- {
- /layerCnt dup load 1 sub store
- } ifelse
- } if
- } ifelse
- } loop
-} def
-end
-userdict /clipRenderOff 15 dict dup begin
-put
-{
- /n /N /s /S /f /F /b /B
-}
-{
- {
- _doClip 1 eq
- {
- /_doClip 0 ddef _eo {eoclip} {clip} ifelse
- } if
- newpath
- } def
-} forall
-/Tr /pop load def
-/Bb {} def
-/BB /pop load def
-/Bg {12 npop} def
-/Bm {6 npop} def
-/Bc /Bm load def
-/Bh {4 npop} def
-end
-/Lb
-{
- 4 npop
- 6 1 roll
- pop
- 4 1 roll
- pop pop pop
- 0 eq
- {
- 0 eq
- {
- (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard
- }
- {
-
- /clipForward? true def
-
- /Tx /pop load def
- /Tj /pop load def
-
- currentdict end clipRenderOff begin begin
- } ifelse
- }
- {
- 0 eq
- {
- save /discardSave exch store
- } if
- } ifelse
-} bind def
-/LB
-{
- discardSave dup null ne
- {
- restore
- }
- {
- pop
- clipForward?
- {
- currentdict
- end
- end
- begin
-
- /clipForward? false ddef
- } if
- } ifelse
-} bind def
-/Pb
-{
- pop pop
- 0 (%AI5_EndPalette) discard
-} bind def
-/Np
-{
- 0 (%AI5_End_NonPrinting--) discard
-} bind def
-/Ln /pop load def
-/Ap
-/pop load def
-/Ar
-{
- 72 exch div
- 0 dtransform dup mul exch dup mul add sqrt
- dup 1 lt
- {
- pop 1
- } if
- setflat
-} def
-/Mb
-{
- q
-} def
-/Md
-{
-} def
-/MB
-{
- Q
-} def
-/nc 3 dict def
-nc begin
-/setgray
-{
- pop
-} bind def
-/setcmykcolor
-{
- 4 npop
-} bind def
-/setcustomcolor
-{
- 2 npop
-} bind def
-currentdict readonly pop
-end
-end
-setpacking
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%IncludeFont: Univers
-Adobe_level2_AI5 /initialize get exec
-Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec
-Adobe_ColorImage_AI6 /initialize get exec
-Adobe_Illustrator_AI5 /initialize get exec
-[
-39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
-/Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
-/egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
-/oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
-/udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
-/registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
-/.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
-/.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
-/questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
-/guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
-/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
-/.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
-/fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
-/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
-/Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
-/Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
-/hungarumlaut/ogonek/caron
-TE
-%AI3_BeginEncoding: _Univers Univers
-[/_Univers/Univers 0 0 1 TZ
-%AI3_EndEncoding AdobeType
-%AI5_Begin_NonPrinting
-Np
-8 Bn
-%AI5_BeginGradient: (Black & White)
-(Black & White) 0 2 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Green & Blue)
-(Green & Blue) 0 2 Bd
-[
-<
-99999A9A9B9B9B9C9C9D9D9D9E9E9F9F9FA0A0A1A1A1A2A2A3A3A3A4A4A5A5A5A6A6A7A7A7A8A8A9
-A9A9AAAAABABABACACADADADAEAEAFAFAFB0B0B1B1B1B2B2B3B3B3B4B4B5B5B5B6B6B7B7B7B8B8B9
-B9B9BABABBBBBBBCBCBDBDBDBEBEBFBFBFC0C0C1C1C1C2C2C3C3C3C4C4C5C5C5C6C6C7C7C7C8C8C9
-C9C9CACACBCBCBCCCCCDCDCDCECECFCFCFD0D0D1D1D1D2D2D3D3D3D4D4D5D5D5D6D6D7D7D7D8D8D9
-D9D9DADADBDBDBDCDCDDDDDDDEDEDFDFDFE0E0E1E1E1E2E2E3E3E3E4E4E5E5E5E6E6E7E7E7E8E8E9
-E9E9EAEAEBEBEBECECEDEDEDEEEEEFEFEFF0F0F1F1F1F2F2F3F3F3F4F4F5F5F5F6F6F7F7F7F8F8F9
-F9F9FAFAFBFBFBFCFCFDFDFDFEFEFFFF
->
-<
-000102020304050506070808090A0B0B0C0D0E0E0F101111121314141516171718191A1A1B1C1D1D
-1E1F20202122232324252626272829292A2B2C2C2D2E2F2F303132323334353536373838393A3B3B
-3C3D3E3E3F404141424344444546474748494A4A4B4C4D4D4E4F5050515253535455565657585959
-5A5B5C5C5D5E5F5F606162626364656566676868696A6B6B6C6D6E6E6F7071717273747475767777
-78797A7A7B7C7D7D7E7F80808182828384858586878888898A8B8B8C8D8E8E8F9091919293949495
-96979798999A9A9B9C9D9D9E9FA0A0A1A2A3A3A4A5A6A6A7A8A9A9AAABACACADAEAFAFB0B1B2B2B3
-B4B5B5B6B7B8B8B9BABBBBBCBDBEBEBF
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-[
-1 0.75 0 0 1 50 100 %_Bs
-0.6 0 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Pink, Yellow, Green)
-(Pink, Yellow, Green) 0 3 Bd
-[
-<
-00000000000000000000000000000000000000010101010101010101010101010101010101010101
-01010101010202020202020202020202020202020202020202020203030303030303030303030303
-03030303030303030404040404040404040404040404040404040404050505050505050505050505
-05050505050505060606060606060606060606060606060606060707070707070707070707070707
-07070707080808080808080808080808080808080809090909090909090909090909090909090A0A
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0C
-0C0C0C0C0C0C0C0D0D0D0D0D
->
-<
-050506060606070708080809090A0A0A0B0B0C0C0D0D0E0E0F0F1010111112121313141415151617
-17181819191A1A1B1C1C1D1D1E1F1F202021222223232425252626272828292A2A2B2C2C2D2D2E2F
-2F3031313233333435353637373839393A3B3B3C3D3E3E3F4040414242434445454647474849494A
-4B4C4C4D4E4F4F505151525354545556575758595A5A5B5C5C5D5E5F5F6061626363646566666768
-69696A6B6C6C6D6E6F707071727373747576777778797A7B7B7C7D7E7F7F80818283838485868787
-88898A8B8B8C8D8E8F8F9091929394949596979898999A9B9C9D9D9E9FA0A1A2A2A3A4A5A6A7A7A8
-A9AAABACADADAEAFB0B1B2B2
->
-<
-CCCCCBCBCBCACACAC9C9C8C8C7C7C6C6C5C5C4C4C3C2C2C1C1C0C0BFBEBEBDBDBCBBBBBAB9B9B8B7
-B7B6B6B5B4B4B3B2B1B1B0AFAFAEADADACABAAAAA9A8A8A7A6A5A5A4A3A2A2A1A0A09F9E9D9C9C9B
-9A999998979696959493929291908F8E8E8D8C8B8A8A8988878686858483828181807F7E7D7C7C7B
-7A7978777776757473727171706F6E6D6C6B6A6A69686766656463636261605F5E5D5C5B5B5A5958
-5756555453525151504F4E4D4C4B4A49484746464544434241403F3E3D3C3B3A3938383736353433
-3231302F2E2D2C2B2A29282726252423222221201F1E1D1C1B1A191817161514131211100F0E0D0C
-0B0A09080706050403020100
->
-0
-1 %_Br
-<
-737271706F6E6D6C6B6A696867666564636261605F5E5D5C5B5B5A59585756555453525150504F4E
-4D4C4B4A4949484746454443434241403F3E3E3D3C3B3A3A393837363635343333323130302F2E2D
-2D2C2B2A2A29282827262525242323222121201F1F1E1D1D1C1C1B1A1A1918181717161615141413
-1312121111100F0F0E0E0D0D0C0C0C0B0B0A0A090908080807070606060505050404040303030202
-020201010101010000000000
->
-<
-00000000000000000000000001010101010101010101010101010101010101010101010102020202
-02020202020202020202020202020202020202020202030303030303030303030303030303030303
-03030303030303030303030303040404040404040404040404040404040404040404040404040404
-04040404040404040404050505050505050505050505050505050505050505050505050505050505
-050505050505050505050505
->
-<
-BFBFBFC0C0C0C0C0C0C0C0C0C1C1C1C1C1C1C1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C3C3
-C3C4C4C4C4C4C4C4C4C4C4C5C5C5C5C5C5C5C5C5C5C5C6C6C6C6C6C6C6C6C6C6C6C6C7C7C7C7C7C7
-C7C7C7C7C7C7C8C8C8C8C8C8C8C8C8C8C8C8C8C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9CACACACACACA
-CACACACACACACACACACACBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCCCCCCCCCCCCCCCC
-CCCCCCCCCCCCCCCCCCCCCCCC
->
-0
-1 %_Br
-[
-0.05 0.7 0 0 1 50 100 %_Bs
-0 0.02 0.8 0 1 57 36 %_Bs
-0.45 0 0.75 0 1 37 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Purple, Red & Yellow)
-(Purple, Red & Yellow) 0 3 Bd
-[
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A
->
-<
-CCCCCCCDCDCDCDCDCECECECECECFCFCFCFD0D0D0D0D0D1D1D1D1D1D2D2D2D2D2D3D3D3D3D3D4D4D4
-D4D5D5D5D5D5D6D6D6D6D6D7D7D7D7D7D8D8D8D8D8D9D9D9D9DADADADADADBDBDBDBDBDCDCDCDCDC
-DDDDDDDDDDDEDEDEDEDFDFDFDFDFE0E0E0E0E0E1E1E1E1E1E2E2E2E2E2E3E3E3E3E4E4E4E4E4E5E5
-E5E5E5E6E6E6E6E6E7E7E7E7E7E8E8E8E8E9E9E9E9E9EAEAEAEAEAEBEBEBEBEBECECECECECEDEDED
-EDEEEEEEEEEEEFEFEFEFEFF0F0F0F0F0F1F1F1F1F1F2F2F2F2F3F3F3F3F3F4F4F4F4F4F5F5F5F5F5
-F6F6F6F6F6F7F7F7F7F8F8F8F8F8F9F9F9F9F9FAFAFAFAFAFBFBFBFBFBFCFCFCFCFDFDFDFDFDFEFE
-FEFEFEFFFFFF
->
-0
-1 %_Br
-<
-E5E4E3E2E1E0DFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBE
-BDBCBBBAB9B8B7B6B5B4B3B2B1B0AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A99989796
-9594939291908F8E8D8C8B8A898887868584838281807F7E7D7C7B7A797877767574737271706F6E
-6D6C6B6A696867666564636261605F5E5D5C5B5A595857565554535251504F4E4D4C4B4A49484746
-4544434241403F3E3D3C3B3A393837363534333231302F2E2D2C2B2A292827262524232221201F1E
-1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
->
-<
-E5E6E6E6E6E6E6E6E6E7E7E7E7E7E7E7E7E7E8E8E8E8E8E8E8E8E8E9E9E9E9E9E9E9E9E9EAEAEAEA
-EAEAEAEAEAEBEBEBEBEBEBEBEBEBECECECECECECECECECEDEDEDEDEDEDEDEDEDEEEEEEEEEEEEEEEE
-EEEFEFEFEFEFEFEFEFEFF0F0F0F0F0F0F0F0F0F1F1F1F1F1F1F1F1F1F2F2F2F2F2F2F2F2F2F3F3F3
-F3F3F3F3F3F3F4F4F4F4F4F4F4F4F4F5F5F5F5F5F5F5F5F5F6F6F6F6F6F6F6F6F6F7F7F7F7F7F7F7
-F7F7F8F8F8F8F8F8F8F8F8F9F9F9F9F9F9F9F9F9FAFAFAFAFAFAFAFAFAFBFBFBFBFBFBFBFBFBFCFC
-FCFCFCFCFCFCFCFDFDFDFDFDFDFDFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFF
->
-<
-00010203040405060708090A0B0C0C0D0E0F10111213141415161718191A1B1C1D1D1E1F20212223
-242525262728292A2B2C2D2D2E2F30313233343535363738393A3B3C3D3D3E3F4041424344454546
-4748494A4B4C4D4E4E4F50515253545556565758595A5B5C5D5E5E5F60616263646566666768696A
-6B6C6D6E6E6F70717273747576767778797A7B7C7D7E7F7F80818283848586878788898A8B8C8D8E
-8F8F90919293949596979798999A9B9C9D9E9F9FA0A1A2A3A4A5A6A7A7A8A9AAABACADAEAFAFB0B1
-B2B3B4B5B6B7B8B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C8C9CACBCC
->
-0
-1 %_Br
-[
-0 0.04 1 0 1 50 100 %_Bs
-0 1 0.8 0 1 50 50 %_Bs
-0.9 0.9 0 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Rainbow)
-(Rainbow) 0 6 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-0
-1 %_Br
-1
-<
-0708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E
-2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556
-5758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E
-7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6
-A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCE
-CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6
-F7F8F9FAFBFCFDFEFF
->
-0
-0
-1 %_Br
-1
-<
-00000000000000000000000000000000000001010101010101010101010101010101010101010101
-01010101010101010101010101010202020202020202020202020202020202020202020202020202
-02020202020202020202030303030303030303030303030303030303030303030303030303030303
-03030303030304040404040404040404040404040404040404040404040404040404040404040404
-04040505050505050505050505050505050505050505050505050505050505050505050505050606
-06060606060606060606060606060606060606060606060606060606060606060606070707070707
-07070707070707070707070707070707
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0
-1
-0
-1 %_Br
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-1 %_Br
-[
-0 1 0 0 1 50 100 %_Bs
-1 1 0 0 1 50 80 %_Bs
-1 0.0279 0 0 1 50 60 %_Bs
-1 0 1 0 1 50 40 %_Bs
-0 0 1 0 1 50 20 %_Bs
-0 1 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Steel Bar)
-(Steel Bar) 0 3 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 70 %_Bs
-0 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Orange Radial)
-(Yellow & Orange Radial) 1 2 Bd
-[
-0
-<
-0001010203040506060708090A0B0C0C0D0E0F10111213131415161718191A1B1C1D1D1E1F202122
-232425262728292A2B2B2C2D2E2F303132333435363738393A3B3C3D3E3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60606162636465666768696A6B6C6D6E6F
-707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C
->
-<
-FFFFFFFFFEFEFEFEFEFEFEFDFDFDFDFDFDFCFCFCFCFCFCFBFBFBFBFBFBFAFAFAFAFAFAF9F9F9F9F9
-F9F8F8F8F8F8F8F7F7F7F7F7F7F6F6F6F6F6F6F5F5F5F5F5F5F4F4F4F4F4F3F3F3F3F3F3F2F2F2F2
-F2F2F1F1F1F1F1F0F0F0F0F0F0EFEFEFEFEFEFEEEEEEEEEEEDEDEDEDEDEDECECECECECEBEBEBEBEB
-EBEAEAEAEAEAE9E9E9E9E9E9E8E8E8E8E8E8E7E7E7E7E7E6E6E6E6E6E5
->
-0
-1 %_Br
-[
-0 0 1 0 1 52 19 %_Bs
-0 0.55 0.9 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Purple Radial)
-(Yellow & Purple Radial) 1 2 Bd
-[
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-<
-1415161718191A1B1C1D1E1F1F202122232425262728292A2A2B2C2D2E2F30313233343536363738
-393A3B3C3D3E3F40414142434445464748494A4B4C4D4D4E4F50515253545556575858595A5B5C5D
-5E5F60616263646465666768696A6B6C6D6E6F6F707172737475767778797A7B7B7C7D7E7F808182
-83848586868788898A8B8C8D8E8F90919292939495969798999A9B9C9D9D9E9FA0A1A2A3A4A5A6A7
-A8A9A9AAABACADAEAFB0B1B2B3B4B4B5B6B7B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C9CACBCB
-CCCDCECFD0D1D2D3D4D5D6D7D7D8D9DADBDCDDDEDFE0E1E2E2E3E4E5E6E7E8E9EAEBECEDEEEEEFF0
-F1F2F3F4F5F6F7F8F9F9FAFBFCFDFEFF
->
-<
-ABAAAAA9A8A7A7A6A5A5A4A3A3A2A1A1A09F9F9E9D9D9C9B9B9A9999989797969595949393929191
-908F8F8E8D8D8C8B8B8A8989888787868585848383828181807F7F7E7D7D7C7B7B7A797978777776
-7575747373727171706F6F6E6D6D6C6B6B6A6969686767666565646362626160605F5E5E5D5C5C5B
-5A5A5958585756565554545352525150504F4E4E4D4C4C4B4A4A4948484746464544444342424140
-403F3E3E3D3C3C3B3A3A3938383736363534343332323130302F2E2E2D2C2C2B2A2A292828272626
-25242423222121201F1F1E1D1D1C1B1B1A1919181717161515141313121111100F0F0E0D0D0C0B0B
-0A090908070706050504030302010100
->
-0
-1 %_Br
-[
-0 0.08 0.67 0 1 50 14 %_Bs
-1 1 0 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_End_NonPrinting--
-%AI5_BeginPalette
-0 2 Pb
-Pn
-Pc
-1 g
-Pc
-0 g
-Pc
-0 0 0 0 k
-Pc
-0.75 g
-Pc
-0.5 g
-Pc
-0.25 g
-Pc
-0 g
-Pc
-Bb
-2 (Black & White) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0 0 0 k
-Pc
-0.5 0 0 0 k
-Pc
-0.75 0 0 0 k
-Pc
-1 0 0 0 k
-Pc
-0.25 0.25 0 0 k
-Pc
-0.5 0.5 0 0 k
-Pc
-0.75 0.75 0 0 k
-Pc
-1 1 0 0 k
-Pc
-Bb
-2 (Pink, Yellow, Green) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0 0 k
-Pc
-0 0.5 0 0 k
-Pc
-0 0.75 0 0 k
-Pc
-0 1 0 0 k
-Pc
-0 0.25 0.25 0 k
-Pc
-0 0.5 0.5 0 k
-Pc
-0 0.75 0.75 0 k
-Pc
-0 1 1 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Purple Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0 0.25 0 k
-Pc
-0 0 0.5 0 k
-Pc
-0 0 0.75 0 k
-Pc
-0 0 1 0 k
-Pc
-0.25 0 0.25 0 k
-Pc
-0.5 0 0.5 0 k
-Pc
-0.75 0 0.75 0 k
-Pc
-1 0 1 0 k
-Pc
-Bb
-2 (Rainbow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0 0 k
-Pc
-0.5 0.25 0 0 k
-Pc
-0.75 0.375 0 0 k
-Pc
-1 0.5 0 0 k
-Pc
-0.125 0.25 0 0 k
-Pc
-0.25 0.5 0 0 k
-Pc
-0.375 0.75 0 0 k
-Pc
-0.5 1 0 0 k
-Pc
-Bb
-2 (Steel Bar) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0.125 0 k
-Pc
-0 0.5 0.25 0 k
-Pc
-0 0.75 0.375 0 k
-Pc
-0 1 0.5 0 k
-Pc
-0 0.125 0.25 0 k
-Pc
-0 0.25 0.5 0 k
-Pc
-0 0.375 0.75 0 k
-Pc
-0 0.5 1 0 k
-Pc
-Bb
-2 (Purple, Red & Yellow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0 0.25 0 k
-Pc
-0.25 0 0.5 0 k
-Pc
-0.375 0 0.75 0 k
-Pc
-0.5 0 1 0 k
-Pc
-0.25 0 0.125 0 k
-Pc
-0.5 0 0.25 0 k
-Pc
-0.75 0 0.375 0 k
-Pc
-1 0 0.5 0 k
-Pc
-Bb
-2 (Green & Blue) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0.125 0 k
-Pc
-0.5 0.25 0.25 0 k
-Pc
-0.75 0.375 0.375 0 k
-Pc
-1 0.5 0.5 0 k
-Pc
-0.25 0.25 0.125 0 k
-Pc
-0.5 0.5 0.25 0 k
-Pc
-0.75 0.75 0.375 0 k
-Pc
-1 1 0.5 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Orange Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0.25 0.125 0 k
-Pc
-0.25 0.5 0.25 0 k
-Pc
-0.375 0.75 0.375 0 k
-Pc
-0.5 1 0.5 0 k
-Pc
-0.125 0.25 0.25 0 k
-Pc
-0.25 0.5 0.5 0 k
-Pc
-0.375 0.75 0.75 0 k
-Pc
-0.5 1 1 0 k
-Pc
-0 0 0 0 k
-Pc
-0.125 0.125 0.25 0 k
-Pc
-0.25 0.25 0.5 0 k
-Pc
-0.375 0.375 0.75 0 k
-Pc
-0.5 0.5 1 0 k
-Pc
-0.25 0.125 0.25 0 k
-Pc
-0.5 0.25 0.5 0 k
-Pc
-0.75 0.375 0.75 0 k
-Pc
-1 0.5 1 0 k
-Pc
-PB
-%AI5_EndPalette
-%%EndSetup
-%AI5_BeginLayer
-1 1 1 1 0 0 0 79 128 255 Lb
-(Layer 1) Ln
-0 A
-800 Ar
-0 J 0 j 1 w 4 M []0 d
-%AI3_Note:
-0 D
-0 XR
--4014 283.5 m
-4626 283.5 L
-(N) *
-453.5 4716 m
-453.5 -3924 L
-(N) *
-85 4716 m
-85 -3924 L
-(N) *
--4014 765.5 m
-4626 765.5 L
-(N) *
-0 R
-0 G
-113 683.5 m
-439 683.5 l
-S
-113 663.5 m
-439 663.5 l
-S
-113 643.5 m
-439 643.5 l
-S
-113 686 m
-439 686 l
-S
-1 Ap
-439 624 m
-439 709 L
-113 709 L
-113 624 L
-439 624 L
-s
-0 Ap
-178.5 709 m
-178.5 624 l
-S
-243 709 m
-243 624 l
-S
-374 709 m
-374 624 l
-S
-308.5 709 m
-308.5 624 l
-S
-0 To
-1 0 0 1 146 692 0 Tp
-TP
--12.2278 0 Td
-0 Tr
-0 O
-0 g
-/_Univers 10 Tf
-0 Ts
-100 Tz
-0 Tt
-1 TA
-%_ 0 XL
-36 0 Xb
-XB
-0 0 5 TC
-100 100 200 TW
-0 0 0 Ti
-1 Ta
-0 0 2 2 3 Th
-0 Tq
-0 0 Tl
-0 Tc
-0 Tw
-(key 1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 213 692 0 Tp
-TP
--12.2278 0 Td
-0 Tr
-(key 2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 276 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 3) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 225.5 747.5 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 336.5 693.5 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 341 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 4) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 407.5 692 0 Tp
-TP
--11.1121 0 Td
-0 Tr
-(col 5) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 185.5 736 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-0 To
-1 0 0 1 145 669.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 144.5 650.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 145 630 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 669 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 649.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 209.5 629.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 669 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(a) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 649.5 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(d) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 274.5 629.5 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(g) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 669 0 Tp
-TP
--3.0542 0 Td
-0 Tr
-(b) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 649.5 0 Tp
-TP
--2.7795 0 Td
-0 Tr
-(e) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 340 629.5 0 Tp
-TP
--8.8879 0 Td
-0 Tr
-(N/A) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 669 0 Tp
-TP
--2.5 0 Td
-0 Tr
-(c) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 649.5 0 Tp
-TP
--1.6638 0 Td
-0 Tr
-(f) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 405 629.5 0 Tp
-TP
--1.3892 0 Td
-0 Tr
-(i) Tx
-(\r) TX
-TO
-u
-1 Ap
-0 R
-0 G
-274.4998 643.4963 m
-279.1963 643.4963 283.0037 647.3037 283.0037 652.0002 c
-283.0037 656.6968 279.1963 660.5042 274.4998 660.5042 c
-269.8032 660.5042 265.9958 656.6968 265.9958 652.0002 c
-265.9958 647.3037 269.8032 643.4963 274.4998 643.4963 c
-s
-[3 4 3 4 3 4 ]0 d
-274.4998 623.9963 m
-279.1963 623.9963 283.0037 627.8037 283.0037 632.5002 c
-283.0037 637.1968 279.1963 641.0042 274.4998 641.0042 c
-269.8032 641.0042 265.9958 637.1968 265.9958 632.5002 c
-265.9958 627.8037 269.8032 623.9963 274.4998 623.9963 c
-s
-u
-u
-0 Ap
-[]0 d
-265.9958 652.0002 m
-251 652 250.5 642.5 v
-250.1312 635.4919 257.5 633.5 y
-S
-0 O
-0 g
-260.0476 633.873 m
-258.5818 634.7863 257.6645 635.5108 256.5229 636.3709 c
-255.2066 631.5014 l
-255.7237 631.5949 257.7835 631.833 259.5097 631.8831 c
-261.3573 631.9376 263.0016 631.8718 264.0403 631.7262 c
-263.0697 632.1237 261.6162 632.8953 260.0476 633.873 c
-f
-U
-U
-U
-1 Ap
-0 R
-0 G
-339.9998 643.4963 m
-344.6963 643.4963 348.5037 647.3037 348.5037 652.0002 c
-348.5037 656.6968 344.6963 660.5042 339.9998 660.5042 c
-335.3032 660.5042 331.4958 656.6968 331.4958 652.0002 c
-331.4958 647.3037 335.3032 643.4963 339.9998 643.4963 c
-s
-[3 4 3 4 3 4 ]0 d
-404.9998 663.4963 m
-409.6963 663.4963 413.5037 667.3037 413.5037 672.0002 c
-413.5037 676.6968 409.6963 680.5042 404.9998 680.5042 c
-400.3032 680.5042 396.4958 676.6968 396.4958 672.0002 c
-396.4958 667.3037 400.3032 663.4963 404.9998 663.4963 c
-s
-u
-u
-u
-u
-u
-0 Ap
-[]0 d
-331.4958 652.0002 m
-305.5 617.5 323 607.5 v
-338.4597 598.6658 363 623 377 643 c
-383.7965 652.7091 392.5 660 y
-S
-0 O
-0 g
-393.6525 662.3024 m
-392.0646 661.6234 390.9454 661.286 389.5867 660.8423 c
-392.8259 656.9755 l
-393.0452 657.453 394.0292 659.2782 394.9762 660.7223 c
-395.9892 662.2684 396.9844 663.579 397.6983 664.3473 c
-396.8168 663.779 395.3521 663.0289 393.6525 662.3024 c
-f
-U
-U
-U
-U
-U
-LB
-%AI5_EndLayer--
-%%PageTrailer
-gsave annotatepage grestore showpage
-%%Trailer
-Adobe_Illustrator_AI5 /terminate get exec
-Adobe_ColorImage_AI6 /terminate get exec
-Adobe_typography_AI5 /terminate get exec
-Adobe_level2_AI5 /terminate get exec
-%%EOF
diff --git a/lib/snmp/doc/src/index.html.src b/lib/snmp/doc/src/index.html.src
index 7ad2140559..e1b6be4d1f 100644
--- a/lib/snmp/doc/src/index.html.src
+++ b/lib/snmp/doc/src/index.html.src
@@ -2,16 +2,17 @@
<!-- This file is obsolete -->
<HTML>
<!--
- ``The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved via the world wide web at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ ``Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
The Initial Developer of the Original Code is Ericsson Utvecklings AB.
Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml
index 9d9aa02d72..3323d32878 100644
--- a/lib/snmp/doc/src/notes.xml
+++ b/lib/snmp/doc/src/notes.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -33,64 +34,410 @@
</header>
- <section>
- <title>SNMP Development Toolkit 4.22.3</title>
- <p>Version 4.22.3 supports code replacement in runtime from/to
- version 4.22.2, 4.22.1, 4.22,
- 4.21.7 4.21.6 4.21.5, 4.21.4, 4.21.3, 4.21.2, 4.21.1 and 4.21. </p>
+ <section><title>SNMP 5.2.4</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p> Correct bugs when path to mib or idl spec files
+ contains UTF-8 characters. </p>
+ <p>
+ Own Id: OTP-13718 Aux Id: ERL-179 </p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Solves snmp config string handling as reported by ERL-164
+ and solved by PR-1100</p>
+ <p>
+ Own Id: OTP-13706</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SNMP 5.2.3</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Internal changes</p>
+ <p>
+ Own Id: OTP-13551</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SNMP 5.2.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Snmp agent now properly handles <c>vacmViewTreeFamily</c>
+ masks.</p>
+ <p>
+ Own Id: OTP-13264</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SNMP 5.2.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Small documentation fixes</p>
+ <p>
+ Own Id: OTP-13017</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Update configuration check of imask ( list of ones and
+ zeros) to allow the empty list.</p>
+ <p>
+ Own Id: OTP-13101</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SNMP 5.2</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p> The runtime dependencies in the application resource
+ file have been updated. </p>
+ <p>
+ Own Id: OTP-12762</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SNMP 5.1.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ A bug in the SNMP Agent has been corrected; when opening
+ a port using the command line argument -snmpa_fd the Port
+ should be 0 when calling gen_udp:open.</p>
+ <p>
+ A bug in the SNMP manager has been corrected; it should
+ not look at the -snmp_fd command line argument, but
+ instead at -snmpm_fd.</p>
+ <p>
+ Own Id: OTP-12669 Aux Id: seq12841 </p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Improved cryptocraphic capability.</p>
+ <p>
+ Own Id: OTP-12452</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section>
+ <title>SNMP Development Toolkit 5.1.1</title>
+ <p>Version 5.1.1 supports code replacement in runtime from/to
+ version 5.1. </p>
<section>
<title>Improvements and new features</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[compiler] Refinement of type Opaque was not allowed. </p>
+ <p>MIB constructs such as '<c>SYNTAX Opaque (SIZE(0..65535))</c>'
+ was previously not allowed,
+ see the standard <c>ALARM-MIB</c> for eaxmple. </p>
+ <p>Own Id: OTP-12066</p>
+ <p>Aux Id: Seq 12669</p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
<p>-</p>
<!--
<list type="bulleted">
<item>
- <p>[agent] Errors in <c>vacmAccessTable</c> RowStatus handling.
- There are problems with the handling of vacmAccessTableStatus
- that cause some SNMP test suites to report errors.
- Most notably, erroneous set operations frequently cause "genErr"
- errors to be returned. These "genErr" errors are usually caused
- by badmatch exceptions coming from
- <c>{ok, Row} = snmpa_vacm:get_row(RowIndex)</c>
- if the row does not exist. </p>
- <p>The semantics of the RowStatus handling in that table has
- been adjusted to be compliant with the RowStatus
- textual description of SNPMv2-TC MIB. </p>
- <p>Stefan Zegenhagen</p>
- <p>Own Id: OTP-10164</p>
+ <p>[agent]
+ see <seealso marker="snmpa#load_mibs">load_mibs</seealso> and
+ <seealso marker="snmpa#unload_mibs">unload_mibs</seealso>. </p>
+ <p>Own Id: OTP-11216</p>
+ </item>
+
+ </list>
+-->
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[manager] The old Addr-and-Port based API functions, previously
+ long deprecated and marked for deletion in R16B, has now been
+ removed. </p>
+ <p>Own Id: OTP-10027</p>
+ </item>
+
+ </list>
+-->
+ </section>
+ </section> <!-- 5.1.1 -->
+
+
+
+ <section><title>SNMP 5.1</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ The SNMP manager has been enhanced with dual stack
+ IPv4+IPv6, as the agent just was. The documentation is
+ also now updated for both the agent and the manager.</p>
+ <p>
+ Own Id: OTP-12108 Aux Id: OTP-12020 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SNMP 5.0</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ SNMP has been improved to handle IPv6. The agent can
+ handle dual stack IPv4 + IPv6, but not yet the manager.
+ The documentation also still lags behind... If you do
+ such advanced stuff like writing a custom net_if module,
+ the interface for it has changed, but other than that
+ SNMP is backwards compatible.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-12020 Aux Id: OTP-11518 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SNMP 4.25.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Application upgrade (appup) files are corrected for the
+ following applications: </p>
+ <p>
+ <c>asn1, common_test, compiler, crypto, debugger,
+ dialyzer, edoc, eldap, erl_docgen, et, eunit, gs, hipe,
+ inets, observer, odbc, os_mon, otp_mibs, parsetools,
+ percept, public_key, reltool, runtime_tools, ssh,
+ syntax_tools, test_server, tools, typer, webtool, wx,
+ xmerl</c></p>
+ <p>
+ A new test utility for testing appup files is added to
+ test_server. This is now used by most applications in
+ OTP.</p>
+ <p>
+ (Thanks to Tobias Schlager)</p>
+ <p>
+ Own Id: OTP-11744</p>
</item>
</list>
+ </section>
+
+</section>
+
+<section>
+ <title>SNMP Development Toolkit 4.25.0.1</title>
+ <p>Version 4.25.0.1 supports code replacement in runtime from/to
+ version 4.25, 4.24.2, 4.24.1 and 4.24. </p>
+
+ <section>
+ <title>Improvements and new features</title>
+<!--
+ <p>-</p>
-->
+ <list type="bulleted">
+ <item>
+ <p>Updated doc files to utf8. </p>
+ <p>Own Id: OTP-10907</p>
+ </item>
+
+ <item>
+ <p>Fixed test suite to support UTF-8 paths. </p>
+ <p>Own Id: OTP-10877</p>
+ </item>
+
+ </list>
+
</section>
<section>
<title>Fixed Bugs and Malfunctions</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>Wrong block cypher type used for AES ('aes_cbf128'
+ instead of 'aes_cfb128') when performing AES block
+ encrypt/decrypt which breaks SNMP usmAesCfb128Protocol
+ in agent and manager. </p>
+ <p>Own Id: OTP-11412</p>
+ </item>
+
+ <item>
+ <p>[manager] When performing the AES encryption, invalid values for
+ the EngineBoots and EngineTime was used. </p>
+ <p>The values of the local agent was used, which would have produced
+ "some" values if an agent was actually running.
+ If not it would have caused a crash. </p>
+ <p>Own Id: OTP-11413</p>
+ </item>
+
+ </list>
+-->
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[manager] The old Addr-and-Port based API functions, previously
+ long deprecated and marked for deletion in R16B, has now been
+ removed. </p>
+ <p>Own Id: OTP-10027</p>
+ </item>
+
+ </list>
+-->
+ </section>
+
+ </section> <!-- 4.25.0.1 -->
+
+
+ <section>
+ <title>SNMP Development Toolkit 4.25</title>
+ <p>Version 4.25 supports code replacement in runtime from/to
+ version 4.24.2, 4.24.1, 4.24, 4.23.1 and 4.23. </p>
+
+ <section>
+ <title>Improvements and new features</title>
<!--
<p>-</p>
-->
<list type="bulleted">
- <item>
- <p>Loosing log entries when converting a large Audit Trail Log. </p>
- <p>When converting an entire Audit Trail Log in a running
- system its possble to have log wraps and thereby loosing log
- entries. </p>
- <p>In order to prevent this the log is now blocked
- during conversion (<c>log_to_txt</c> or <c>log_to_io</c>). </p>
- <p>Own Id: OTP-11396</p>
- <p>Own Id: seq12433</p>
+ <item>
+ <p>[agent] Enable SNMP to create missing database directories. </p>
+ <p>Add
+ <seealso marker="snmp_app#db_init_error">
+ {db_init_error, create_db_and_dir}</seealso> option to SNMP
+ <seealso marker="snmp_app#manager_opts_and_types">manager</seealso>
+ and
+ <seealso marker="snmp_app#agent_opts_and_types">agent</seealso>.
+ This allows them to create any missing parent directories for
+ <c>db_dir</c>, rather than treating any missing directories
+ as a fatal error.
+ The default for <c>db_init_error</c>, which is <c>terminate</c>,
+ is unchanged. </p>
+ <p>Steve Vinoski</p>
+ <p>Own Id: OTP-11352</p>
</item>
<item>
- <p>When converting the Audit Trail Log to text a corrupt
+ <p>[manager] Improved handling of unexpected return values from
+ <seealso marker="snmpm_user">snmpm_user</seealso>
+ callback functions. </p>
+ <p>Violations of the documented API (crashes or invalid return
+ values) will now result in an error message. </p>
+ <p>Own Id: OTP-11307</p>
+ </item>
+
+ <item>
+ <p>Add (atl) log conversion block option. </p>
+ <p>It is now possible to request that the Audit Trail Log should
+ be blocked during conversion (<c>log_to_txt</c> or <c>log_to_io</c>).
+ This could be usefull when coverting an entire large log (when
+ there is a chance it may otherwise wrap during conversion). </p>
+ <p>See
+ agent
+ <seealso marker="snmpa#log_to_txt">log_to_txt</seealso> and
+ <seealso marker="snmpa#log_to_io">log_to_io</seealso> and also
+ manager
+ <seealso marker="snmpm#log_to_txt">log_to_txt</seealso> and
+ <seealso marker="snmpm#log_to_io">log_to_io</seealso>
+ for details. </p>
+ <p>Own Id: OTP-11396</p>
+ <p>Own Id: seq12433</p>
+ </item>
+
+ <item>
+ <p>When converting an Audit Trail Log to text, a corrupt
log entry could cause the entire conversion to fail. </p>
<p>Also, for a log with sequence numbers, failing to
decode a log entry would cause the conversion to fail
(not because of the failed decode, but because of the
failure to write the error message). </p>
- <p>Own Id: OTP-11453</p>
+ <p>Own Id: OTP-111453</p>
<p>Aux Id: Seq 12459</p>
</item>
@@ -99,18 +446,286 @@
</section>
<section>
+ <title>Fixed Bugs and Malfunctions</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>Wrong block cypher type used for AES ('aes_cbf128'
+ instead of 'aes_cfb128') when performing AES block
+ encrypt/decrypt which breaks SNMP usmAesCfb128Protocol
+ in agent and manager. </p>
+ <p>Own Id: OTP-11412</p>
+ </item>
+
+ <item>
+ <p>[manager] When performing the AES encryption, invalid values for
+ the EngineBoots and EngineTime was used. </p>
+ <p>The values of the local agent was used, which would have produced
+ "some" values if an agent was actually running.
+ If not it would have caused a crash. </p>
+ <p>Own Id: OTP-11413</p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section>
<title>Incompatibilities</title>
<p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[manager] The old Addr-and-Port based API functions, previously
+ long deprecated and marked for deletion in R16B, has now been
+ removed. </p>
+ <p>Own Id: OTP-10027</p>
+ </item>
+
+ </list>
+-->
</section>
- </section> <!-- 4.22.3 -->
+ </section> <!-- 4.25 -->
<section>
- <title>SNMP Development Toolkit 4.22.2</title>
- <p>Version 4.22.2 supports code replacement in runtime from/to
- version 4.22.1, 4.22,
- 4.21.7 4.21.6 4.21.5, 4.21.4, 4.21.3, 4.21.2, 4.21.1 and 4.21. </p>
+ <title>SNMP Development Toolkit 4.24.2</title>
+ <p>Version 4.24.2 supports code replacement in runtime from/to
+ version 4.24.1, 4.24, 4.23.1 and 4.23. </p>
+
+ <section>
+ <title>Improvements and new features</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[agent] Improved documentation for the functions for
+ loading and unloading mibs,
+ see <seealso marker="snmpa#load_mibs">load_mibs</seealso> and
+ <seealso marker="snmpa#unload_mibs">unload_mibs</seealso> for
+ more info. </p>
+ <p>Also added new functions for loading and unloading a single mib,
+ see <seealso marker="snmpa#load_mib">load_mib</seealso> and
+ <seealso marker="snmpa#unload_mib">unload_mib</seealso> for
+ more info. </p>
+ <p>Own Id: OTP-11216</p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[agent]
+ see <seealso marker="snmpa#load_mibs">load_mibs</seealso> and
+ <seealso marker="snmpa#unload_mibs">unload_mibs</seealso>. </p>
+ <p>Own Id: OTP-11216</p>
+ </item>
+
+ </list>
+-->
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[manager] The old Addr-and-Port based API functions, previously
+ long deprecated and marked for deletion in R16B, has now been
+ removed. </p>
+ <p>Own Id: OTP-10027</p>
+ </item>
+
+ </list>
+-->
+ </section>
+
+ </section> <!-- 4.24.2 -->
+
+
+ <section>
+ <title>SNMP Development Toolkit 4.24.1</title>
+ <p>Version 4.24.1 supports code replacement in runtime from/to
+ version 4.24, 4.23.1 and 4.23. </p>
+
+ <section>
+ <title>Improvements and new features</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[agent,manager] Updated to support the new crypto interface. </p>
+ <p>Own Id: OTP-11009</p>
+ </item>
+
+ </list>
+-->
+
+ </section>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[agent] Reading the value of the vacmViewTreeFamilyMask returns
+ it in the wrong (internal bitlist) format. </p>
+ <p>The vacmViewTreeFamilyMask is defined as a bit string in the MIB
+ (OCTET STRING). Internally a bitlist (list of 1's and 0's,
+ see <seealso marker="snmp_agent_config_files#vacm">vacm config file</seealso>
+ for more info) is used.
+ However, the MIB implementation assumed the latter, effectively
+ rendering all attempts to read/set masks via SNMP unsuccessful. </p>
+ <p>Since the mask is used in hot paths (e.g. access permission checks
+ for each SNMP operation, the bitlist representation of the mask has
+ benefits (e.g. faster processing). Reading/writing the view mask
+ objects is less time-critical. Therefore, to fix the issue, convert
+ between the bitlist (internal) representation and bitstring
+ (external) when the vacmViewTreeFamilyMask objects are accessed. </p>
+ <p>Also, the check of the vacm config file was invalid with
+ regard to the mask value. It was assumed to be a proper oid, which
+ is not strictly the case (see bitlist above). </p>
+ <p>Own Id: OTP-11177</p>
+ <p>Stefan Zegenhagen</p>
+ </item>
+
+ <item>
+ <p>[agent] The counter increment function in the local-db was
+ incorrect. It did not handle counter wrap correctly. </p>
+ <p>Own Id: OTP-11192</p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[manager] The old Addr-and-Port based API functions, previously
+ long deprecated and marked for deletion in R16B, has now been
+ removed. </p>
+ <p>Own Id: OTP-10027</p>
+ </item>
+
+ </list>
+-->
+ </section>
+
+ </section> <!-- 4.24.1 -->
+
+
+ <section>
+ <title>SNMP Development Toolkit 4.24</title>
+ <p>Version 4.24 supports code replacement in runtime from/to
+ version 4.23.1 and 4.23. </p>
+
+ <section>
+ <title>Improvements and new features</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[agent,manager] Updated to support the new crypto interface. </p>
+ <p>Own Id: OTP-11009</p>
+ </item>
+
+ <item>
+ <p>[agent] Introduced a documented behaviour for the mib-server
+ <seealso marker="snmpa_mib_data">mib-data backend</seealso>.
+ At present only the default module (<c>snmpa_mib_data_tttn</c>) is
+ provided. </p>
+ <p>A config option for the (agent)
+ <seealso marker="snmp_config#agent_mib_server">mib-servers</seealso>
+ mib-data backend module has been added to the agent config options,
+ <seealso marker="snmp_config#agent_ms_data_module">data_module</seealso>. </p>
+ <p>Own Id: OTP-11101</p>
+ </item>
+
+ <item>
+ <p>[agent] Introduced a documented behaviour for the
+ <seealso marker="snmpa_mib_storage">mib storage</seealso>.
+ At present there are three simple modules
+ (<c>snmpa_mib_storage_ets</c>, <c>snmpa_mib_storage_dets</c> and
+ <c>snmpa_mib_storage_mnesia</c>) implementing this behaviour,
+ provided with the app. </p>
+ <p>A config option for the (agent)
+ <seealso marker="snmp_config#agent_mib_storage">mib storage</seealso>
+ has been added to the agent config options. </p>
+ <p>Own Id: OTP-11107</p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[agent,manager] Updated to support the new crypto interface. </p>
+ <p>Own Id: OTP-11009</p>
+ </item>
+
+ </list>
+-->
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[manager] The old Addr-and-Port based API functions, previously
+ long deprecated and marked for deletion in R16B, has now been
+ removed. </p>
+ <p>Own Id: OTP-10027</p>
+ </item>
+
+ </list>
+-->
+ </section>
+
+ </section> <!-- 4.24 -->
+
+
+ <section>
+ <title>SNMP Development Toolkit 4.23.1</title>
+ <p>Version 4.23.1 supports code replacement in runtime from/to
+ version 4.23. </p>
<section>
<title>Improvements and new features</title>
@@ -163,9 +778,99 @@
<section>
<title>Incompatibilities</title>
<p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[manager] The old Addr-and-Port based API functions, previously
+ long deprecated and marked for deletion in R16B, has now been
+ removed. </p>
+ <p>Own Id: OTP-10027</p>
+ </item>
+
+ </list>
+-->
</section>
- </section> <!-- 4.22.2 -->
+ </section> <!-- 4.23.1 -->
+
+
+ <section>
+ <title>SNMP Development Toolkit 4.23</title>
+<!--
+ <p>Version 4.23 supports code replacement in runtime from/to
+ version 4.22.1,
+ 4.22, 4.21.7 4.21.6 4.21.5, 4.21.4, 4.21.3, 4.21.2, 4.21.1 and 4.21. </p>
+-->
+
+ <section>
+ <title>Improvements and new features</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[manager] Polish return values of snmpm_user_default according
+ to snmpm_user doc.</p>
+ <p>Luca Favatella</p>
+ <p>Own Id: OTP-10671</p>
+ </item>
+
+ <item>
+ <p>[agent] Remove runtime warning in snmpa_agent because of
+ tuple fun usage. </p>
+ <p>Luca Favatella</p>
+ <p>Own Id: OTP-10672</p>
+ </item>
+
+ <item>
+ <p>[manager] SNMP manager performance optimization. </p>
+ <p>Ivan Dubovik</p>
+ <p>Own Id: OTP-10673</p>
+ </item>
+
+ </list>
+ </section>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <p>-</p>
+
+ <!--
+ <list type="bulleted">
+ <item>
+ <p>[agent] Simultaneous
+ <seealso marker="snmpa#backup">snmpa:backup/1,2</seealso>
+ calls can interfere.
+ The master agent did not check if a backup was already in
+ progress when a backup request was accepted. </p>
+ <p>Own Id: OTP-9884</p>
+ <p>Aux Id: Seq 11995</p>
+ </item>
+
+ </list>
+ -->
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[manager] The old Addr-and-Port based API functions, previously
+ long deprecated and marked for deletion in R16B, has now been
+ removed. </p>
+ <p>Own Id: OTP-10027</p>
+ </item>
+
+ </list>
+ </section>
+
+ </section> <!-- 4.23 -->
<section>
@@ -1001,135 +1706,6 @@
</section> <!-- 4.20 -->
- <section>
- <title>SNMP Development Toolkit 4.19</title>
- <p>Version 4.19 supports code replacement in runtime from/to
- version 4.18.</p>
-
- <section>
- <title>Improvements and new features</title>
-<!--
- <p>-</p>
--->
- <list type="bulleted">
- <item>
- <p>[compiler] Added support for textual convention
- <c>AGENT-CAPABILITIES</c> and "full" support for textual
- convention MODULE-COMPLIANCE, both defined by the SNMPv2-CONF
- mib.</p>
- <p>The <c>reference</c> and <c>modules</c> part(s) are
- stored in the <c>assocList</c> of the mib-entry (<c>me</c>)
- record.
- Only handled <em>if</em> the option(s) <c>agent_capabilities</c>
- and <c>module_compliance</c> (respectively) are provided to the
- compiler. </p>
- <p>See <seealso marker="snmpc#compile">compile/2</seealso>
- for more info. </p>
- <p>For backward compatibillity, the MIBs provided with
- this application are <em>not</em> compiled with these
- options. </p>
- <p>Own Id: OTP-8966</p>
- </item>
-
- <item>
- <p>[agent] Added a "complete" set of (snmp) table and variable
- print functions, for each mib handled by the SNMP (agent)
- application. This will be usefull when debugging a running agent.</p>
- <p>See
- <seealso marker="snmpa#print_mib_info">print_mib_info/0</seealso>,
- <seealso marker="snmpa#print_mib_tables">print_mib_tables/0</seealso>
- and
- <seealso marker="snmpa#print_mib_variables">print_mib_variables/0</seealso>
- for more info. </p>
- <p>Own Id: OTP-8977</p>
- </item>
-
- <item>
- <p>[compiler] Added a MIB compiler (frontend) escript,
- <c>snmpc</c>. </p>
- <p>Own Id: OTP-9004</p>
- </item>
-
- </list>
- </section>
-
- <section>
- <title>Fixed Bugs and Malfunctions</title>
-<!--
- <p>-</p>
--->
- <list type="bulleted">
- <item>
- <p>[agent] For the table vacmAccessTable,
- when performing the is_set_ok and set operation(s),
- all values of the vacmAccessSecurityModel column was
- incorrectly translated to <c>any</c>. </p>
-<!--
-that is when calling:
-snmp_view_basec_acm_mib:vacmAccessTable(set, RowIndex, Cols).
--->
- <p>Own Id: OTP-8980</p>
- </item>
-
- <item>
- <p>[agent] When calling
- <seealso marker="snmp_view_based_acm_mib#reconfigure">snmp_view_based_acm_mib:reconfigure/1</seealso>
- on a running node, the table <c>vacmAccessTable</c> was not properly
- cleaned.
- This meant that if some entries in the vacm.conf file was removed
- (compared to the <c>current</c> config),
- while others where modified and/or added, the removed entrie(s)
- would still exist in the <c>vacmAccessTable</c> table. </p>
- <p>Own Id: OTP-8981</p>
- <p>Aux Id: Seq 11750</p>
- </item>
-
- </list>
- </section>
-
-
- <section>
- <title>Incompatibilities</title>
- <p>-</p>
- </section>
-
- </section> <!-- 4.19 -->
-
-
- <section>
- <title>SNMP Development Toolkit 4.18</title>
- <p>Version 4.18 supports code replacement in runtime from/to
- version 4.17.1 and 4.17.</p>
-
- <section>
- <title>Improvements and new features</title>
- <list type="bulleted">
- <item>
- <p>Prepared for R14B release.</p>
- </item>
- </list>
- </section>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <p>-</p>
-<!--
- <list type="bulleted">
- <item>
- <p>[agent] When the function FilterMod:accept_recv/2 returned false
- the SNMP agent stopped collecting messages from UDP.</p>
- <p>Own Id: OTP-8761</p>
- </item>
- </list>
--->
- </section>
-
- <section>
- <title>Incompatibilities</title>
- <p>-</p>
- </section>
- </section> <!-- 4.18 -->
-
-
<!-- section>
<title>Release notes history</title>
<p>For information about older versions see
diff --git a/lib/snmp/doc/src/notes_history.xml b/lib/snmp/doc/src/notes_history.xml
index 023717cd7c..cae9630ff9 100644
--- a/lib/snmp/doc/src/notes_history.xml
+++ b/lib/snmp/doc/src/notes_history.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2004</year><year>2012</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/part.xml b/lib/snmp/doc/src/part.xml
index 603ddc7a62..5ac6dc3917 100644
--- a/lib/snmp/doc/src/part.xml
+++ b/lib/snmp/doc/src/part.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE part SYSTEM "part.dtd">
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/part_notes.xml b/lib/snmp/doc/src/part_notes.xml
index 6d00e5b7e3..d149044169 100644
--- a/lib/snmp/doc/src/part_notes.xml
+++ b/lib/snmp/doc/src/part_notes.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE part SYSTEM "part.dtd">
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/part_notes_history.xml b/lib/snmp/doc/src/part_notes_history.xml
index bebd33e81b..aa5276dc94 100644
--- a/lib/snmp/doc/src/part_notes_history.xml
+++ b/lib/snmp/doc/src/part_notes_history.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE part SYSTEM "part.dtd">
<part>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/ref_man.xml b/lib/snmp/doc/src/ref_man.xml
index 92e8927f6d..b8559dda62 100644
--- a/lib/snmp/doc/src/ref_man.xml
+++ b/lib/snmp/doc/src/ref_man.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE application SYSTEM "application.dtd">
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2011</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -44,6 +45,8 @@
<xi:include href="snmpa_error_io.xml"/>
<xi:include href="snmpa_error_logger.xml"/>
<xi:include href="snmpa_local_db.xml"/>
+ <xi:include href="snmpa_mib_data.xml"/>
+ <xi:include href="snmpa_mib_storage.xml"/>
<xi:include href="snmpa_mpd.xml"/>
<xi:include href="snmpa_network_interface.xml"/>
<xi:include href="snmpa_network_interface_filter.xml"/>
diff --git a/lib/snmp/doc/src/snmp-um-1-image-1.ps b/lib/snmp/doc/src/snmp-um-1-image-1.ps
deleted file mode 100644
index 13562a8366..0000000000
--- a/lib/snmp/doc/src/snmp-um-1-image-1.ps
+++ /dev/null
@@ -1,2912 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: Adobe Illustrator(r) 6.0
-%%For: (Anna Fedoriw) (Ericsson Telecom)
-%%Title: (MIBcompilerPrinciples.eps)
-%%CreationDate: (97-05-23) (14.05)
-%%BoundingBox: 86 487 456 695
-%%HiResBoundingBox: 86.1667 487.1601 455.3333 694.8333
-%%DocumentProcessColors: Black
-%%DocumentFonts: Univers
-%%DocumentSuppliedResources: procset Adobe_level2_AI5 1.0 0
-%%+ procset Adobe_typography_AI5 1.0 0
-%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6
-%%+ procset Adobe_Illustrator_AI5 1.0 0
-%AI5_FileFormat 2.0
-%AI3_ColorUsage: Black&White
-%%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set)
-%%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1
-%%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 ()
-%AI3_TemplateBox: 306 396 306 396
-%AI3_TileBox: 21 -12 588 802
-%AI3_DocumentPreview: Macintosh_ColorPic
-%AI5_ArtSize: 595.2756 841.8898
-%AI5_RulerUnits: 1
-%AI5_ArtFlags: 0 0 0 1 0 0 1 1 0
-%AI5_TargetResolution: 800
-%AI5_NumLayers: 1
-%AI5_OpenToView: 2 796 1.5 1146 827 58 1 1 3 40
-%AI5_OpenViewLayers: 7
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset Adobe_level2_AI5 1.2 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation)
-%%Version: 1.2
-%%CreationDate: (04/10/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-userdict /Adobe_level2_AI5 23 dict dup begin
- put
- /packedarray where not
- {
- userdict begin
- /packedarray
- {
- array astore readonly
- } bind def
- /setpacking /pop load def
- /currentpacking false def
- end
- 0
- } if
- pop
- userdict /defaultpacking currentpacking put true setpacking
- /initialize
- {
- Adobe_level2_AI5 begin
- } bind def
- /terminate
- {
- currentdict Adobe_level2_AI5 eq
- {
- end
- } if
- } bind def
- mark
- /setcustomcolor where not
- {
- /findcmykcustomcolor
- {
- 5 packedarray
- } bind def
- /setcustomcolor
- {
- exch aload pop pop
- 4
- {
- 4 index mul 4 1 roll
- } repeat
- 5 -1 roll pop
- setcmykcolor
- }
- def
- } if
-
- /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def
- userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put
- userdict /level2?
- systemdict /languagelevel known dup
- {
- pop systemdict /languagelevel get 2 ge
- } if
- put
-/level2ScreenFreq
-{
- begin
- 60
- HalftoneType 1 eq
- {
- pop Frequency
- } if
- HalftoneType 2 eq
- {
- pop GrayFrequency
- } if
- HalftoneType 5 eq
- {
- pop Default level2ScreenFreq
- } if
- end
-} bind def
-userdict /currentScreenFreq
- level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put
-level2? not
- {
- /setcmykcolor where not
- {
- /setcmykcolor
- {
- exch .11 mul add exch .59 mul add exch .3 mul add
- 1 exch sub setgray
- } def
- } if
- /currentcmykcolor where not
- {
- /currentcmykcolor
- {
- 0 0 0 1 currentgray sub
- } def
- } if
- /setoverprint where not
- {
- /setoverprint /pop load def
- } if
- /selectfont where not
- {
- /selectfont
- {
- exch findfont exch
- dup type /arraytype eq
- {
- makefont
- }
- {
- scalefont
- } ifelse
- setfont
- } bind def
- } if
- /cshow where not
- {
- /cshow
- {
- [
- 0 0 5 -1 roll aload pop
- ] cvx bind forall
- } bind def
- } if
- } if
- cleartomark
- /anyColor?
- {
- add add add 0 ne
- } bind def
- /testColor
- {
- gsave
- setcmykcolor currentcmykcolor
- grestore
- } bind def
- /testCMYKColorThrough
- {
- testColor anyColor?
- } bind def
- userdict /composite?
- level2?
- {
- gsave 1 1 1 1 setcmykcolor currentcmykcolor grestore
- add add add 4 eq
- }
- {
- 1 0 0 0 testCMYKColorThrough
- 0 1 0 0 testCMYKColorThrough
- 0 0 1 0 testCMYKColorThrough
- 0 0 0 1 testCMYKColorThrough
- and and and
- } ifelse
- put
- composite? not
- {
- userdict begin
- gsave
- /cyan? 1 0 0 0 testCMYKColorThrough def
- /magenta? 0 1 0 0 testCMYKColorThrough def
- /yellow? 0 0 1 0 testCMYKColorThrough def
- /black? 0 0 0 1 testCMYKColorThrough def
- grestore
- /isCMYKSep? cyan? magenta? yellow? black? or or or def
- /customColor? isCMYKSep? not def
- end
- } if
- end defaultpacking setpacking
-%%EndResource
-%%BeginResource: procset Adobe_typography_AI5 1.0 1
-%%Title: (Typography Operators)
-%%Version: 1.0
-%%CreationDate:(03/26/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_typography_AI5 54 dict dup begin
-put
-/initialize
-{
- begin
- begin
- Adobe_typography_AI5 begin
- Adobe_typography_AI5
- {
- dup xcheck
- {
- bind
- } if
- pop pop
- } forall
- end
- end
- end
- Adobe_typography_AI5 begin
-} def
-/terminate
-{
- currentdict Adobe_typography_AI5 eq
- {
- end
- } if
-} def
-/modifyEncoding
-{
- /_tempEncode exch ddef
- /_pntr 0 ddef
- {
- counttomark -1 roll
- dup type dup /marktype eq
- {
- pop pop exit
- }
- {
- /nametype eq
- {
- _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
- put
- }
- {
- /_pntr exch ddef
- } ifelse
- } ifelse
- } loop
- _tempEncode
-} def
-/TE
-{
- StandardEncoding 256 array copy modifyEncoding
- /_nativeEncoding exch def
-} def
-%
-/TZ
-{
- dup type /arraytype eq
- {
- /_wv exch def
- }
- {
- /_wv 0 def
- } ifelse
- /_useNativeEncoding exch def
- pop pop
- findfont _wv type /arraytype eq
- {
- _wv makeblendedfont
- } if
- dup length 2 add dict
- begin
- mark exch
- {
- 1 index /FID ne
- {
- def
- } if
- cleartomark mark
- } forall
- pop
- /FontName exch def
- counttomark 0 eq
- {
- 1 _useNativeEncoding eq
- {
- /Encoding _nativeEncoding def
- } if
- cleartomark
- }
- {
- /Encoding load 256 array copy
- modifyEncoding /Encoding exch def
- } ifelse
- FontName currentdict
- end
- definefont pop
-} def
-/tr
-{
- _ax _ay 3 2 roll
-} def
-/trj
-{
- _cx _cy _sp _ax _ay 6 5 roll
-} def
-/a0
-{
- /Tx
- {
- dup
- currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- } ddef
- /Tj
- {
- dup
- currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- } ddef
-} def
-/a1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/e0
-{
- /Tx
- {
- tr _psf
- } ddef
- /Tj
- {
- trj _pjsf
- } ddef
-} def
-/e1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- tr _psf
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- trj _pjsf
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/i0
-{
- /Tx
- {
- tr sp
- } ddef
- /Tj
- {
- trj jsp
- } ddef
-} def
-/i1
-{
- W N
-} def
-/o0
-{
- /Tx
- {
- tr sw rmoveto
- } ddef
- /Tj
- {
- trj swj rmoveto
- } ddef
-} def
-/r0
-{
- /Tx
- {
- tr _ctm _pss
- } ddef
- /Tj
- {
- trj _ctm _pjss
- } ddef
-} def
-/r1
-{
- /Tx
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/To
-{
- pop _ctm currentmatrix pop
-} def
-/TO
-{
- iTe _ctm setmatrix newpath
-} def
-/Tp
-{
- pop _tm astore pop _ctm setmatrix
- _tDict begin
- /W
- {
- } def
- /h
- {
- } def
-} def
-/TP
-{
- end
- iTm 0 0 moveto
-} def
-/Tr
-{
- _render 3 le
- {
- currentpoint newpath moveto
- } if
- dup 8 eq
- {
- pop 0
- }
- {
- dup 9 eq
- {
- pop 1
- } if
- } ifelse
- dup /_render exch ddef
- _renderStart exch get load exec
-} def
-/iTm
-{
- _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
-} def
-/Tm
-{
- _tm astore pop iTm 0 0 moveto
-} def
-/Td
-{
- _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
-} def
-/iTe
-{
- _render -1 eq
- {
- }
- {
- _renderEnd _render get dup null ne
- {
- load exec
- }
- {
- pop
- } ifelse
- } ifelse
- /_render -1 ddef
-} def
-/Ta
-{
- pop
-} def
-/Tf
-{
- dup 1000 div /_fScl exch ddef
-%
- selectfont
-} def
-/Tl
-{
- pop
- 0 exch _leading astore pop
-} def
-/Tt
-{
- pop
-} def
-/TW
-{
- 3 npop
-} def
-/Tw
-{
- /_cx exch ddef
-} def
-/TC
-{
- 3 npop
-} def
-/Tc
-{
- /_ax exch ddef
-} def
-/Ts
-{
- /_rise exch ddef
- currentpoint
- iTm
- moveto
-} def
-/Ti
-{
- 3 npop
-} def
-/Tz
-{
- 100 div /_hs exch ddef
- iTm
-} def
-/TA
-{
- pop
-} def
-/Tq
-{
- pop
-} def
-/Th
-{
- pop pop pop pop pop
-} def
-/TX
-{
- pop
-} def
-/Tk
-{
- exch pop _fScl mul neg 0 rmoveto
-} def
-/TK
-{
- 2 npop
-} def
-/T*
-{
- _leading aload pop neg Td
-} def
-/T*-
-{
- _leading aload pop Td
-} def
-/T-
-{
- _ax neg 0 rmoveto
- _hyphen Tx
-} def
-/T+
-{
-} def
-/TR
-{
- _ctm currentmatrix pop
- _tm astore pop
- iTm 0 0 moveto
-} def
-/TS
-{
- currentfont 3 1 roll
- /_Symbol_ _fScl 1000 mul selectfont
-
- 0 eq
- {
- Tx
- }
- {
- Tj
- } ifelse
- setfont
-} def
-/Xb
-{
- pop pop
-} def
-/Tb /Xb load def
-/Xe
-{
- pop pop pop pop
-} def
-/Te /Xe load def
-/XB
-{
-} def
-/TB /XB load def
-currentdict readonly pop
-end
-setpacking
-%%EndResource
-%%BeginProcSet: Adobe_ColorImage_AI6 1.0 0
-userdict /Adobe_ColorImage_AI6 known not
-{
- userdict /Adobe_ColorImage_AI6 17 dict put
-} if
-userdict /Adobe_ColorImage_AI6 get begin
-
- /initialize
- {
- Adobe_ColorImage_AI6 begin
- Adobe_ColorImage_AI6
- {
- dup type /arraytype eq
- {
- dup xcheck
- {
- bind
- } if
- } if
- pop pop
- } forall
- } def
- /terminate { end } def
-
- currentdict /Adobe_ColorImage_AI6_Vars known not
- {
- /Adobe_ColorImage_AI6_Vars 14 dict def
- } if
-
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 0 def
- /sourcecount 0 def
- /sourcearray 4 array def
- /plateindex -1 def
- /XIMask 0 def
- /XIBinary 0 def
- /XIChannelCount 0 def
- /XIBitsPerPixel 0 def
- /XIImageHeight 0 def
- /XIImageWidth 0 def
- /XIImageMatrix null def
- /XIBuffer null def
- /XIDataProc null def
- end
-
- /WalkRGBString null def
- /WalkCMYKString null def
-
- /StuffRGBIntoGrayString null def
- /RGBToGrayImageProc null def
- /StuffCMYKIntoGrayString null def
- /CMYKToGrayImageProc null def
- /ColorImageCompositeEmulator null def
-
- /SeparateCMYKImageProc null def
-
- /FourEqual null def
- /TestPlateIndex null def
-
- currentdict /_colorimage known not
- {
- /colorimage where
- {
- /colorimage get /_colorimage exch def
- }
- {
- /_colorimage null def
- } ifelse
- } if
-
- /_currenttransfer systemdict /currenttransfer get def
-
- /colorimage null def
- /XI null def
-
-
- /WalkRGBString
- {
- 0 3 index
-
- dup length 1 sub 0 3 3 -1 roll
- {
- 3 getinterval { } forall
-
- 5 index exec
-
- 3 index
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /WalkCMYKString
- {
- 0 3 index
-
- dup length 1 sub 0 4 3 -1 roll
- {
- 4 getinterval { } forall
-
- 6 index exec
-
- 3 index
-
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /StuffRGBIntoGrayString
- {
- .11 mul exch
-
- .59 mul add exch
-
- .3 mul add
-
- cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /RGBToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 3 idiv string
- dup 3 1 roll
-
- /StuffRGBIntoGrayString load exch
- WalkRGBString
- end
- } def
-
-
- /StuffCMYKIntoGrayString
- {
- exch .11 mul add
-
- exch .59 mul add
-
- exch .3 mul add
-
- dup 255 gt { pop 255 } if
-
- 255 exch sub cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /CMYKToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 4 idiv string
- dup 3 1 roll
-
- /StuffCMYKIntoGrayString load exch
- WalkCMYKString
- end
- } def
-
-
- /ColorImageCompositeEmulator
- {
- pop true eq
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
- }
- {
- Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 3 -1 roll put
-
- channelcount 3 eq
- {
- /RGBToGrayImageProc
- }
- {
- /CMYKToGrayImageProc
- } ifelse
- load
- end
- } if
- image
- } ifelse
- } def
-
-
- /SeparateCMYKImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
-
- sourcecount 0 ne
- {
- sourcearray plateindex get exec
- }
- {
- sourcearray 0 get exec
-
- dup length 4 idiv string
-
- 0 2 index
-
- plateindex 4 2 index length 1 sub
- {
- get 255 exch sub
-
- 3 copy put pop 1 add
-
- 2 index
- } for
-
- pop pop exch pop
- } ifelse
- end
- } def
-
-
- /FourEqual
- {
- 4 index ne
- {
- pop pop pop false
- }
- {
- 4 index ne
- {
- pop pop false
- }
- {
- 4 index ne
- {
- pop false
- }
- {
- 4 index eq
- } ifelse
- } ifelse
- } ifelse
- } def
-
-
- /TestPlateIndex
- {
- Adobe_ColorImage_AI6_Vars begin
- /plateindex -1 def
-
- /setcmykcolor where
- {
- pop
- gsave
- 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
- grestore
-
- 1 0 0 0 FourEqual
- {
- /plateindex 0 def
- }
- {
- 0 1 0 0 FourEqual
- {
- /plateindex 1 def
- }
- {
- 0 0 1 0 FourEqual
- {
- /plateindex 2 def
- }
- {
- 0 0 0 1 FourEqual
- {
- /plateindex 3 def
- }
- {
- 0 0 0 0 FourEqual
- {
- /plateindex 5 def
- } if
- } ifelse
- } ifelse
- } ifelse
- } ifelse
- pop pop pop pop
- } if
- plateindex
- end
- } def
-
-
- /colorimage
- {
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 1 index def
- /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
-
- 4 sourcecount add index dup
- 8 eq exch 1 eq or not
- end
-
- {
- /_colorimage load null ne
- {
- _colorimage
- }
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get
- 7 add { pop } repeat
- } ifelse
- }
- {
- dup 3 eq
- TestPlateIndex
- dup -1 eq exch 5 eq or or
- {
- /_colorimage load null eq
- {
- ColorImageCompositeEmulator
- }
- {
- dup 1 eq
- {
- pop pop image
- }
- {
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- gsave
-
- 0 _currenttransfer exec
- 1 _currenttransfer exec
- eq
- { 0 _currenttransfer exec 0.5 lt }
- { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
-
- { { pop 0 } } { { pop 1 } } ifelse
- systemdict /settransfer get exec
- } if
-
- _colorimage
-
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- grestore
- } if
- } ifelse
- } ifelse
- }
- {
- dup 1 eq
- {
- pop pop
- image
- }
- {
- pop pop
-
- Adobe_ColorImage_AI6_Vars begin
- sourcecount -1 0
- {
- exch sourcearray 3 1 roll put
- } for
-
- /SeparateCMYKImageProc load
- end
-
- systemdict /image get exec
- } ifelse
- } ifelse
- } ifelse
- } def
-
- /XI
- {
- Adobe_ColorImage_AI6_Vars begin
- gsave
- /XIMask exch 0 ne def
- /XIBinary exch 0 ne def
- pop
- pop
- /XIChannelCount exch def
- /XIBitsPerPixel exch def
- /XIImageHeight exch def
- /XIImageWidth exch def
- pop pop pop pop
- /XIImageMatrix exch def
-
- XIBitsPerPixel 1 eq
- {
- XIImageWidth 8 div ceiling cvi
- }
- {
- XIImageWidth XIChannelCount mul
- } ifelse
- /XIBuffer exch string def
-
- XIBinary
- {
- /XIDataProc { currentfile XIBuffer readstring pop } def
- currentfile 128 string readline pop pop
- }
- {
- /XIDataProc { currentfile XIBuffer readhexstring pop } def
- } ifelse
-
- 0 0 moveto
- XIImageMatrix concat
- XIImageWidth XIImageHeight scale
-
- XIMask
- {
- XIImageWidth XIImageHeight
- false
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- /_lp /null ddef
- _fc
- /_lp /imagemask ddef
-
- imagemask
- }
- {
- XIImageWidth XIImageHeight
- XIBitsPerPixel
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- XIChannelCount 1 eq
- {
-
- gsave
- 0 setgray
-
- image
-
- grestore
- }
- {
- false
- XIChannelCount
- colorimage
- } ifelse
- } ifelse
- grestore
- end
- } def
-
-end
-%%EndProcSet
-%%BeginResource: procset Adobe_Illustrator_AI5 1.1 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Full Prolog)
-%%Version: 1.1
-%%CreationDate: (3/7/1994) ()
-%%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_Illustrator_AI5_vars 81 dict dup begin
-put
-/_eo false def
-/_lp /none def
-/_pf
-{
-} def
-/_ps
-{
-} def
-/_psf
-{
-} def
-/_pss
-{
-} def
-/_pjsf
-{
-} def
-/_pjss
-{
-} def
-/_pola 0 def
-/_doClip 0 def
-/cf currentflat def
-/_tm matrix def
-/_renderStart
-[
-/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0
-] def
-/_renderEnd
-[
-null null null null /i1 /i1 /i1 /i1
-] def
-/_render -1 def
-/_rise 0 def
-/_ax 0 def
-/_ay 0 def
-/_cx 0 def
-/_cy 0 def
-/_leading
-[
-0 0
-] def
-/_ctm matrix def
-/_mtx matrix def
-/_sp 16#020 def
-/_hyphen (-) def
-/_fScl 0 def
-/_cnt 0 def
-/_hs 1 def
-/_nativeEncoding 0 def
-/_useNativeEncoding 0 def
-/_tempEncode 0 def
-/_pntr 0 def
-/_tDict 2 dict def
-/_wv 0 def
-/Tx
-{
-} def
-/Tj
-{
-} def
-/CRender
-{
-} def
-/_AI3_savepage
-{
-} def
-/_gf null def
-/_cf 4 array def
-/_if null def
-/_of false def
-/_fc
-{
-} def
-/_gs null def
-/_cs 4 array def
-/_is null def
-/_os false def
-/_sc
-{
-} def
-/_pd 1 dict def
-/_ed 15 dict def
-/_pm matrix def
-/_fm null def
-/_fd null def
-/_fdd null def
-/_sm null def
-/_sd null def
-/_sdd null def
-/_i null def
-/discardSave null def
-/buffer 256 string def
-/beginString null def
-/endString null def
-/endStringLength null def
-/layerCnt 1 def
-/layerCount 1 def
-/perCent (%) 0 get def
-/perCentSeen? false def
-/newBuff null def
-/newBuffButFirst null def
-/newBuffLast null def
-/clipForward? false def
-end
-userdict /Adobe_Illustrator_AI5 known not {
- userdict /Adobe_Illustrator_AI5 91 dict put
-} if
-userdict /Adobe_Illustrator_AI5 get begin
-/initialize
-{
- Adobe_Illustrator_AI5 dup begin
- Adobe_Illustrator_AI5_vars begin
- discardDict
- {
- bind pop pop
- } forall
- dup /nc get begin
- {
- dup xcheck 1 index type /operatortype ne and
- {
- bind
- } if
- pop pop
- } forall
- end
- newpath
-} def
-/terminate
-{
- end
- end
-} def
-/_
-null def
-/ddef
-{
- Adobe_Illustrator_AI5_vars 3 1 roll put
-} def
-/xput
-{
- dup load dup length exch maxlength eq
- {
- dup dup load dup
- length 2 mul dict copy def
- } if
- load begin
- def
- end
-} def
-/npop
-{
- {
- pop
- } repeat
-} def
-/sw
-{
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
-} def
-/swj
-{
- dup 4 1 roll
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
- 6 2 roll /_cnt 0 ddef
- {
- 1 index eq
- {
- /_cnt _cnt 1 add ddef
- } if
- } forall
- pop
- exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop
-} def
-/ss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put pop
- gsave
- false charpath currentpoint
- 4 index setmatrix
- stroke
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 3 npop
-} def
-/jss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- gsave
- _sp eq
- {
- exch 6 index 6 index 6 index 5 -1 roll widthshow
- currentpoint
- }
- {
- false charpath currentpoint
- 4 index setmatrix stroke
- } ifelse
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 6 npop
-} def
-/sp
-{
- {
- 2 npop (0) exch
- 2 copy 0 exch put pop
- false charpath
- 2 copy rmoveto
- } exch cshow
- 2 npop
-} def
-/jsp
-{
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- _sp eq
- {
- exch 5 index 5 index 5 index 5 -1 roll widthshow
- }
- {
- false charpath
- } ifelse
- 2 copy rmoveto
- } exch cshow
- 5 npop
-} def
-/pl
-{
- transform
- 0.25 sub round 0.25 add exch
- 0.25 sub round 0.25 add exch
- itransform
-} def
-/setstrokeadjust where
-{
- pop true setstrokeadjust
- /c
- {
- curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll curveto
- } def
- /V
- /v load def
- /y
- {
- 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- lineto
- } def
- /L
- /l load def
- /m
- {
- moveto
- } def
-}
-{
- /c
- {
- pl curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll pl curveto
- } def
- /V
- /v load def
- /y
- {
- pl 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- pl lineto
- } def
- /L
- /l load def
- /m
- {
- pl moveto
- } def
-} ifelse
-/d
-{
- setdash
-} def
-/cf
-{
-} def
-/i
-{
- dup 0 eq
- {
- pop cf
- } if
- setflat
-} def
-/j
-{
- setlinejoin
-} def
-/J
-{
- setlinecap
-} def
-/M
-{
- setmiterlimit
-} def
-/w
-{
- setlinewidth
-} def
-/XR
-{
- 0 ne
- /_eo exch ddef
-} def
-/H
-{
-} def
-/h
-{
- closepath
-} def
-/N
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- _eo {eoclip} {clip} ifelse /_doClip 0 ddef
- } if
- newpath
- }
- {
- /CRender
- {
- N
- } ddef
- } ifelse
-} def
-/n
-{
- N
-} def
-/F
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc
- /_doClip 0 ddef
- }
- {
- _pf
- } ifelse
- }
- {
- /CRender
- {
- F
- } ddef
- } ifelse
-} def
-/f
-{
- closepath
- F
-} def
-/S
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- _ps
- } ifelse
- }
- {
- /CRender
- {
- S
- } ddef
- } ifelse
-} def
-/s
-{
- closepath
- S
-} def
-/B
-{
- _pola 0 eq
- {
- _doClip 1 eq
- gsave F grestore
- {
- gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- S
- } ifelse
- }
- {
- /CRender
- {
- B
- } ddef
- } ifelse
-} def
-/b
-{
- closepath
- B
-} def
-/W
-{
- /_doClip 1 ddef
-} def
-/*
-{
- count 0 ne
- {
- dup type /stringtype eq
- {
- pop
- } if
- } if
- newpath
-} def
-/u
-{
-} def
-/U
-{
-} def
-/q
-{
- _pola 0 eq
- {
- gsave
- } if
-} def
-/Q
-{
- _pola 0 eq
- {
- grestore
- } if
-} def
-/*u
-{
- _pola 1 add /_pola exch ddef
-} def
-/*U
-{
- _pola 1 sub /_pola exch ddef
- _pola 0 eq
- {
- CRender
- } if
-} def
-/D
-{
- pop
-} def
-/*w
-{
-} def
-/*W
-{
-} def
-/`
-{
- /_i save ddef
- clipForward?
- {
- nulldevice
- } if
- 6 1 roll 4 npop
- concat pop
- userdict begin
- /showpage
- {
- } def
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {pop false setstrokeadjust} if
- newpath
- 0 setgray
- false setoverprint
-} def
-/~
-{
- end
- _i restore
-} def
-/O
-{
- 0 ne
- /_of exch ddef
- /_lp /none ddef
-} def
-/R
-{
- 0 ne
- /_os exch ddef
- /_lp /none ddef
-} def
-/g
-{
- /_gf exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _gf setgray
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/G
-{
- /_gs exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _gs setgray
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/k
-{
- _cf astore pop
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _cf aload pop setcmykcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/K
-{
- _cs astore pop
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _cs aload pop setcmykcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/x
-{
- /_gf exch ddef
- findcmykcustomcolor
- /_if exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _if _gf 1 exch sub setcustomcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/X
-{
- /_gs exch ddef
- findcmykcustomcolor
- /_is exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _is _gs 1 exch sub setcustomcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/A
-{
- pop
-} def
-/annotatepage
-{
-userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse
-} def
-/XT {
- pop pop
-} def
-/discard
-{
- save /discardSave exch store
- discardDict begin
- /endString exch store
- gt38?
- {
- 2 add
- } if
- load
- stopped
- pop
- end
- discardSave restore
-} bind def
-userdict /discardDict 7 dict dup begin
-put
-/pre38Initialize
-{
- /endStringLength endString length store
- /newBuff buffer 0 endStringLength getinterval store
- /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store
- /newBuffLast newBuff endStringLength 1 sub 1 getinterval store
-} def
-/shiftBuffer
-{
- newBuff 0 newBuffButFirst putinterval
- newBuffLast 0
- currentfile read not
- {
- stop
- } if
- put
-} def
-0
-{
- pre38Initialize
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff endString eq
- {
- cleartomark stop
- } if
- shiftBuffer
- } loop
- }
- {
- stop
- } ifelse
-} def
-1
-{
- pre38Initialize
- /beginString exch store
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff beginString eq
- {
- /layerCount dup load 1 add store
- }
- {
- newBuff endString eq
- {
- /layerCount dup load 1 sub store
- layerCount 0 eq
- {
- cleartomark stop
- } if
- } if
- } ifelse
- shiftBuffer
- } loop
- } if
-} def
-2
-{
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- endString eq
- {
- cleartomark stop
- } if
- } loop
-} def
-3
-{
- /beginString exch store
- /layerCnt 1 store
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- dup beginString eq
- {
- pop /layerCnt dup load 1 add store
- }
- {
- endString eq
- {
- layerCnt 1 eq
- {
- cleartomark stop
- }
- {
- /layerCnt dup load 1 sub store
- } ifelse
- } if
- } ifelse
- } loop
-} def
-end
-userdict /clipRenderOff 15 dict dup begin
-put
-{
- /n /N /s /S /f /F /b /B
-}
-{
- {
- _doClip 1 eq
- {
- /_doClip 0 ddef _eo {eoclip} {clip} ifelse
- } if
- newpath
- } def
-} forall
-/Tr /pop load def
-/Bb {} def
-/BB /pop load def
-/Bg {12 npop} def
-/Bm {6 npop} def
-/Bc /Bm load def
-/Bh {4 npop} def
-end
-/Lb
-{
- 4 npop
- 6 1 roll
- pop
- 4 1 roll
- pop pop pop
- 0 eq
- {
- 0 eq
- {
- (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard
- }
- {
-
- /clipForward? true def
-
- /Tx /pop load def
- /Tj /pop load def
-
- currentdict end clipRenderOff begin begin
- } ifelse
- }
- {
- 0 eq
- {
- save /discardSave exch store
- } if
- } ifelse
-} bind def
-/LB
-{
- discardSave dup null ne
- {
- restore
- }
- {
- pop
- clipForward?
- {
- currentdict
- end
- end
- begin
-
- /clipForward? false ddef
- } if
- } ifelse
-} bind def
-/Pb
-{
- pop pop
- 0 (%AI5_EndPalette) discard
-} bind def
-/Np
-{
- 0 (%AI5_End_NonPrinting--) discard
-} bind def
-/Ln /pop load def
-/Ap
-/pop load def
-/Ar
-{
- 72 exch div
- 0 dtransform dup mul exch dup mul add sqrt
- dup 1 lt
- {
- pop 1
- } if
- setflat
-} def
-/Mb
-{
- q
-} def
-/Md
-{
-} def
-/MB
-{
- Q
-} def
-/nc 3 dict def
-nc begin
-/setgray
-{
- pop
-} bind def
-/setcmykcolor
-{
- 4 npop
-} bind def
-/setcustomcolor
-{
- 2 npop
-} bind def
-currentdict readonly pop
-end
-end
-setpacking
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%IncludeFont: Univers
-Adobe_level2_AI5 /initialize get exec
-Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec
-Adobe_ColorImage_AI6 /initialize get exec
-Adobe_Illustrator_AI5 /initialize get exec
-[
-39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
-/Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
-/egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
-/oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
-/udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
-/registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
-/.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
-/.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
-/questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
-/guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
-/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
-/.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
-/fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
-/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
-/Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
-/Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
-/hungarumlaut/ogonek/caron
-TE
-%AI3_BeginEncoding: _Univers Univers
-[/_Univers/Univers 0 0 1 TZ
-%AI3_EndEncoding AdobeType
-%AI5_Begin_NonPrinting
-Np
-8 Bn
-%AI5_BeginGradient: (Black & White)
-(Black & White) 0 2 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Green & Blue)
-(Green & Blue) 0 2 Bd
-[
-<
-99999A9A9B9B9B9C9C9D9D9D9E9E9F9F9FA0A0A1A1A1A2A2A3A3A3A4A4A5A5A5A6A6A7A7A7A8A8A9
-A9A9AAAAABABABACACADADADAEAEAFAFAFB0B0B1B1B1B2B2B3B3B3B4B4B5B5B5B6B6B7B7B7B8B8B9
-B9B9BABABBBBBBBCBCBDBDBDBEBEBFBFBFC0C0C1C1C1C2C2C3C3C3C4C4C5C5C5C6C6C7C7C7C8C8C9
-C9C9CACACBCBCBCCCCCDCDCDCECECFCFCFD0D0D1D1D1D2D2D3D3D3D4D4D5D5D5D6D6D7D7D7D8D8D9
-D9D9DADADBDBDBDCDCDDDDDDDEDEDFDFDFE0E0E1E1E1E2E2E3E3E3E4E4E5E5E5E6E6E7E7E7E8E8E9
-E9E9EAEAEBEBEBECECEDEDEDEEEEEFEFEFF0F0F1F1F1F2F2F3F3F3F4F4F5F5F5F6F6F7F7F7F8F8F9
-F9F9FAFAFBFBFBFCFCFDFDFDFEFEFFFF
->
-<
-000102020304050506070808090A0B0B0C0D0E0E0F101111121314141516171718191A1A1B1C1D1D
-1E1F20202122232324252626272829292A2B2C2C2D2E2F2F303132323334353536373838393A3B3B
-3C3D3E3E3F404141424344444546474748494A4A4B4C4D4D4E4F5050515253535455565657585959
-5A5B5C5C5D5E5F5F606162626364656566676868696A6B6B6C6D6E6E6F7071717273747475767777
-78797A7A7B7C7D7D7E7F80808182828384858586878888898A8B8B8C8D8E8E8F9091919293949495
-96979798999A9A9B9C9D9D9E9FA0A0A1A2A3A3A4A5A6A6A7A8A9A9AAABACACADAEAFAFB0B1B2B2B3
-B4B5B5B6B7B8B8B9BABBBBBCBDBEBEBF
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-[
-1 0.75 0 0 1 50 100 %_Bs
-0.6 0 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Pink, Yellow, Green)
-(Pink, Yellow, Green) 0 3 Bd
-[
-<
-00000000000000000000000000000000000000010101010101010101010101010101010101010101
-01010101010202020202020202020202020202020202020202020203030303030303030303030303
-03030303030303030404040404040404040404040404040404040404050505050505050505050505
-05050505050505060606060606060606060606060606060606060707070707070707070707070707
-07070707080808080808080808080808080808080809090909090909090909090909090909090A0A
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0C
-0C0C0C0C0C0C0C0D0D0D0D0D
->
-<
-050506060606070708080809090A0A0A0B0B0C0C0D0D0E0E0F0F1010111112121313141415151617
-17181819191A1A1B1C1C1D1D1E1F1F202021222223232425252626272828292A2A2B2C2C2D2D2E2F
-2F3031313233333435353637373839393A3B3B3C3D3E3E3F4040414242434445454647474849494A
-4B4C4C4D4E4F4F505151525354545556575758595A5A5B5C5C5D5E5F5F6061626363646566666768
-69696A6B6C6C6D6E6F707071727373747576777778797A7B7B7C7D7E7F7F80818283838485868787
-88898A8B8B8C8D8E8F8F9091929394949596979898999A9B9C9D9D9E9FA0A1A2A2A3A4A5A6A7A7A8
-A9AAABACADADAEAFB0B1B2B2
->
-<
-CCCCCBCBCBCACACAC9C9C8C8C7C7C6C6C5C5C4C4C3C2C2C1C1C0C0BFBEBEBDBDBCBBBBBAB9B9B8B7
-B7B6B6B5B4B4B3B2B1B1B0AFAFAEADADACABAAAAA9A8A8A7A6A5A5A4A3A2A2A1A0A09F9E9D9C9C9B
-9A999998979696959493929291908F8E8E8D8C8B8A8A8988878686858483828181807F7E7D7C7C7B
-7A7978777776757473727171706F6E6D6C6B6A6A69686766656463636261605F5E5D5C5B5B5A5958
-5756555453525151504F4E4D4C4B4A49484746464544434241403F3E3D3C3B3A3938383736353433
-3231302F2E2D2C2B2A29282726252423222221201F1E1D1C1B1A191817161514131211100F0E0D0C
-0B0A09080706050403020100
->
-0
-1 %_Br
-<
-737271706F6E6D6C6B6A696867666564636261605F5E5D5C5B5B5A59585756555453525150504F4E
-4D4C4B4A4949484746454443434241403F3E3E3D3C3B3A3A393837363635343333323130302F2E2D
-2D2C2B2A2A29282827262525242323222121201F1F1E1D1D1C1C1B1A1A1918181717161615141413
-1312121111100F0F0E0E0D0D0C0C0C0B0B0A0A090908080807070606060505050404040303030202
-020201010101010000000000
->
-<
-00000000000000000000000001010101010101010101010101010101010101010101010102020202
-02020202020202020202020202020202020202020202030303030303030303030303030303030303
-03030303030303030303030303040404040404040404040404040404040404040404040404040404
-04040404040404040404050505050505050505050505050505050505050505050505050505050505
-050505050505050505050505
->
-<
-BFBFBFC0C0C0C0C0C0C0C0C0C1C1C1C1C1C1C1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C3C3
-C3C4C4C4C4C4C4C4C4C4C4C5C5C5C5C5C5C5C5C5C5C5C6C6C6C6C6C6C6C6C6C6C6C6C7C7C7C7C7C7
-C7C7C7C7C7C7C8C8C8C8C8C8C8C8C8C8C8C8C8C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9CACACACACACA
-CACACACACACACACACACACBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCCCCCCCCCCCCCCCC
-CCCCCCCCCCCCCCCCCCCCCCCC
->
-0
-1 %_Br
-[
-0.05 0.7 0 0 1 50 100 %_Bs
-0 0.02 0.8 0 1 57 36 %_Bs
-0.45 0 0.75 0 1 37 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Purple, Red & Yellow)
-(Purple, Red & Yellow) 0 3 Bd
-[
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A
->
-<
-CCCCCCCDCDCDCDCDCECECECECECFCFCFCFD0D0D0D0D0D1D1D1D1D1D2D2D2D2D2D3D3D3D3D3D4D4D4
-D4D5D5D5D5D5D6D6D6D6D6D7D7D7D7D7D8D8D8D8D8D9D9D9D9DADADADADADBDBDBDBDBDCDCDCDCDC
-DDDDDDDDDDDEDEDEDEDFDFDFDFDFE0E0E0E0E0E1E1E1E1E1E2E2E2E2E2E3E3E3E3E4E4E4E4E4E5E5
-E5E5E5E6E6E6E6E6E7E7E7E7E7E8E8E8E8E9E9E9E9E9EAEAEAEAEAEBEBEBEBEBECECECECECEDEDED
-EDEEEEEEEEEEEFEFEFEFEFF0F0F0F0F0F1F1F1F1F1F2F2F2F2F3F3F3F3F3F4F4F4F4F4F5F5F5F5F5
-F6F6F6F6F6F7F7F7F7F8F8F8F8F8F9F9F9F9F9FAFAFAFAFAFBFBFBFBFBFCFCFCFCFDFDFDFDFDFEFE
-FEFEFEFFFFFF
->
-0
-1 %_Br
-<
-E5E4E3E2E1E0DFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBE
-BDBCBBBAB9B8B7B6B5B4B3B2B1B0AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A99989796
-9594939291908F8E8D8C8B8A898887868584838281807F7E7D7C7B7A797877767574737271706F6E
-6D6C6B6A696867666564636261605F5E5D5C5B5A595857565554535251504F4E4D4C4B4A49484746
-4544434241403F3E3D3C3B3A393837363534333231302F2E2D2C2B2A292827262524232221201F1E
-1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
->
-<
-E5E6E6E6E6E6E6E6E6E7E7E7E7E7E7E7E7E7E8E8E8E8E8E8E8E8E8E9E9E9E9E9E9E9E9E9EAEAEAEA
-EAEAEAEAEAEBEBEBEBEBEBEBEBEBECECECECECECECECECEDEDEDEDEDEDEDEDEDEEEEEEEEEEEEEEEE
-EEEFEFEFEFEFEFEFEFEFF0F0F0F0F0F0F0F0F0F1F1F1F1F1F1F1F1F1F2F2F2F2F2F2F2F2F2F3F3F3
-F3F3F3F3F3F3F4F4F4F4F4F4F4F4F4F5F5F5F5F5F5F5F5F5F6F6F6F6F6F6F6F6F6F7F7F7F7F7F7F7
-F7F7F8F8F8F8F8F8F8F8F8F9F9F9F9F9F9F9F9F9FAFAFAFAFAFAFAFAFAFBFBFBFBFBFBFBFBFBFCFC
-FCFCFCFCFCFCFCFDFDFDFDFDFDFDFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFF
->
-<
-00010203040405060708090A0B0C0C0D0E0F10111213141415161718191A1B1C1D1D1E1F20212223
-242525262728292A2B2C2D2D2E2F30313233343535363738393A3B3C3D3D3E3F4041424344454546
-4748494A4B4C4D4E4E4F50515253545556565758595A5B5C5D5E5E5F60616263646566666768696A
-6B6C6D6E6E6F70717273747576767778797A7B7C7D7E7F7F80818283848586878788898A8B8C8D8E
-8F8F90919293949596979798999A9B9C9D9E9F9FA0A1A2A3A4A5A6A7A7A8A9AAABACADAEAFAFB0B1
-B2B3B4B5B6B7B8B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C8C9CACBCC
->
-0
-1 %_Br
-[
-0 0.04 1 0 1 50 100 %_Bs
-0 1 0.8 0 1 50 50 %_Bs
-0.9 0.9 0 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Rainbow)
-(Rainbow) 0 6 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-0
-1 %_Br
-1
-<
-0708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E
-2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556
-5758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E
-7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6
-A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCE
-CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6
-F7F8F9FAFBFCFDFEFF
->
-0
-0
-1 %_Br
-1
-<
-00000000000000000000000000000000000001010101010101010101010101010101010101010101
-01010101010101010101010101010202020202020202020202020202020202020202020202020202
-02020202020202020202030303030303030303030303030303030303030303030303030303030303
-03030303030304040404040404040404040404040404040404040404040404040404040404040404
-04040505050505050505050505050505050505050505050505050505050505050505050505050606
-06060606060606060606060606060606060606060606060606060606060606060606070707070707
-07070707070707070707070707070707
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0
-1
-0
-1 %_Br
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-1 %_Br
-[
-0 1 0 0 1 50 100 %_Bs
-1 1 0 0 1 50 80 %_Bs
-1 0.0279 0 0 1 50 60 %_Bs
-1 0 1 0 1 50 40 %_Bs
-0 0 1 0 1 50 20 %_Bs
-0 1 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Steel Bar)
-(Steel Bar) 0 3 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 70 %_Bs
-0 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Orange Radial)
-(Yellow & Orange Radial) 1 2 Bd
-[
-0
-<
-0001010203040506060708090A0B0C0C0D0E0F10111213131415161718191A1B1C1D1D1E1F202122
-232425262728292A2B2B2C2D2E2F303132333435363738393A3B3C3D3E3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60606162636465666768696A6B6C6D6E6F
-707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C
->
-<
-FFFFFFFFFEFEFEFEFEFEFEFDFDFDFDFDFDFCFCFCFCFCFCFBFBFBFBFBFBFAFAFAFAFAFAF9F9F9F9F9
-F9F8F8F8F8F8F8F7F7F7F7F7F7F6F6F6F6F6F6F5F5F5F5F5F5F4F4F4F4F4F3F3F3F3F3F3F2F2F2F2
-F2F2F1F1F1F1F1F0F0F0F0F0F0EFEFEFEFEFEFEEEEEEEEEEEDEDEDEDEDEDECECECECECEBEBEBEBEB
-EBEAEAEAEAEAE9E9E9E9E9E9E8E8E8E8E8E8E7E7E7E7E7E6E6E6E6E6E5
->
-0
-1 %_Br
-[
-0 0 1 0 1 52 19 %_Bs
-0 0.55 0.9 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Purple Radial)
-(Yellow & Purple Radial) 1 2 Bd
-[
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-<
-1415161718191A1B1C1D1E1F1F202122232425262728292A2A2B2C2D2E2F30313233343536363738
-393A3B3C3D3E3F40414142434445464748494A4B4C4D4D4E4F50515253545556575858595A5B5C5D
-5E5F60616263646465666768696A6B6C6D6E6F6F707172737475767778797A7B7B7C7D7E7F808182
-83848586868788898A8B8C8D8E8F90919292939495969798999A9B9C9D9D9E9FA0A1A2A3A4A5A6A7
-A8A9A9AAABACADAEAFB0B1B2B3B4B4B5B6B7B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C9CACBCB
-CCCDCECFD0D1D2D3D4D5D6D7D7D8D9DADBDCDDDEDFE0E1E2E2E3E4E5E6E7E8E9EAEBECEDEEEEEFF0
-F1F2F3F4F5F6F7F8F9F9FAFBFCFDFEFF
->
-<
-ABAAAAA9A8A7A7A6A5A5A4A3A3A2A1A1A09F9F9E9D9D9C9B9B9A9999989797969595949393929191
-908F8F8E8D8D8C8B8B8A8989888787868585848383828181807F7F7E7D7D7C7B7B7A797978777776
-7575747373727171706F6F6E6D6D6C6B6B6A6969686767666565646362626160605F5E5E5D5C5C5B
-5A5A5958585756565554545352525150504F4E4E4D4C4C4B4A4A4948484746464544444342424140
-403F3E3E3D3C3C3B3A3A3938383736363534343332323130302F2E2E2D2C2C2B2A2A292828272626
-25242423222121201F1F1E1D1D1C1B1B1A1919181717161515141313121111100F0F0E0D0D0C0B0B
-0A090908070706050504030302010100
->
-0
-1 %_Br
-[
-0 0.08 0.67 0 1 50 14 %_Bs
-1 1 0 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_End_NonPrinting--
-%AI5_BeginPalette
-0 2 Pb
-Pn
-Pc
-1 g
-Pc
-0 g
-Pc
-0 0 0 0 k
-Pc
-0.75 g
-Pc
-0.5 g
-Pc
-0.25 g
-Pc
-0 g
-Pc
-Bb
-2 (Black & White) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0 0 0 k
-Pc
-0.5 0 0 0 k
-Pc
-0.75 0 0 0 k
-Pc
-1 0 0 0 k
-Pc
-0.25 0.25 0 0 k
-Pc
-0.5 0.5 0 0 k
-Pc
-0.75 0.75 0 0 k
-Pc
-1 1 0 0 k
-Pc
-Bb
-2 (Pink, Yellow, Green) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0 0 k
-Pc
-0 0.5 0 0 k
-Pc
-0 0.75 0 0 k
-Pc
-0 1 0 0 k
-Pc
-0 0.25 0.25 0 k
-Pc
-0 0.5 0.5 0 k
-Pc
-0 0.75 0.75 0 k
-Pc
-0 1 1 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Purple Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0 0.25 0 k
-Pc
-0 0 0.5 0 k
-Pc
-0 0 0.75 0 k
-Pc
-0 0 1 0 k
-Pc
-0.25 0 0.25 0 k
-Pc
-0.5 0 0.5 0 k
-Pc
-0.75 0 0.75 0 k
-Pc
-1 0 1 0 k
-Pc
-Bb
-2 (Rainbow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0 0 k
-Pc
-0.5 0.25 0 0 k
-Pc
-0.75 0.375 0 0 k
-Pc
-1 0.5 0 0 k
-Pc
-0.125 0.25 0 0 k
-Pc
-0.25 0.5 0 0 k
-Pc
-0.375 0.75 0 0 k
-Pc
-0.5 1 0 0 k
-Pc
-Bb
-2 (Steel Bar) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0.125 0 k
-Pc
-0 0.5 0.25 0 k
-Pc
-0 0.75 0.375 0 k
-Pc
-0 1 0.5 0 k
-Pc
-0 0.125 0.25 0 k
-Pc
-0 0.25 0.5 0 k
-Pc
-0 0.375 0.75 0 k
-Pc
-0 0.5 1 0 k
-Pc
-Bb
-2 (Purple, Red & Yellow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0 0.25 0 k
-Pc
-0.25 0 0.5 0 k
-Pc
-0.375 0 0.75 0 k
-Pc
-0.5 0 1 0 k
-Pc
-0.25 0 0.125 0 k
-Pc
-0.5 0 0.25 0 k
-Pc
-0.75 0 0.375 0 k
-Pc
-1 0 0.5 0 k
-Pc
-Bb
-2 (Green & Blue) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0.125 0 k
-Pc
-0.5 0.25 0.25 0 k
-Pc
-0.75 0.375 0.375 0 k
-Pc
-1 0.5 0.5 0 k
-Pc
-0.25 0.25 0.125 0 k
-Pc
-0.5 0.5 0.25 0 k
-Pc
-0.75 0.75 0.375 0 k
-Pc
-1 1 0.5 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Orange Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0.25 0.125 0 k
-Pc
-0.25 0.5 0.25 0 k
-Pc
-0.375 0.75 0.375 0 k
-Pc
-0.5 1 0.5 0 k
-Pc
-0.125 0.25 0.25 0 k
-Pc
-0.25 0.5 0.5 0 k
-Pc
-0.375 0.75 0.75 0 k
-Pc
-0.5 1 1 0 k
-Pc
-0 0 0 0 k
-Pc
-0.125 0.125 0.25 0 k
-Pc
-0.25 0.25 0.5 0 k
-Pc
-0.375 0.375 0.75 0 k
-Pc
-0.5 0.5 1 0 k
-Pc
-0.25 0.125 0.25 0 k
-Pc
-0.5 0.25 0.5 0 k
-Pc
-0.75 0.375 0.75 0 k
-Pc
-1 0.5 1 0 k
-Pc
-PB
-%AI5_EndPalette
-%%EndSetup
-%AI5_BeginLayer
-1 1 1 1 0 0 0 79 128 255 Lb
-(Layer 1) Ln
-0 A
-800 Ar
-0 J 0 j 1 w 4 M []0 d
-%AI3_Note:
-0 D
-0 XR
--4014 283.5 m
-4626 283.5 L
-(N) *
-453.5 4716 m
-453.5 -3924 L
-(N) *
-85 4716 m
-85 -3924 L
-(N) *
--4014 765.5 m
-4626 765.5 L
-(N) *
-1 Ap
-0 O
-1 g
-0 R
-0 G
-228.6667 637.3333 m
-228.6667 694.3333 L
-86.6667 694.3333 L
-86.6667 637.3333 L
-228.6667 637.3333 L
-b
-454.8333 643.8333 m
-454.8333 679.8333 L
-255.8333 679.8333 L
-255.8333 643.8333 L
-454.8333 643.8333 L
-b
-0 Ap
-214.1667 671.3333 m
-B
-87.1667 671.3333 m
-228.6667 671.3333 l
-B
-1 Ap
-286.105 487.6601 m
-286.105 516.0065 L
-192.5617 516.0065 L
-192.5617 487.6601 L
-286.105 487.6601 L
-b
-u
-u
-u
-0 Ap
-151.7708 636.6458 m
-223.2708 605.1458 l
-B
-0 g
-225.8455 605.1261 m
-224.5361 606.2522 223.74 607.1081 222.7428 608.1322 c
-220.6995 603.5202 l
-221.2248 603.5338 223.2969 603.455 225.0105 603.2414 c
-226.8449 603.0136 228.46 602.6979 229.4643 602.3956 c
-228.5657 602.9365 227.2467 603.9206 225.8455 605.1261 c
-f
-U
-U
-U
-u
-u
-0 R
-0 G
-355.3333 643.2083 m
-254.3333 604.7083 l
-S
-0 O
-0 g
-252.4878 602.9128 m
-254.2108 603.032 255.3786 602.9827 256.8077 602.9549 c
-255.02 607.6718 l
-254.6558 607.293 253.1265 605.8928 251.7573 604.8403 c
-250.2923 603.7133 248.9215 602.8028 247.9946 602.3119 c
-249.014 602.5587 250.6439 602.7856 252.4878 602.9128 c
-f
-U
-U
-u
-u
-0 R
-0 G
-239.3333 558.8333 m
-239.4177 522.6094 l
-S
-0 O
-0 g
-240.4481 520.2498 m
-240.9434 521.9043 241.4009 522.9799 241.9302 524.3077 c
-236.8859 524.2959 l
-237.1123 523.8216 237.884 521.8971 238.3868 520.245 c
-238.9256 518.4768 239.295 516.8732 239.4279 515.8328 c
-239.556 516.8738 239.9177 518.4791 240.4481 520.2498 c
-f
-U
-U
-0 To
-1 0 0 1 91.6667 676.8333 0 Tp
-TP
-0 Tr
-/_Univers 10 Tf
-0 Ts
-100 Tz
-0 Tt
-1 TA
-%_ 0 XL
-36 0 Xb
-XB
-0 0 5 TC
-100 100 200 TW
-0 0 0 Ti
-0 Ta
-0 0 2 2 3 Th
-0 Tq
-0 0 Tl
-0 Tc
-0 Tw
-(MIB in ASN.1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 173.6667 676.8333 0 Tp
-TP
-0 Tr
-(file.mib) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 92.6667 660.8333 0 Tp
-TP
-0 Tr
-/_Univers 9 Tf
-(sysContact OBJECT) Tx 1 92 Tk
-(-TYPE\r) Tx
-0 -11 Td
-( SYNT) Tx 1 74 Tk
-(AX DisplayString\r) Tx
-0 -11 Td
-( ...) Tx
-(\r) TX
-TO
-163.1667 670.8333 m
-F
-163.6667 693.8333 m
-F
-0 R
-0 G
-163.6667 694.2083 m
-163.6667 671.4583 l
-S
-0 To
-1 0 0 1 264.8333 665.8333 0 Tp
-TP
-0 Tr
-0 O
-0 g
-/_Univers 10 Tf
-(Association file) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 264.8333 648.8333 0 Tp
-TP
-0 Tr
-({sysContact, {mymod, sysCFunc, []}}.) Tx
-(\r) TX
-TO
-0 R
-0 G
-228.3333 516.3333 m
-228.3333 501.8333 l
-285.8333 501.8333 l
-S
-0 To
-1 0 0 1 195.3333 503.8333 0 Tp
-TP
-0 Tr
-0 O
-0 g
-(Binary\r) Tx
-0 -12 Td
-(Representation) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 234.3333 504.3333 0 Tp
-TP
-0 Tr
-(file.bin) Tx
-(\r) TX
-TO
-0 R
-0 G
-255.8333 661.3333 m
-454.8333 661.3333 l
-S
-352.8333 679.8333 m
-352.8333 661.3333 l
-S
-0 To
-1 0 0 1 363.3333 665.8333 0 Tp
-TP
-0 Tr
-0 O
-0 g
-(file.funcs) Tx
-(\r) TX
-TO
-u
-1 Ap
-0 R
-0 G
-239.3333 559.0734 m
-258.9022 559.0734 274.7664 568.5919 274.7664 580.3332 c
-274.7664 592.0746 258.9022 601.5931 239.3333 601.5931 c
-219.7644 601.5931 203.9002 592.0746 203.9002 580.3332 c
-203.9002 568.5919 219.7644 559.0734 239.3333 559.0734 c
-s
-0 To
-1 0 0 1 239.3333 582.8994 0 Tp
-TP
--9.4434 0 Td
-0 Tr
-0 O
-0 g
-1 Ta
-(MIB\r) Tx
--12.2217 -12 Td
-(Compiler) Tx
-(\r) TX
-TO
-U
-LB
-%AI5_EndLayer--
-%%PageTrailer
-gsave annotatepage grestore showpage
-%%Trailer
-Adobe_Illustrator_AI5 /terminate get exec
-Adobe_ColorImage_AI6 /terminate get exec
-Adobe_typography_AI5 /terminate get exec
-Adobe_level2_AI5 /terminate get exec
-%%EOF
diff --git a/lib/snmp/doc/src/snmp-um-1-image-2.ps b/lib/snmp/doc/src/snmp-um-1-image-2.ps
deleted file mode 100644
index 38d875eff1..0000000000
--- a/lib/snmp/doc/src/snmp-um-1-image-2.ps
+++ /dev/null
@@ -1,2866 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: Adobe Illustrator(r) 6.0
-%%For: (Anna Fedoriw) (Ericsson Telecom)
-%%Title: (StartingTheAgent.eps)
-%%CreationDate: (97-05-23) (14.06)
-%%BoundingBox: 126 592 437 744
-%%HiResBoundingBox: 126.8422 592.4803 436.5 743.6667
-%%DocumentProcessColors: Black
-%%DocumentFonts: Courier
-%%+ Univers
-%%DocumentSuppliedResources: procset Adobe_level2_AI5 1.0 0
-%%+ procset Adobe_typography_AI5 1.0 0
-%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6
-%%+ procset Adobe_Illustrator_AI5 1.0 0
-%AI5_FileFormat 2.0
-%AI3_ColorUsage: Black&White
-%%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set)
-%%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1
-%%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 ()
-%AI3_TemplateBox: 306 396 306 396
-%AI3_TileBox: 21 -12 588 802
-%AI3_DocumentPreview: Macintosh_ColorPic
-%AI5_ArtSize: 595.2756 841.8898
-%AI5_RulerUnits: 1
-%AI5_ArtFlags: 0 0 0 1 0 0 1 1 0
-%AI5_TargetResolution: 800
-%AI5_NumLayers: 1
-%AI5_OpenToView: 78 768 2 1146 827 58 1 1 3 40
-%AI5_OpenViewLayers: 7
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset Adobe_level2_AI5 1.2 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation)
-%%Version: 1.2
-%%CreationDate: (04/10/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-userdict /Adobe_level2_AI5 23 dict dup begin
- put
- /packedarray where not
- {
- userdict begin
- /packedarray
- {
- array astore readonly
- } bind def
- /setpacking /pop load def
- /currentpacking false def
- end
- 0
- } if
- pop
- userdict /defaultpacking currentpacking put true setpacking
- /initialize
- {
- Adobe_level2_AI5 begin
- } bind def
- /terminate
- {
- currentdict Adobe_level2_AI5 eq
- {
- end
- } if
- } bind def
- mark
- /setcustomcolor where not
- {
- /findcmykcustomcolor
- {
- 5 packedarray
- } bind def
- /setcustomcolor
- {
- exch aload pop pop
- 4
- {
- 4 index mul 4 1 roll
- } repeat
- 5 -1 roll pop
- setcmykcolor
- }
- def
- } if
-
- /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def
- userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put
- userdict /level2?
- systemdict /languagelevel known dup
- {
- pop systemdict /languagelevel get 2 ge
- } if
- put
-/level2ScreenFreq
-{
- begin
- 60
- HalftoneType 1 eq
- {
- pop Frequency
- } if
- HalftoneType 2 eq
- {
- pop GrayFrequency
- } if
- HalftoneType 5 eq
- {
- pop Default level2ScreenFreq
- } if
- end
-} bind def
-userdict /currentScreenFreq
- level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put
-level2? not
- {
- /setcmykcolor where not
- {
- /setcmykcolor
- {
- exch .11 mul add exch .59 mul add exch .3 mul add
- 1 exch sub setgray
- } def
- } if
- /currentcmykcolor where not
- {
- /currentcmykcolor
- {
- 0 0 0 1 currentgray sub
- } def
- } if
- /setoverprint where not
- {
- /setoverprint /pop load def
- } if
- /selectfont where not
- {
- /selectfont
- {
- exch findfont exch
- dup type /arraytype eq
- {
- makefont
- }
- {
- scalefont
- } ifelse
- setfont
- } bind def
- } if
- /cshow where not
- {
- /cshow
- {
- [
- 0 0 5 -1 roll aload pop
- ] cvx bind forall
- } bind def
- } if
- } if
- cleartomark
- /anyColor?
- {
- add add add 0 ne
- } bind def
- /testColor
- {
- gsave
- setcmykcolor currentcmykcolor
- grestore
- } bind def
- /testCMYKColorThrough
- {
- testColor anyColor?
- } bind def
- userdict /composite?
- level2?
- {
- gsave 1 1 1 1 setcmykcolor currentcmykcolor grestore
- add add add 4 eq
- }
- {
- 1 0 0 0 testCMYKColorThrough
- 0 1 0 0 testCMYKColorThrough
- 0 0 1 0 testCMYKColorThrough
- 0 0 0 1 testCMYKColorThrough
- and and and
- } ifelse
- put
- composite? not
- {
- userdict begin
- gsave
- /cyan? 1 0 0 0 testCMYKColorThrough def
- /magenta? 0 1 0 0 testCMYKColorThrough def
- /yellow? 0 0 1 0 testCMYKColorThrough def
- /black? 0 0 0 1 testCMYKColorThrough def
- grestore
- /isCMYKSep? cyan? magenta? yellow? black? or or or def
- /customColor? isCMYKSep? not def
- end
- } if
- end defaultpacking setpacking
-%%EndResource
-%%BeginResource: procset Adobe_typography_AI5 1.0 1
-%%Title: (Typography Operators)
-%%Version: 1.0
-%%CreationDate:(03/26/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_typography_AI5 54 dict dup begin
-put
-/initialize
-{
- begin
- begin
- Adobe_typography_AI5 begin
- Adobe_typography_AI5
- {
- dup xcheck
- {
- bind
- } if
- pop pop
- } forall
- end
- end
- end
- Adobe_typography_AI5 begin
-} def
-/terminate
-{
- currentdict Adobe_typography_AI5 eq
- {
- end
- } if
-} def
-/modifyEncoding
-{
- /_tempEncode exch ddef
- /_pntr 0 ddef
- {
- counttomark -1 roll
- dup type dup /marktype eq
- {
- pop pop exit
- }
- {
- /nametype eq
- {
- _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
- put
- }
- {
- /_pntr exch ddef
- } ifelse
- } ifelse
- } loop
- _tempEncode
-} def
-/TE
-{
- StandardEncoding 256 array copy modifyEncoding
- /_nativeEncoding exch def
-} def
-%
-/TZ
-{
- dup type /arraytype eq
- {
- /_wv exch def
- }
- {
- /_wv 0 def
- } ifelse
- /_useNativeEncoding exch def
- pop pop
- findfont _wv type /arraytype eq
- {
- _wv makeblendedfont
- } if
- dup length 2 add dict
- begin
- mark exch
- {
- 1 index /FID ne
- {
- def
- } if
- cleartomark mark
- } forall
- pop
- /FontName exch def
- counttomark 0 eq
- {
- 1 _useNativeEncoding eq
- {
- /Encoding _nativeEncoding def
- } if
- cleartomark
- }
- {
- /Encoding load 256 array copy
- modifyEncoding /Encoding exch def
- } ifelse
- FontName currentdict
- end
- definefont pop
-} def
-/tr
-{
- _ax _ay 3 2 roll
-} def
-/trj
-{
- _cx _cy _sp _ax _ay 6 5 roll
-} def
-/a0
-{
- /Tx
- {
- dup
- currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- } ddef
- /Tj
- {
- dup
- currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- } ddef
-} def
-/a1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/e0
-{
- /Tx
- {
- tr _psf
- } ddef
- /Tj
- {
- trj _pjsf
- } ddef
-} def
-/e1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- tr _psf
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- trj _pjsf
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/i0
-{
- /Tx
- {
- tr sp
- } ddef
- /Tj
- {
- trj jsp
- } ddef
-} def
-/i1
-{
- W N
-} def
-/o0
-{
- /Tx
- {
- tr sw rmoveto
- } ddef
- /Tj
- {
- trj swj rmoveto
- } ddef
-} def
-/r0
-{
- /Tx
- {
- tr _ctm _pss
- } ddef
- /Tj
- {
- trj _ctm _pjss
- } ddef
-} def
-/r1
-{
- /Tx
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/To
-{
- pop _ctm currentmatrix pop
-} def
-/TO
-{
- iTe _ctm setmatrix newpath
-} def
-/Tp
-{
- pop _tm astore pop _ctm setmatrix
- _tDict begin
- /W
- {
- } def
- /h
- {
- } def
-} def
-/TP
-{
- end
- iTm 0 0 moveto
-} def
-/Tr
-{
- _render 3 le
- {
- currentpoint newpath moveto
- } if
- dup 8 eq
- {
- pop 0
- }
- {
- dup 9 eq
- {
- pop 1
- } if
- } ifelse
- dup /_render exch ddef
- _renderStart exch get load exec
-} def
-/iTm
-{
- _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
-} def
-/Tm
-{
- _tm astore pop iTm 0 0 moveto
-} def
-/Td
-{
- _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
-} def
-/iTe
-{
- _render -1 eq
- {
- }
- {
- _renderEnd _render get dup null ne
- {
- load exec
- }
- {
- pop
- } ifelse
- } ifelse
- /_render -1 ddef
-} def
-/Ta
-{
- pop
-} def
-/Tf
-{
- dup 1000 div /_fScl exch ddef
-%
- selectfont
-} def
-/Tl
-{
- pop
- 0 exch _leading astore pop
-} def
-/Tt
-{
- pop
-} def
-/TW
-{
- 3 npop
-} def
-/Tw
-{
- /_cx exch ddef
-} def
-/TC
-{
- 3 npop
-} def
-/Tc
-{
- /_ax exch ddef
-} def
-/Ts
-{
- /_rise exch ddef
- currentpoint
- iTm
- moveto
-} def
-/Ti
-{
- 3 npop
-} def
-/Tz
-{
- 100 div /_hs exch ddef
- iTm
-} def
-/TA
-{
- pop
-} def
-/Tq
-{
- pop
-} def
-/Th
-{
- pop pop pop pop pop
-} def
-/TX
-{
- pop
-} def
-/Tk
-{
- exch pop _fScl mul neg 0 rmoveto
-} def
-/TK
-{
- 2 npop
-} def
-/T*
-{
- _leading aload pop neg Td
-} def
-/T*-
-{
- _leading aload pop Td
-} def
-/T-
-{
- _ax neg 0 rmoveto
- _hyphen Tx
-} def
-/T+
-{
-} def
-/TR
-{
- _ctm currentmatrix pop
- _tm astore pop
- iTm 0 0 moveto
-} def
-/TS
-{
- currentfont 3 1 roll
- /_Symbol_ _fScl 1000 mul selectfont
-
- 0 eq
- {
- Tx
- }
- {
- Tj
- } ifelse
- setfont
-} def
-/Xb
-{
- pop pop
-} def
-/Tb /Xb load def
-/Xe
-{
- pop pop pop pop
-} def
-/Te /Xe load def
-/XB
-{
-} def
-/TB /XB load def
-currentdict readonly pop
-end
-setpacking
-%%EndResource
-%%BeginProcSet: Adobe_ColorImage_AI6 1.0 0
-userdict /Adobe_ColorImage_AI6 known not
-{
- userdict /Adobe_ColorImage_AI6 17 dict put
-} if
-userdict /Adobe_ColorImage_AI6 get begin
-
- /initialize
- {
- Adobe_ColorImage_AI6 begin
- Adobe_ColorImage_AI6
- {
- dup type /arraytype eq
- {
- dup xcheck
- {
- bind
- } if
- } if
- pop pop
- } forall
- } def
- /terminate { end } def
-
- currentdict /Adobe_ColorImage_AI6_Vars known not
- {
- /Adobe_ColorImage_AI6_Vars 14 dict def
- } if
-
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 0 def
- /sourcecount 0 def
- /sourcearray 4 array def
- /plateindex -1 def
- /XIMask 0 def
- /XIBinary 0 def
- /XIChannelCount 0 def
- /XIBitsPerPixel 0 def
- /XIImageHeight 0 def
- /XIImageWidth 0 def
- /XIImageMatrix null def
- /XIBuffer null def
- /XIDataProc null def
- end
-
- /WalkRGBString null def
- /WalkCMYKString null def
-
- /StuffRGBIntoGrayString null def
- /RGBToGrayImageProc null def
- /StuffCMYKIntoGrayString null def
- /CMYKToGrayImageProc null def
- /ColorImageCompositeEmulator null def
-
- /SeparateCMYKImageProc null def
-
- /FourEqual null def
- /TestPlateIndex null def
-
- currentdict /_colorimage known not
- {
- /colorimage where
- {
- /colorimage get /_colorimage exch def
- }
- {
- /_colorimage null def
- } ifelse
- } if
-
- /_currenttransfer systemdict /currenttransfer get def
-
- /colorimage null def
- /XI null def
-
-
- /WalkRGBString
- {
- 0 3 index
-
- dup length 1 sub 0 3 3 -1 roll
- {
- 3 getinterval { } forall
-
- 5 index exec
-
- 3 index
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /WalkCMYKString
- {
- 0 3 index
-
- dup length 1 sub 0 4 3 -1 roll
- {
- 4 getinterval { } forall
-
- 6 index exec
-
- 3 index
-
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /StuffRGBIntoGrayString
- {
- .11 mul exch
-
- .59 mul add exch
-
- .3 mul add
-
- cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /RGBToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 3 idiv string
- dup 3 1 roll
-
- /StuffRGBIntoGrayString load exch
- WalkRGBString
- end
- } def
-
-
- /StuffCMYKIntoGrayString
- {
- exch .11 mul add
-
- exch .59 mul add
-
- exch .3 mul add
-
- dup 255 gt { pop 255 } if
-
- 255 exch sub cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /CMYKToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 4 idiv string
- dup 3 1 roll
-
- /StuffCMYKIntoGrayString load exch
- WalkCMYKString
- end
- } def
-
-
- /ColorImageCompositeEmulator
- {
- pop true eq
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
- }
- {
- Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 3 -1 roll put
-
- channelcount 3 eq
- {
- /RGBToGrayImageProc
- }
- {
- /CMYKToGrayImageProc
- } ifelse
- load
- end
- } if
- image
- } ifelse
- } def
-
-
- /SeparateCMYKImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
-
- sourcecount 0 ne
- {
- sourcearray plateindex get exec
- }
- {
- sourcearray 0 get exec
-
- dup length 4 idiv string
-
- 0 2 index
-
- plateindex 4 2 index length 1 sub
- {
- get 255 exch sub
-
- 3 copy put pop 1 add
-
- 2 index
- } for
-
- pop pop exch pop
- } ifelse
- end
- } def
-
-
- /FourEqual
- {
- 4 index ne
- {
- pop pop pop false
- }
- {
- 4 index ne
- {
- pop pop false
- }
- {
- 4 index ne
- {
- pop false
- }
- {
- 4 index eq
- } ifelse
- } ifelse
- } ifelse
- } def
-
-
- /TestPlateIndex
- {
- Adobe_ColorImage_AI6_Vars begin
- /plateindex -1 def
-
- /setcmykcolor where
- {
- pop
- gsave
- 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
- grestore
-
- 1 0 0 0 FourEqual
- {
- /plateindex 0 def
- }
- {
- 0 1 0 0 FourEqual
- {
- /plateindex 1 def
- }
- {
- 0 0 1 0 FourEqual
- {
- /plateindex 2 def
- }
- {
- 0 0 0 1 FourEqual
- {
- /plateindex 3 def
- }
- {
- 0 0 0 0 FourEqual
- {
- /plateindex 5 def
- } if
- } ifelse
- } ifelse
- } ifelse
- } ifelse
- pop pop pop pop
- } if
- plateindex
- end
- } def
-
-
- /colorimage
- {
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 1 index def
- /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
-
- 4 sourcecount add index dup
- 8 eq exch 1 eq or not
- end
-
- {
- /_colorimage load null ne
- {
- _colorimage
- }
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get
- 7 add { pop } repeat
- } ifelse
- }
- {
- dup 3 eq
- TestPlateIndex
- dup -1 eq exch 5 eq or or
- {
- /_colorimage load null eq
- {
- ColorImageCompositeEmulator
- }
- {
- dup 1 eq
- {
- pop pop image
- }
- {
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- gsave
-
- 0 _currenttransfer exec
- 1 _currenttransfer exec
- eq
- { 0 _currenttransfer exec 0.5 lt }
- { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
-
- { { pop 0 } } { { pop 1 } } ifelse
- systemdict /settransfer get exec
- } if
-
- _colorimage
-
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- grestore
- } if
- } ifelse
- } ifelse
- }
- {
- dup 1 eq
- {
- pop pop
- image
- }
- {
- pop pop
-
- Adobe_ColorImage_AI6_Vars begin
- sourcecount -1 0
- {
- exch sourcearray 3 1 roll put
- } for
-
- /SeparateCMYKImageProc load
- end
-
- systemdict /image get exec
- } ifelse
- } ifelse
- } ifelse
- } def
-
- /XI
- {
- Adobe_ColorImage_AI6_Vars begin
- gsave
- /XIMask exch 0 ne def
- /XIBinary exch 0 ne def
- pop
- pop
- /XIChannelCount exch def
- /XIBitsPerPixel exch def
- /XIImageHeight exch def
- /XIImageWidth exch def
- pop pop pop pop
- /XIImageMatrix exch def
-
- XIBitsPerPixel 1 eq
- {
- XIImageWidth 8 div ceiling cvi
- }
- {
- XIImageWidth XIChannelCount mul
- } ifelse
- /XIBuffer exch string def
-
- XIBinary
- {
- /XIDataProc { currentfile XIBuffer readstring pop } def
- currentfile 128 string readline pop pop
- }
- {
- /XIDataProc { currentfile XIBuffer readhexstring pop } def
- } ifelse
-
- 0 0 moveto
- XIImageMatrix concat
- XIImageWidth XIImageHeight scale
-
- XIMask
- {
- XIImageWidth XIImageHeight
- false
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- /_lp /null ddef
- _fc
- /_lp /imagemask ddef
-
- imagemask
- }
- {
- XIImageWidth XIImageHeight
- XIBitsPerPixel
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- XIChannelCount 1 eq
- {
-
- gsave
- 0 setgray
-
- image
-
- grestore
- }
- {
- false
- XIChannelCount
- colorimage
- } ifelse
- } ifelse
- grestore
- end
- } def
-
-end
-%%EndProcSet
-%%BeginResource: procset Adobe_Illustrator_AI5 1.1 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Full Prolog)
-%%Version: 1.1
-%%CreationDate: (3/7/1994) ()
-%%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_Illustrator_AI5_vars 81 dict dup begin
-put
-/_eo false def
-/_lp /none def
-/_pf
-{
-} def
-/_ps
-{
-} def
-/_psf
-{
-} def
-/_pss
-{
-} def
-/_pjsf
-{
-} def
-/_pjss
-{
-} def
-/_pola 0 def
-/_doClip 0 def
-/cf currentflat def
-/_tm matrix def
-/_renderStart
-[
-/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0
-] def
-/_renderEnd
-[
-null null null null /i1 /i1 /i1 /i1
-] def
-/_render -1 def
-/_rise 0 def
-/_ax 0 def
-/_ay 0 def
-/_cx 0 def
-/_cy 0 def
-/_leading
-[
-0 0
-] def
-/_ctm matrix def
-/_mtx matrix def
-/_sp 16#020 def
-/_hyphen (-) def
-/_fScl 0 def
-/_cnt 0 def
-/_hs 1 def
-/_nativeEncoding 0 def
-/_useNativeEncoding 0 def
-/_tempEncode 0 def
-/_pntr 0 def
-/_tDict 2 dict def
-/_wv 0 def
-/Tx
-{
-} def
-/Tj
-{
-} def
-/CRender
-{
-} def
-/_AI3_savepage
-{
-} def
-/_gf null def
-/_cf 4 array def
-/_if null def
-/_of false def
-/_fc
-{
-} def
-/_gs null def
-/_cs 4 array def
-/_is null def
-/_os false def
-/_sc
-{
-} def
-/_pd 1 dict def
-/_ed 15 dict def
-/_pm matrix def
-/_fm null def
-/_fd null def
-/_fdd null def
-/_sm null def
-/_sd null def
-/_sdd null def
-/_i null def
-/discardSave null def
-/buffer 256 string def
-/beginString null def
-/endString null def
-/endStringLength null def
-/layerCnt 1 def
-/layerCount 1 def
-/perCent (%) 0 get def
-/perCentSeen? false def
-/newBuff null def
-/newBuffButFirst null def
-/newBuffLast null def
-/clipForward? false def
-end
-userdict /Adobe_Illustrator_AI5 known not {
- userdict /Adobe_Illustrator_AI5 91 dict put
-} if
-userdict /Adobe_Illustrator_AI5 get begin
-/initialize
-{
- Adobe_Illustrator_AI5 dup begin
- Adobe_Illustrator_AI5_vars begin
- discardDict
- {
- bind pop pop
- } forall
- dup /nc get begin
- {
- dup xcheck 1 index type /operatortype ne and
- {
- bind
- } if
- pop pop
- } forall
- end
- newpath
-} def
-/terminate
-{
- end
- end
-} def
-/_
-null def
-/ddef
-{
- Adobe_Illustrator_AI5_vars 3 1 roll put
-} def
-/xput
-{
- dup load dup length exch maxlength eq
- {
- dup dup load dup
- length 2 mul dict copy def
- } if
- load begin
- def
- end
-} def
-/npop
-{
- {
- pop
- } repeat
-} def
-/sw
-{
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
-} def
-/swj
-{
- dup 4 1 roll
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
- 6 2 roll /_cnt 0 ddef
- {
- 1 index eq
- {
- /_cnt _cnt 1 add ddef
- } if
- } forall
- pop
- exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop
-} def
-/ss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put pop
- gsave
- false charpath currentpoint
- 4 index setmatrix
- stroke
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 3 npop
-} def
-/jss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- gsave
- _sp eq
- {
- exch 6 index 6 index 6 index 5 -1 roll widthshow
- currentpoint
- }
- {
- false charpath currentpoint
- 4 index setmatrix stroke
- } ifelse
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 6 npop
-} def
-/sp
-{
- {
- 2 npop (0) exch
- 2 copy 0 exch put pop
- false charpath
- 2 copy rmoveto
- } exch cshow
- 2 npop
-} def
-/jsp
-{
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- _sp eq
- {
- exch 5 index 5 index 5 index 5 -1 roll widthshow
- }
- {
- false charpath
- } ifelse
- 2 copy rmoveto
- } exch cshow
- 5 npop
-} def
-/pl
-{
- transform
- 0.25 sub round 0.25 add exch
- 0.25 sub round 0.25 add exch
- itransform
-} def
-/setstrokeadjust where
-{
- pop true setstrokeadjust
- /c
- {
- curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll curveto
- } def
- /V
- /v load def
- /y
- {
- 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- lineto
- } def
- /L
- /l load def
- /m
- {
- moveto
- } def
-}
-{
- /c
- {
- pl curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll pl curveto
- } def
- /V
- /v load def
- /y
- {
- pl 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- pl lineto
- } def
- /L
- /l load def
- /m
- {
- pl moveto
- } def
-} ifelse
-/d
-{
- setdash
-} def
-/cf
-{
-} def
-/i
-{
- dup 0 eq
- {
- pop cf
- } if
- setflat
-} def
-/j
-{
- setlinejoin
-} def
-/J
-{
- setlinecap
-} def
-/M
-{
- setmiterlimit
-} def
-/w
-{
- setlinewidth
-} def
-/XR
-{
- 0 ne
- /_eo exch ddef
-} def
-/H
-{
-} def
-/h
-{
- closepath
-} def
-/N
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- _eo {eoclip} {clip} ifelse /_doClip 0 ddef
- } if
- newpath
- }
- {
- /CRender
- {
- N
- } ddef
- } ifelse
-} def
-/n
-{
- N
-} def
-/F
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc
- /_doClip 0 ddef
- }
- {
- _pf
- } ifelse
- }
- {
- /CRender
- {
- F
- } ddef
- } ifelse
-} def
-/f
-{
- closepath
- F
-} def
-/S
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- _ps
- } ifelse
- }
- {
- /CRender
- {
- S
- } ddef
- } ifelse
-} def
-/s
-{
- closepath
- S
-} def
-/B
-{
- _pola 0 eq
- {
- _doClip 1 eq
- gsave F grestore
- {
- gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- S
- } ifelse
- }
- {
- /CRender
- {
- B
- } ddef
- } ifelse
-} def
-/b
-{
- closepath
- B
-} def
-/W
-{
- /_doClip 1 ddef
-} def
-/*
-{
- count 0 ne
- {
- dup type /stringtype eq
- {
- pop
- } if
- } if
- newpath
-} def
-/u
-{
-} def
-/U
-{
-} def
-/q
-{
- _pola 0 eq
- {
- gsave
- } if
-} def
-/Q
-{
- _pola 0 eq
- {
- grestore
- } if
-} def
-/*u
-{
- _pola 1 add /_pola exch ddef
-} def
-/*U
-{
- _pola 1 sub /_pola exch ddef
- _pola 0 eq
- {
- CRender
- } if
-} def
-/D
-{
- pop
-} def
-/*w
-{
-} def
-/*W
-{
-} def
-/`
-{
- /_i save ddef
- clipForward?
- {
- nulldevice
- } if
- 6 1 roll 4 npop
- concat pop
- userdict begin
- /showpage
- {
- } def
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {pop false setstrokeadjust} if
- newpath
- 0 setgray
- false setoverprint
-} def
-/~
-{
- end
- _i restore
-} def
-/O
-{
- 0 ne
- /_of exch ddef
- /_lp /none ddef
-} def
-/R
-{
- 0 ne
- /_os exch ddef
- /_lp /none ddef
-} def
-/g
-{
- /_gf exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _gf setgray
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/G
-{
- /_gs exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _gs setgray
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/k
-{
- _cf astore pop
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _cf aload pop setcmykcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/K
-{
- _cs astore pop
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _cs aload pop setcmykcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/x
-{
- /_gf exch ddef
- findcmykcustomcolor
- /_if exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _if _gf 1 exch sub setcustomcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/X
-{
- /_gs exch ddef
- findcmykcustomcolor
- /_is exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _is _gs 1 exch sub setcustomcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/A
-{
- pop
-} def
-/annotatepage
-{
-userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse
-} def
-/XT {
- pop pop
-} def
-/discard
-{
- save /discardSave exch store
- discardDict begin
- /endString exch store
- gt38?
- {
- 2 add
- } if
- load
- stopped
- pop
- end
- discardSave restore
-} bind def
-userdict /discardDict 7 dict dup begin
-put
-/pre38Initialize
-{
- /endStringLength endString length store
- /newBuff buffer 0 endStringLength getinterval store
- /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store
- /newBuffLast newBuff endStringLength 1 sub 1 getinterval store
-} def
-/shiftBuffer
-{
- newBuff 0 newBuffButFirst putinterval
- newBuffLast 0
- currentfile read not
- {
- stop
- } if
- put
-} def
-0
-{
- pre38Initialize
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff endString eq
- {
- cleartomark stop
- } if
- shiftBuffer
- } loop
- }
- {
- stop
- } ifelse
-} def
-1
-{
- pre38Initialize
- /beginString exch store
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff beginString eq
- {
- /layerCount dup load 1 add store
- }
- {
- newBuff endString eq
- {
- /layerCount dup load 1 sub store
- layerCount 0 eq
- {
- cleartomark stop
- } if
- } if
- } ifelse
- shiftBuffer
- } loop
- } if
-} def
-2
-{
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- endString eq
- {
- cleartomark stop
- } if
- } loop
-} def
-3
-{
- /beginString exch store
- /layerCnt 1 store
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- dup beginString eq
- {
- pop /layerCnt dup load 1 add store
- }
- {
- endString eq
- {
- layerCnt 1 eq
- {
- cleartomark stop
- }
- {
- /layerCnt dup load 1 sub store
- } ifelse
- } if
- } ifelse
- } loop
-} def
-end
-userdict /clipRenderOff 15 dict dup begin
-put
-{
- /n /N /s /S /f /F /b /B
-}
-{
- {
- _doClip 1 eq
- {
- /_doClip 0 ddef _eo {eoclip} {clip} ifelse
- } if
- newpath
- } def
-} forall
-/Tr /pop load def
-/Bb {} def
-/BB /pop load def
-/Bg {12 npop} def
-/Bm {6 npop} def
-/Bc /Bm load def
-/Bh {4 npop} def
-end
-/Lb
-{
- 4 npop
- 6 1 roll
- pop
- 4 1 roll
- pop pop pop
- 0 eq
- {
- 0 eq
- {
- (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard
- }
- {
-
- /clipForward? true def
-
- /Tx /pop load def
- /Tj /pop load def
-
- currentdict end clipRenderOff begin begin
- } ifelse
- }
- {
- 0 eq
- {
- save /discardSave exch store
- } if
- } ifelse
-} bind def
-/LB
-{
- discardSave dup null ne
- {
- restore
- }
- {
- pop
- clipForward?
- {
- currentdict
- end
- end
- begin
-
- /clipForward? false ddef
- } if
- } ifelse
-} bind def
-/Pb
-{
- pop pop
- 0 (%AI5_EndPalette) discard
-} bind def
-/Np
-{
- 0 (%AI5_End_NonPrinting--) discard
-} bind def
-/Ln /pop load def
-/Ap
-/pop load def
-/Ar
-{
- 72 exch div
- 0 dtransform dup mul exch dup mul add sqrt
- dup 1 lt
- {
- pop 1
- } if
- setflat
-} def
-/Mb
-{
- q
-} def
-/Md
-{
-} def
-/MB
-{
- Q
-} def
-/nc 3 dict def
-nc begin
-/setgray
-{
- pop
-} bind def
-/setcmykcolor
-{
- 4 npop
-} bind def
-/setcustomcolor
-{
- 2 npop
-} bind def
-currentdict readonly pop
-end
-end
-setpacking
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%IncludeFont: Courier
-%%IncludeFont: Univers
-Adobe_level2_AI5 /initialize get exec
-Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec
-Adobe_ColorImage_AI6 /initialize get exec
-Adobe_Illustrator_AI5 /initialize get exec
-[
-39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
-/Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
-/egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
-/oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
-/udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
-/registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
-/.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
-/.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
-/questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
-/guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
-/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
-/.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
-/fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
-/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
-/Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
-/Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
-/hungarumlaut/ogonek/caron
-TE
-%AI3_BeginEncoding: _Courier Courier
-[/_Courier/Courier 0 0 1 TZ
-%AI3_EndEncoding TrueType
-%AI3_BeginEncoding: _Univers Univers
-[/_Univers/Univers 0 0 1 TZ
-%AI3_EndEncoding AdobeType
-%AI5_Begin_NonPrinting
-Np
-8 Bn
-%AI5_BeginGradient: (Black & White)
-(Black & White) 0 2 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Green & Blue)
-(Green & Blue) 0 2 Bd
-[
-<
-99999A9A9B9B9B9C9C9D9D9D9E9E9F9F9FA0A0A1A1A1A2A2A3A3A3A4A4A5A5A5A6A6A7A7A7A8A8A9
-A9A9AAAAABABABACACADADADAEAEAFAFAFB0B0B1B1B1B2B2B3B3B3B4B4B5B5B5B6B6B7B7B7B8B8B9
-B9B9BABABBBBBBBCBCBDBDBDBEBEBFBFBFC0C0C1C1C1C2C2C3C3C3C4C4C5C5C5C6C6C7C7C7C8C8C9
-C9C9CACACBCBCBCCCCCDCDCDCECECFCFCFD0D0D1D1D1D2D2D3D3D3D4D4D5D5D5D6D6D7D7D7D8D8D9
-D9D9DADADBDBDBDCDCDDDDDDDEDEDFDFDFE0E0E1E1E1E2E2E3E3E3E4E4E5E5E5E6E6E7E7E7E8E8E9
-E9E9EAEAEBEBEBECECEDEDEDEEEEEFEFEFF0F0F1F1F1F2F2F3F3F3F4F4F5F5F5F6F6F7F7F7F8F8F9
-F9F9FAFAFBFBFBFCFCFDFDFDFEFEFFFF
->
-<
-000102020304050506070808090A0B0B0C0D0E0E0F101111121314141516171718191A1A1B1C1D1D
-1E1F20202122232324252626272829292A2B2C2C2D2E2F2F303132323334353536373838393A3B3B
-3C3D3E3E3F404141424344444546474748494A4A4B4C4D4D4E4F5050515253535455565657585959
-5A5B5C5C5D5E5F5F606162626364656566676868696A6B6B6C6D6E6E6F7071717273747475767777
-78797A7A7B7C7D7D7E7F80808182828384858586878888898A8B8B8C8D8E8E8F9091919293949495
-96979798999A9A9B9C9D9D9E9FA0A0A1A2A3A3A4A5A6A6A7A8A9A9AAABACACADAEAFAFB0B1B2B2B3
-B4B5B5B6B7B8B8B9BABBBBBCBDBEBEBF
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-[
-1 0.75 0 0 1 50 100 %_Bs
-0.6 0 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Pink, Yellow, Green)
-(Pink, Yellow, Green) 0 3 Bd
-[
-<
-00000000000000000000000000000000000000010101010101010101010101010101010101010101
-01010101010202020202020202020202020202020202020202020203030303030303030303030303
-03030303030303030404040404040404040404040404040404040404050505050505050505050505
-05050505050505060606060606060606060606060606060606060707070707070707070707070707
-07070707080808080808080808080808080808080809090909090909090909090909090909090A0A
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0C
-0C0C0C0C0C0C0C0D0D0D0D0D
->
-<
-050506060606070708080809090A0A0A0B0B0C0C0D0D0E0E0F0F1010111112121313141415151617
-17181819191A1A1B1C1C1D1D1E1F1F202021222223232425252626272828292A2A2B2C2C2D2D2E2F
-2F3031313233333435353637373839393A3B3B3C3D3E3E3F4040414242434445454647474849494A
-4B4C4C4D4E4F4F505151525354545556575758595A5A5B5C5C5D5E5F5F6061626363646566666768
-69696A6B6C6C6D6E6F707071727373747576777778797A7B7B7C7D7E7F7F80818283838485868787
-88898A8B8B8C8D8E8F8F9091929394949596979898999A9B9C9D9D9E9FA0A1A2A2A3A4A5A6A7A7A8
-A9AAABACADADAEAFB0B1B2B2
->
-<
-CCCCCBCBCBCACACAC9C9C8C8C7C7C6C6C5C5C4C4C3C2C2C1C1C0C0BFBEBEBDBDBCBBBBBAB9B9B8B7
-B7B6B6B5B4B4B3B2B1B1B0AFAFAEADADACABAAAAA9A8A8A7A6A5A5A4A3A2A2A1A0A09F9E9D9C9C9B
-9A999998979696959493929291908F8E8E8D8C8B8A8A8988878686858483828181807F7E7D7C7C7B
-7A7978777776757473727171706F6E6D6C6B6A6A69686766656463636261605F5E5D5C5B5B5A5958
-5756555453525151504F4E4D4C4B4A49484746464544434241403F3E3D3C3B3A3938383736353433
-3231302F2E2D2C2B2A29282726252423222221201F1E1D1C1B1A191817161514131211100F0E0D0C
-0B0A09080706050403020100
->
-0
-1 %_Br
-<
-737271706F6E6D6C6B6A696867666564636261605F5E5D5C5B5B5A59585756555453525150504F4E
-4D4C4B4A4949484746454443434241403F3E3E3D3C3B3A3A393837363635343333323130302F2E2D
-2D2C2B2A2A29282827262525242323222121201F1F1E1D1D1C1C1B1A1A1918181717161615141413
-1312121111100F0F0E0E0D0D0C0C0C0B0B0A0A090908080807070606060505050404040303030202
-020201010101010000000000
->
-<
-00000000000000000000000001010101010101010101010101010101010101010101010102020202
-02020202020202020202020202020202020202020202030303030303030303030303030303030303
-03030303030303030303030303040404040404040404040404040404040404040404040404040404
-04040404040404040404050505050505050505050505050505050505050505050505050505050505
-050505050505050505050505
->
-<
-BFBFBFC0C0C0C0C0C0C0C0C0C1C1C1C1C1C1C1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C3C3
-C3C4C4C4C4C4C4C4C4C4C4C5C5C5C5C5C5C5C5C5C5C5C6C6C6C6C6C6C6C6C6C6C6C6C7C7C7C7C7C7
-C7C7C7C7C7C7C8C8C8C8C8C8C8C8C8C8C8C8C8C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9CACACACACACA
-CACACACACACACACACACACBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCCCCCCCCCCCCCCCC
-CCCCCCCCCCCCCCCCCCCCCCCC
->
-0
-1 %_Br
-[
-0.05 0.7 0 0 1 50 100 %_Bs
-0 0.02 0.8 0 1 57 36 %_Bs
-0.45 0 0.75 0 1 37 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Purple, Red & Yellow)
-(Purple, Red & Yellow) 0 3 Bd
-[
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A
->
-<
-CCCCCCCDCDCDCDCDCECECECECECFCFCFCFD0D0D0D0D0D1D1D1D1D1D2D2D2D2D2D3D3D3D3D3D4D4D4
-D4D5D5D5D5D5D6D6D6D6D6D7D7D7D7D7D8D8D8D8D8D9D9D9D9DADADADADADBDBDBDBDBDCDCDCDCDC
-DDDDDDDDDDDEDEDEDEDFDFDFDFDFE0E0E0E0E0E1E1E1E1E1E2E2E2E2E2E3E3E3E3E4E4E4E4E4E5E5
-E5E5E5E6E6E6E6E6E7E7E7E7E7E8E8E8E8E9E9E9E9E9EAEAEAEAEAEBEBEBEBEBECECECECECEDEDED
-EDEEEEEEEEEEEFEFEFEFEFF0F0F0F0F0F1F1F1F1F1F2F2F2F2F3F3F3F3F3F4F4F4F4F4F5F5F5F5F5
-F6F6F6F6F6F7F7F7F7F8F8F8F8F8F9F9F9F9F9FAFAFAFAFAFBFBFBFBFBFCFCFCFCFDFDFDFDFDFEFE
-FEFEFEFFFFFF
->
-0
-1 %_Br
-<
-E5E4E3E2E1E0DFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBE
-BDBCBBBAB9B8B7B6B5B4B3B2B1B0AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A99989796
-9594939291908F8E8D8C8B8A898887868584838281807F7E7D7C7B7A797877767574737271706F6E
-6D6C6B6A696867666564636261605F5E5D5C5B5A595857565554535251504F4E4D4C4B4A49484746
-4544434241403F3E3D3C3B3A393837363534333231302F2E2D2C2B2A292827262524232221201F1E
-1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
->
-<
-E5E6E6E6E6E6E6E6E6E7E7E7E7E7E7E7E7E7E8E8E8E8E8E8E8E8E8E9E9E9E9E9E9E9E9E9EAEAEAEA
-EAEAEAEAEAEBEBEBEBEBEBEBEBEBECECECECECECECECECEDEDEDEDEDEDEDEDEDEEEEEEEEEEEEEEEE
-EEEFEFEFEFEFEFEFEFEFF0F0F0F0F0F0F0F0F0F1F1F1F1F1F1F1F1F1F2F2F2F2F2F2F2F2F2F3F3F3
-F3F3F3F3F3F3F4F4F4F4F4F4F4F4F4F5F5F5F5F5F5F5F5F5F6F6F6F6F6F6F6F6F6F7F7F7F7F7F7F7
-F7F7F8F8F8F8F8F8F8F8F8F9F9F9F9F9F9F9F9F9FAFAFAFAFAFAFAFAFAFBFBFBFBFBFBFBFBFBFCFC
-FCFCFCFCFCFCFCFDFDFDFDFDFDFDFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFF
->
-<
-00010203040405060708090A0B0C0C0D0E0F10111213141415161718191A1B1C1D1D1E1F20212223
-242525262728292A2B2C2D2D2E2F30313233343535363738393A3B3C3D3D3E3F4041424344454546
-4748494A4B4C4D4E4E4F50515253545556565758595A5B5C5D5E5E5F60616263646566666768696A
-6B6C6D6E6E6F70717273747576767778797A7B7C7D7E7F7F80818283848586878788898A8B8C8D8E
-8F8F90919293949596979798999A9B9C9D9E9F9FA0A1A2A3A4A5A6A7A7A8A9AAABACADAEAFAFB0B1
-B2B3B4B5B6B7B8B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C8C9CACBCC
->
-0
-1 %_Br
-[
-0 0.04 1 0 1 50 100 %_Bs
-0 1 0.8 0 1 50 50 %_Bs
-0.9 0.9 0 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Rainbow)
-(Rainbow) 0 6 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-0
-1 %_Br
-1
-<
-0708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E
-2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556
-5758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E
-7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6
-A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCE
-CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6
-F7F8F9FAFBFCFDFEFF
->
-0
-0
-1 %_Br
-1
-<
-00000000000000000000000000000000000001010101010101010101010101010101010101010101
-01010101010101010101010101010202020202020202020202020202020202020202020202020202
-02020202020202020202030303030303030303030303030303030303030303030303030303030303
-03030303030304040404040404040404040404040404040404040404040404040404040404040404
-04040505050505050505050505050505050505050505050505050505050505050505050505050606
-06060606060606060606060606060606060606060606060606060606060606060606070707070707
-07070707070707070707070707070707
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0
-1
-0
-1 %_Br
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-1 %_Br
-[
-0 1 0 0 1 50 100 %_Bs
-1 1 0 0 1 50 80 %_Bs
-1 0.0279 0 0 1 50 60 %_Bs
-1 0 1 0 1 50 40 %_Bs
-0 0 1 0 1 50 20 %_Bs
-0 1 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Steel Bar)
-(Steel Bar) 0 3 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 70 %_Bs
-0 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Orange Radial)
-(Yellow & Orange Radial) 1 2 Bd
-[
-0
-<
-0001010203040506060708090A0B0C0C0D0E0F10111213131415161718191A1B1C1D1D1E1F202122
-232425262728292A2B2B2C2D2E2F303132333435363738393A3B3C3D3E3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60606162636465666768696A6B6C6D6E6F
-707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C
->
-<
-FFFFFFFFFEFEFEFEFEFEFEFDFDFDFDFDFDFCFCFCFCFCFCFBFBFBFBFBFBFAFAFAFAFAFAF9F9F9F9F9
-F9F8F8F8F8F8F8F7F7F7F7F7F7F6F6F6F6F6F6F5F5F5F5F5F5F4F4F4F4F4F3F3F3F3F3F3F2F2F2F2
-F2F2F1F1F1F1F1F0F0F0F0F0F0EFEFEFEFEFEFEEEEEEEEEEEDEDEDEDEDEDECECECECECEBEBEBEBEB
-EBEAEAEAEAEAE9E9E9E9E9E9E8E8E8E8E8E8E7E7E7E7E7E6E6E6E6E6E5
->
-0
-1 %_Br
-[
-0 0 1 0 1 52 19 %_Bs
-0 0.55 0.9 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Purple Radial)
-(Yellow & Purple Radial) 1 2 Bd
-[
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-<
-1415161718191A1B1C1D1E1F1F202122232425262728292A2A2B2C2D2E2F30313233343536363738
-393A3B3C3D3E3F40414142434445464748494A4B4C4D4D4E4F50515253545556575858595A5B5C5D
-5E5F60616263646465666768696A6B6C6D6E6F6F707172737475767778797A7B7B7C7D7E7F808182
-83848586868788898A8B8C8D8E8F90919292939495969798999A9B9C9D9D9E9FA0A1A2A3A4A5A6A7
-A8A9A9AAABACADAEAFB0B1B2B3B4B4B5B6B7B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C9CACBCB
-CCCDCECFD0D1D2D3D4D5D6D7D7D8D9DADBDCDDDEDFE0E1E2E2E3E4E5E6E7E8E9EAEBECEDEEEEEFF0
-F1F2F3F4F5F6F7F8F9F9FAFBFCFDFEFF
->
-<
-ABAAAAA9A8A7A7A6A5A5A4A3A3A2A1A1A09F9F9E9D9D9C9B9B9A9999989797969595949393929191
-908F8F8E8D8D8C8B8B8A8989888787868585848383828181807F7F7E7D7D7C7B7B7A797978777776
-7575747373727171706F6F6E6D6D6C6B6B6A6969686767666565646362626160605F5E5E5D5C5C5B
-5A5A5958585756565554545352525150504F4E4E4D4C4C4B4A4A4948484746464544444342424140
-403F3E3E3D3C3C3B3A3A3938383736363534343332323130302F2E2E2D2C2C2B2A2A292828272626
-25242423222121201F1F1E1D1D1C1B1B1A1919181717161515141313121111100F0F0E0D0D0C0B0B
-0A090908070706050504030302010100
->
-0
-1 %_Br
-[
-0 0.08 0.67 0 1 50 14 %_Bs
-1 1 0 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_End_NonPrinting--
-%AI5_BeginPalette
-0 0 Pb
-Pn
-Pc
-1 g
-Pc
-0 g
-Pc
-0 0 0 0 k
-Pc
-0.75 g
-Pc
-0.5 g
-Pc
-0.25 g
-Pc
-0 g
-Pc
-Bb
-2 (Black & White) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0 0 0 k
-Pc
-0.5 0 0 0 k
-Pc
-0.75 0 0 0 k
-Pc
-1 0 0 0 k
-Pc
-0.25 0.25 0 0 k
-Pc
-0.5 0.5 0 0 k
-Pc
-0.75 0.75 0 0 k
-Pc
-1 1 0 0 k
-Pc
-Bb
-2 (Pink, Yellow, Green) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0 0 k
-Pc
-0 0.5 0 0 k
-Pc
-0 0.75 0 0 k
-Pc
-0 1 0 0 k
-Pc
-0 0.25 0.25 0 k
-Pc
-0 0.5 0.5 0 k
-Pc
-0 0.75 0.75 0 k
-Pc
-0 1 1 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Purple Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0 0.25 0 k
-Pc
-0 0 0.5 0 k
-Pc
-0 0 0.75 0 k
-Pc
-0 0 1 0 k
-Pc
-0.25 0 0.25 0 k
-Pc
-0.5 0 0.5 0 k
-Pc
-0.75 0 0.75 0 k
-Pc
-1 0 1 0 k
-Pc
-Bb
-2 (Rainbow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0 0 k
-Pc
-0.5 0.25 0 0 k
-Pc
-0.75 0.375 0 0 k
-Pc
-1 0.5 0 0 k
-Pc
-0.125 0.25 0 0 k
-Pc
-0.25 0.5 0 0 k
-Pc
-0.375 0.75 0 0 k
-Pc
-0.5 1 0 0 k
-Pc
-Bb
-2 (Steel Bar) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0.125 0 k
-Pc
-0 0.5 0.25 0 k
-Pc
-0 0.75 0.375 0 k
-Pc
-0 1 0.5 0 k
-Pc
-0 0.125 0.25 0 k
-Pc
-0 0.25 0.5 0 k
-Pc
-0 0.375 0.75 0 k
-Pc
-0 0.5 1 0 k
-Pc
-Bb
-2 (Purple, Red & Yellow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0 0.25 0 k
-Pc
-0.25 0 0.5 0 k
-Pc
-0.375 0 0.75 0 k
-Pc
-0.5 0 1 0 k
-Pc
-0.25 0 0.125 0 k
-Pc
-0.5 0 0.25 0 k
-Pc
-0.75 0 0.375 0 k
-Pc
-1 0 0.5 0 k
-Pc
-Bb
-2 (Green & Blue) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0.125 0 k
-Pc
-0.5 0.25 0.25 0 k
-Pc
-0.75 0.375 0.375 0 k
-Pc
-1 0.5 0.5 0 k
-Pc
-0.25 0.25 0.125 0 k
-Pc
-0.5 0.5 0.25 0 k
-Pc
-0.75 0.75 0.375 0 k
-Pc
-1 1 0.5 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Orange Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0.25 0.125 0 k
-Pc
-0.25 0.5 0.25 0 k
-Pc
-0.375 0.75 0.375 0 k
-Pc
-0.5 1 0.5 0 k
-Pc
-0.125 0.25 0.25 0 k
-Pc
-0.25 0.5 0.5 0 k
-Pc
-0.375 0.75 0.75 0 k
-Pc
-0.5 1 1 0 k
-Pc
-0 0 0 0 k
-Pc
-0.125 0.125 0.25 0 k
-Pc
-0.25 0.25 0.5 0 k
-Pc
-0.375 0.375 0.75 0 k
-Pc
-0.5 0.5 1 0 k
-Pc
-0.25 0.125 0.25 0 k
-Pc
-0.5 0.25 0.5 0 k
-Pc
-0.75 0.375 0.75 0 k
-Pc
-1 0.5 1 0 k
-Pc
-PB
-%AI5_EndPalette
-%%EndSetup
-%AI5_BeginLayer
-1 1 1 1 0 0 0 79 128 255 Lb
-(Layer 1) Ln
-0 A
-800 Ar
-0 J 0 j 1 w 4 M []0 d
-%AI3_Note:
-0 D
-0 XR
--4014 283.5 m
-4626 283.5 L
-(N) *
-453.5 4716 m
-453.5 -3924 L
-(N) *
-85 4716 m
-85 -3924 L
-(N) *
--4014 765.5 m
-4626 765.5 L
-(N) *
-1 Ap
-0 O
-1 g
-0 R
-0 G
-220.8907 672 m
-220.8907 703 L
-127.6667 703 L
-127.3474 672 L
-220.8907 672 L
-b
-0 Ap
-163.119 702.4773 m
-163.119 687.9773 l
-220.619 687.9773 l
-S
-0 To
-1 0 0 1 130.119 689.9773 0 Tp
-TP
-0 Tr
-0 O
-0 g
-/_Univers 10 Tf
-0 Ts
-100 Tz
-0 Tt
-1 TA
-%_ 0 XL
-36 0 Xb
-XB
-0 0 5 TC
-100 100 200 TW
-0 0 0 Ti
-0 Ta
-0 0 2 2 3 Th
-0 Tq
-0 0 Tl
-0 Tc
-0 Tw
-(Binary\r) Tx
-0 -12 Td
-(Representation) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 169.119 690.4773 0 Tp
-TP
-0 Tr
-(file.bin) Tx
-(\r) TX
-TO
-1 Ap
-1 g
-0 R
-0 G
-436 672 m
-436 743.1667 L
-237 743.1667 L
-237 672 L
-436 672 L
-b
-0 To
-1 0 0 1 246 730.5 0 Tp
-TP
-0 Tr
-0 g
-(Instrumentation) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 246 713.5 0 Tp
-TP
-0 Tr
-/_Courier 10 Tf
-(sysCFunc\(get, ...\) ->) Tx
-(\r) TX
-0 -12 Td
-( <code>;) Tx
-(\r) TX
-0 -12 Td
-(sysCFunc\(set, ...\) ->) Tx
-(\r) TX
-0 -12 Td
-( <code>.) Tx
-(\r) TX
-TO
-0 Ap
-0 R
-0 G
-237 726 m
-436 726 l
-S
-334 743 m
-334 726 l
-S
-0 To
-1 0 0 1 344.5 730.5 0 Tp
-TP
-0 Tr
-0 O
-0 g
-/_Univers 10 Tf
-(mymod.beam) Tx
-(\r) TX
-TO
-u
-u
-u
-u
-1 g
-0 R
-0 G
-170 672 m
-248.8065 637.7501 l
-B
-0 g
-251.3813 637.7486 m
-250.0639 638.8655 249.2617 639.7157 248.2574 640.7327 c
-246.2468 636.1064 l
-246.772 636.1237 248.8445 636.0596 250.5596 635.8582 c
-252.3955 635.6433 254.0128 635.339 255.0193 635.0439 c
-254.1168 635.5784 252.791 636.5532 251.3813 637.7486 c
-f
-U
-U
-U
-U
-u
-u
-u
-0 R
-0 G
-368.3333 672 m
-289.672 637.3964 l
-S
-0 O
-0 g
-287.9227 635.5072 m
-289.637 635.716 290.8059 635.7276 292.2345 635.7744 c
-290.2033 640.3917 l
-289.8594 639.9944 288.4051 638.5164 287.0927 637.394 c
-285.6884 636.192 284.3669 635.2113 283.4669 634.6728 c
-284.472 634.9724 286.0879 635.2839 287.9227 635.5072 c
-f
-U
-U
-U
-u
-1 Ap
-0 R
-0 G
-268 592.9803 m
-287.5689 592.9803 303.4331 602.4988 303.4331 614.2401 c
-303.4331 625.9815 287.5689 635.5 268 635.5 c
-248.4311 635.5 232.5669 625.9815 232.5669 614.2401 c
-232.5669 602.4988 248.4311 592.9803 268 592.9803 c
-s
-0 To
-1 0 0 1 268 610.8063 0 Tp
-TP
--14.1614 0 Td
-0 Tr
-0 O
-0 g
-1 Ta
-(Agent) Tx
-(\r) TX
-TO
-U
-LB
-%AI5_EndLayer--
-%%PageTrailer
-gsave annotatepage grestore showpage
-%%Trailer
-Adobe_Illustrator_AI5 /terminate get exec
-Adobe_ColorImage_AI6 /terminate get exec
-Adobe_typography_AI5 /terminate get exec
-Adobe_level2_AI5 /terminate get exec
-%%EOF
diff --git a/lib/snmp/doc/src/snmp-um-1-image-3.ps b/lib/snmp/doc/src/snmp-um-1-image-3.ps
deleted file mode 100644
index 6c63c88f87..0000000000
--- a/lib/snmp/doc/src/snmp-um-1-image-3.ps
+++ /dev/null
@@ -1,3400 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: Adobe Illustrator(r) 6.0
-%%For: (Anna Fedoriw) (Ericsson Telecom)
-%%Title: (Architecture.eps)
-%%CreationDate: (97-05-23) (14.03)
-%%BoundingBox: 93 465 440 765
-%%HiResBoundingBox: 93.3333 465.1667 439.8333 764.3677
-%%DocumentProcessColors: Black
-%%DocumentFonts: Univers
-%%DocumentSuppliedResources: procset Adobe_level2_AI5 1.0 0
-%%+ procset Adobe_typography_AI5 1.0 0
-%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6
-%%+ procset Adobe_Illustrator_AI5 1.0 0
-%AI5_FileFormat 2.0
-%AI3_ColorUsage: Black&White
-%%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set)
-%%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1
-%%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 ()
-%AI3_TemplateBox: 306 396 306 396
-%AI3_TileBox: 21 -12 588 802
-%AI3_DocumentPreview: Macintosh_ColorPic
-%AI5_ArtSize: 595.2756 841.8898
-%AI5_RulerUnits: 1
-%AI5_ArtFlags: 0 0 0 1 0 0 1 1 0
-%AI5_TargetResolution: 800
-%AI5_NumLayers: 1
-%AI5_OpenToView: 194 764 3 1146 827 58 1 1 3 40
-%AI5_OpenViewLayers: 7
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset Adobe_level2_AI5 1.2 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation)
-%%Version: 1.2
-%%CreationDate: (04/10/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-userdict /Adobe_level2_AI5 23 dict dup begin
- put
- /packedarray where not
- {
- userdict begin
- /packedarray
- {
- array astore readonly
- } bind def
- /setpacking /pop load def
- /currentpacking false def
- end
- 0
- } if
- pop
- userdict /defaultpacking currentpacking put true setpacking
- /initialize
- {
- Adobe_level2_AI5 begin
- } bind def
- /terminate
- {
- currentdict Adobe_level2_AI5 eq
- {
- end
- } if
- } bind def
- mark
- /setcustomcolor where not
- {
- /findcmykcustomcolor
- {
- 5 packedarray
- } bind def
- /setcustomcolor
- {
- exch aload pop pop
- 4
- {
- 4 index mul 4 1 roll
- } repeat
- 5 -1 roll pop
- setcmykcolor
- }
- def
- } if
-
- /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def
- userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put
- userdict /level2?
- systemdict /languagelevel known dup
- {
- pop systemdict /languagelevel get 2 ge
- } if
- put
-/level2ScreenFreq
-{
- begin
- 60
- HalftoneType 1 eq
- {
- pop Frequency
- } if
- HalftoneType 2 eq
- {
- pop GrayFrequency
- } if
- HalftoneType 5 eq
- {
- pop Default level2ScreenFreq
- } if
- end
-} bind def
-userdict /currentScreenFreq
- level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put
-level2? not
- {
- /setcmykcolor where not
- {
- /setcmykcolor
- {
- exch .11 mul add exch .59 mul add exch .3 mul add
- 1 exch sub setgray
- } def
- } if
- /currentcmykcolor where not
- {
- /currentcmykcolor
- {
- 0 0 0 1 currentgray sub
- } def
- } if
- /setoverprint where not
- {
- /setoverprint /pop load def
- } if
- /selectfont where not
- {
- /selectfont
- {
- exch findfont exch
- dup type /arraytype eq
- {
- makefont
- }
- {
- scalefont
- } ifelse
- setfont
- } bind def
- } if
- /cshow where not
- {
- /cshow
- {
- [
- 0 0 5 -1 roll aload pop
- ] cvx bind forall
- } bind def
- } if
- } if
- cleartomark
- /anyColor?
- {
- add add add 0 ne
- } bind def
- /testColor
- {
- gsave
- setcmykcolor currentcmykcolor
- grestore
- } bind def
- /testCMYKColorThrough
- {
- testColor anyColor?
- } bind def
- userdict /composite?
- level2?
- {
- gsave 1 1 1 1 setcmykcolor currentcmykcolor grestore
- add add add 4 eq
- }
- {
- 1 0 0 0 testCMYKColorThrough
- 0 1 0 0 testCMYKColorThrough
- 0 0 1 0 testCMYKColorThrough
- 0 0 0 1 testCMYKColorThrough
- and and and
- } ifelse
- put
- composite? not
- {
- userdict begin
- gsave
- /cyan? 1 0 0 0 testCMYKColorThrough def
- /magenta? 0 1 0 0 testCMYKColorThrough def
- /yellow? 0 0 1 0 testCMYKColorThrough def
- /black? 0 0 0 1 testCMYKColorThrough def
- grestore
- /isCMYKSep? cyan? magenta? yellow? black? or or or def
- /customColor? isCMYKSep? not def
- end
- } if
- end defaultpacking setpacking
-%%EndResource
-%%BeginResource: procset Adobe_typography_AI5 1.0 1
-%%Title: (Typography Operators)
-%%Version: 1.0
-%%CreationDate:(03/26/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_typography_AI5 54 dict dup begin
-put
-/initialize
-{
- begin
- begin
- Adobe_typography_AI5 begin
- Adobe_typography_AI5
- {
- dup xcheck
- {
- bind
- } if
- pop pop
- } forall
- end
- end
- end
- Adobe_typography_AI5 begin
-} def
-/terminate
-{
- currentdict Adobe_typography_AI5 eq
- {
- end
- } if
-} def
-/modifyEncoding
-{
- /_tempEncode exch ddef
- /_pntr 0 ddef
- {
- counttomark -1 roll
- dup type dup /marktype eq
- {
- pop pop exit
- }
- {
- /nametype eq
- {
- _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
- put
- }
- {
- /_pntr exch ddef
- } ifelse
- } ifelse
- } loop
- _tempEncode
-} def
-/TE
-{
- StandardEncoding 256 array copy modifyEncoding
- /_nativeEncoding exch def
-} def
-%
-/TZ
-{
- dup type /arraytype eq
- {
- /_wv exch def
- }
- {
- /_wv 0 def
- } ifelse
- /_useNativeEncoding exch def
- pop pop
- findfont _wv type /arraytype eq
- {
- _wv makeblendedfont
- } if
- dup length 2 add dict
- begin
- mark exch
- {
- 1 index /FID ne
- {
- def
- } if
- cleartomark mark
- } forall
- pop
- /FontName exch def
- counttomark 0 eq
- {
- 1 _useNativeEncoding eq
- {
- /Encoding _nativeEncoding def
- } if
- cleartomark
- }
- {
- /Encoding load 256 array copy
- modifyEncoding /Encoding exch def
- } ifelse
- FontName currentdict
- end
- definefont pop
-} def
-/tr
-{
- _ax _ay 3 2 roll
-} def
-/trj
-{
- _cx _cy _sp _ax _ay 6 5 roll
-} def
-/a0
-{
- /Tx
- {
- dup
- currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- } ddef
- /Tj
- {
- dup
- currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- } ddef
-} def
-/a1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/e0
-{
- /Tx
- {
- tr _psf
- } ddef
- /Tj
- {
- trj _pjsf
- } ddef
-} def
-/e1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- tr _psf
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- trj _pjsf
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/i0
-{
- /Tx
- {
- tr sp
- } ddef
- /Tj
- {
- trj jsp
- } ddef
-} def
-/i1
-{
- W N
-} def
-/o0
-{
- /Tx
- {
- tr sw rmoveto
- } ddef
- /Tj
- {
- trj swj rmoveto
- } ddef
-} def
-/r0
-{
- /Tx
- {
- tr _ctm _pss
- } ddef
- /Tj
- {
- trj _ctm _pjss
- } ddef
-} def
-/r1
-{
- /Tx
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/To
-{
- pop _ctm currentmatrix pop
-} def
-/TO
-{
- iTe _ctm setmatrix newpath
-} def
-/Tp
-{
- pop _tm astore pop _ctm setmatrix
- _tDict begin
- /W
- {
- } def
- /h
- {
- } def
-} def
-/TP
-{
- end
- iTm 0 0 moveto
-} def
-/Tr
-{
- _render 3 le
- {
- currentpoint newpath moveto
- } if
- dup 8 eq
- {
- pop 0
- }
- {
- dup 9 eq
- {
- pop 1
- } if
- } ifelse
- dup /_render exch ddef
- _renderStart exch get load exec
-} def
-/iTm
-{
- _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
-} def
-/Tm
-{
- _tm astore pop iTm 0 0 moveto
-} def
-/Td
-{
- _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
-} def
-/iTe
-{
- _render -1 eq
- {
- }
- {
- _renderEnd _render get dup null ne
- {
- load exec
- }
- {
- pop
- } ifelse
- } ifelse
- /_render -1 ddef
-} def
-/Ta
-{
- pop
-} def
-/Tf
-{
- dup 1000 div /_fScl exch ddef
-%
- selectfont
-} def
-/Tl
-{
- pop
- 0 exch _leading astore pop
-} def
-/Tt
-{
- pop
-} def
-/TW
-{
- 3 npop
-} def
-/Tw
-{
- /_cx exch ddef
-} def
-/TC
-{
- 3 npop
-} def
-/Tc
-{
- /_ax exch ddef
-} def
-/Ts
-{
- /_rise exch ddef
- currentpoint
- iTm
- moveto
-} def
-/Ti
-{
- 3 npop
-} def
-/Tz
-{
- 100 div /_hs exch ddef
- iTm
-} def
-/TA
-{
- pop
-} def
-/Tq
-{
- pop
-} def
-/Th
-{
- pop pop pop pop pop
-} def
-/TX
-{
- pop
-} def
-/Tk
-{
- exch pop _fScl mul neg 0 rmoveto
-} def
-/TK
-{
- 2 npop
-} def
-/T*
-{
- _leading aload pop neg Td
-} def
-/T*-
-{
- _leading aload pop Td
-} def
-/T-
-{
- _ax neg 0 rmoveto
- _hyphen Tx
-} def
-/T+
-{
-} def
-/TR
-{
- _ctm currentmatrix pop
- _tm astore pop
- iTm 0 0 moveto
-} def
-/TS
-{
- currentfont 3 1 roll
- /_Symbol_ _fScl 1000 mul selectfont
-
- 0 eq
- {
- Tx
- }
- {
- Tj
- } ifelse
- setfont
-} def
-/Xb
-{
- pop pop
-} def
-/Tb /Xb load def
-/Xe
-{
- pop pop pop pop
-} def
-/Te /Xe load def
-/XB
-{
-} def
-/TB /XB load def
-currentdict readonly pop
-end
-setpacking
-%%EndResource
-%%BeginProcSet: Adobe_ColorImage_AI6 1.0 0
-userdict /Adobe_ColorImage_AI6 known not
-{
- userdict /Adobe_ColorImage_AI6 17 dict put
-} if
-userdict /Adobe_ColorImage_AI6 get begin
-
- /initialize
- {
- Adobe_ColorImage_AI6 begin
- Adobe_ColorImage_AI6
- {
- dup type /arraytype eq
- {
- dup xcheck
- {
- bind
- } if
- } if
- pop pop
- } forall
- } def
- /terminate { end } def
-
- currentdict /Adobe_ColorImage_AI6_Vars known not
- {
- /Adobe_ColorImage_AI6_Vars 14 dict def
- } if
-
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 0 def
- /sourcecount 0 def
- /sourcearray 4 array def
- /plateindex -1 def
- /XIMask 0 def
- /XIBinary 0 def
- /XIChannelCount 0 def
- /XIBitsPerPixel 0 def
- /XIImageHeight 0 def
- /XIImageWidth 0 def
- /XIImageMatrix null def
- /XIBuffer null def
- /XIDataProc null def
- end
-
- /WalkRGBString null def
- /WalkCMYKString null def
-
- /StuffRGBIntoGrayString null def
- /RGBToGrayImageProc null def
- /StuffCMYKIntoGrayString null def
- /CMYKToGrayImageProc null def
- /ColorImageCompositeEmulator null def
-
- /SeparateCMYKImageProc null def
-
- /FourEqual null def
- /TestPlateIndex null def
-
- currentdict /_colorimage known not
- {
- /colorimage where
- {
- /colorimage get /_colorimage exch def
- }
- {
- /_colorimage null def
- } ifelse
- } if
-
- /_currenttransfer systemdict /currenttransfer get def
-
- /colorimage null def
- /XI null def
-
-
- /WalkRGBString
- {
- 0 3 index
-
- dup length 1 sub 0 3 3 -1 roll
- {
- 3 getinterval { } forall
-
- 5 index exec
-
- 3 index
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /WalkCMYKString
- {
- 0 3 index
-
- dup length 1 sub 0 4 3 -1 roll
- {
- 4 getinterval { } forall
-
- 6 index exec
-
- 3 index
-
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /StuffRGBIntoGrayString
- {
- .11 mul exch
-
- .59 mul add exch
-
- .3 mul add
-
- cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /RGBToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 3 idiv string
- dup 3 1 roll
-
- /StuffRGBIntoGrayString load exch
- WalkRGBString
- end
- } def
-
-
- /StuffCMYKIntoGrayString
- {
- exch .11 mul add
-
- exch .59 mul add
-
- exch .3 mul add
-
- dup 255 gt { pop 255 } if
-
- 255 exch sub cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /CMYKToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 4 idiv string
- dup 3 1 roll
-
- /StuffCMYKIntoGrayString load exch
- WalkCMYKString
- end
- } def
-
-
- /ColorImageCompositeEmulator
- {
- pop true eq
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
- }
- {
- Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 3 -1 roll put
-
- channelcount 3 eq
- {
- /RGBToGrayImageProc
- }
- {
- /CMYKToGrayImageProc
- } ifelse
- load
- end
- } if
- image
- } ifelse
- } def
-
-
- /SeparateCMYKImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
-
- sourcecount 0 ne
- {
- sourcearray plateindex get exec
- }
- {
- sourcearray 0 get exec
-
- dup length 4 idiv string
-
- 0 2 index
-
- plateindex 4 2 index length 1 sub
- {
- get 255 exch sub
-
- 3 copy put pop 1 add
-
- 2 index
- } for
-
- pop pop exch pop
- } ifelse
- end
- } def
-
-
- /FourEqual
- {
- 4 index ne
- {
- pop pop pop false
- }
- {
- 4 index ne
- {
- pop pop false
- }
- {
- 4 index ne
- {
- pop false
- }
- {
- 4 index eq
- } ifelse
- } ifelse
- } ifelse
- } def
-
-
- /TestPlateIndex
- {
- Adobe_ColorImage_AI6_Vars begin
- /plateindex -1 def
-
- /setcmykcolor where
- {
- pop
- gsave
- 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
- grestore
-
- 1 0 0 0 FourEqual
- {
- /plateindex 0 def
- }
- {
- 0 1 0 0 FourEqual
- {
- /plateindex 1 def
- }
- {
- 0 0 1 0 FourEqual
- {
- /plateindex 2 def
- }
- {
- 0 0 0 1 FourEqual
- {
- /plateindex 3 def
- }
- {
- 0 0 0 0 FourEqual
- {
- /plateindex 5 def
- } if
- } ifelse
- } ifelse
- } ifelse
- } ifelse
- pop pop pop pop
- } if
- plateindex
- end
- } def
-
-
- /colorimage
- {
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 1 index def
- /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
-
- 4 sourcecount add index dup
- 8 eq exch 1 eq or not
- end
-
- {
- /_colorimage load null ne
- {
- _colorimage
- }
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get
- 7 add { pop } repeat
- } ifelse
- }
- {
- dup 3 eq
- TestPlateIndex
- dup -1 eq exch 5 eq or or
- {
- /_colorimage load null eq
- {
- ColorImageCompositeEmulator
- }
- {
- dup 1 eq
- {
- pop pop image
- }
- {
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- gsave
-
- 0 _currenttransfer exec
- 1 _currenttransfer exec
- eq
- { 0 _currenttransfer exec 0.5 lt }
- { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
-
- { { pop 0 } } { { pop 1 } } ifelse
- systemdict /settransfer get exec
- } if
-
- _colorimage
-
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- grestore
- } if
- } ifelse
- } ifelse
- }
- {
- dup 1 eq
- {
- pop pop
- image
- }
- {
- pop pop
-
- Adobe_ColorImage_AI6_Vars begin
- sourcecount -1 0
- {
- exch sourcearray 3 1 roll put
- } for
-
- /SeparateCMYKImageProc load
- end
-
- systemdict /image get exec
- } ifelse
- } ifelse
- } ifelse
- } def
-
- /XI
- {
- Adobe_ColorImage_AI6_Vars begin
- gsave
- /XIMask exch 0 ne def
- /XIBinary exch 0 ne def
- pop
- pop
- /XIChannelCount exch def
- /XIBitsPerPixel exch def
- /XIImageHeight exch def
- /XIImageWidth exch def
- pop pop pop pop
- /XIImageMatrix exch def
-
- XIBitsPerPixel 1 eq
- {
- XIImageWidth 8 div ceiling cvi
- }
- {
- XIImageWidth XIChannelCount mul
- } ifelse
- /XIBuffer exch string def
-
- XIBinary
- {
- /XIDataProc { currentfile XIBuffer readstring pop } def
- currentfile 128 string readline pop pop
- }
- {
- /XIDataProc { currentfile XIBuffer readhexstring pop } def
- } ifelse
-
- 0 0 moveto
- XIImageMatrix concat
- XIImageWidth XIImageHeight scale
-
- XIMask
- {
- XIImageWidth XIImageHeight
- false
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- /_lp /null ddef
- _fc
- /_lp /imagemask ddef
-
- imagemask
- }
- {
- XIImageWidth XIImageHeight
- XIBitsPerPixel
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- XIChannelCount 1 eq
- {
-
- gsave
- 0 setgray
-
- image
-
- grestore
- }
- {
- false
- XIChannelCount
- colorimage
- } ifelse
- } ifelse
- grestore
- end
- } def
-
-end
-%%EndProcSet
-%%BeginResource: procset Adobe_Illustrator_AI5 1.1 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Full Prolog)
-%%Version: 1.1
-%%CreationDate: (3/7/1994) ()
-%%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_Illustrator_AI5_vars 81 dict dup begin
-put
-/_eo false def
-/_lp /none def
-/_pf
-{
-} def
-/_ps
-{
-} def
-/_psf
-{
-} def
-/_pss
-{
-} def
-/_pjsf
-{
-} def
-/_pjss
-{
-} def
-/_pola 0 def
-/_doClip 0 def
-/cf currentflat def
-/_tm matrix def
-/_renderStart
-[
-/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0
-] def
-/_renderEnd
-[
-null null null null /i1 /i1 /i1 /i1
-] def
-/_render -1 def
-/_rise 0 def
-/_ax 0 def
-/_ay 0 def
-/_cx 0 def
-/_cy 0 def
-/_leading
-[
-0 0
-] def
-/_ctm matrix def
-/_mtx matrix def
-/_sp 16#020 def
-/_hyphen (-) def
-/_fScl 0 def
-/_cnt 0 def
-/_hs 1 def
-/_nativeEncoding 0 def
-/_useNativeEncoding 0 def
-/_tempEncode 0 def
-/_pntr 0 def
-/_tDict 2 dict def
-/_wv 0 def
-/Tx
-{
-} def
-/Tj
-{
-} def
-/CRender
-{
-} def
-/_AI3_savepage
-{
-} def
-/_gf null def
-/_cf 4 array def
-/_if null def
-/_of false def
-/_fc
-{
-} def
-/_gs null def
-/_cs 4 array def
-/_is null def
-/_os false def
-/_sc
-{
-} def
-/_pd 1 dict def
-/_ed 15 dict def
-/_pm matrix def
-/_fm null def
-/_fd null def
-/_fdd null def
-/_sm null def
-/_sd null def
-/_sdd null def
-/_i null def
-/discardSave null def
-/buffer 256 string def
-/beginString null def
-/endString null def
-/endStringLength null def
-/layerCnt 1 def
-/layerCount 1 def
-/perCent (%) 0 get def
-/perCentSeen? false def
-/newBuff null def
-/newBuffButFirst null def
-/newBuffLast null def
-/clipForward? false def
-end
-userdict /Adobe_Illustrator_AI5 known not {
- userdict /Adobe_Illustrator_AI5 91 dict put
-} if
-userdict /Adobe_Illustrator_AI5 get begin
-/initialize
-{
- Adobe_Illustrator_AI5 dup begin
- Adobe_Illustrator_AI5_vars begin
- discardDict
- {
- bind pop pop
- } forall
- dup /nc get begin
- {
- dup xcheck 1 index type /operatortype ne and
- {
- bind
- } if
- pop pop
- } forall
- end
- newpath
-} def
-/terminate
-{
- end
- end
-} def
-/_
-null def
-/ddef
-{
- Adobe_Illustrator_AI5_vars 3 1 roll put
-} def
-/xput
-{
- dup load dup length exch maxlength eq
- {
- dup dup load dup
- length 2 mul dict copy def
- } if
- load begin
- def
- end
-} def
-/npop
-{
- {
- pop
- } repeat
-} def
-/sw
-{
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
-} def
-/swj
-{
- dup 4 1 roll
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
- 6 2 roll /_cnt 0 ddef
- {
- 1 index eq
- {
- /_cnt _cnt 1 add ddef
- } if
- } forall
- pop
- exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop
-} def
-/ss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put pop
- gsave
- false charpath currentpoint
- 4 index setmatrix
- stroke
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 3 npop
-} def
-/jss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- gsave
- _sp eq
- {
- exch 6 index 6 index 6 index 5 -1 roll widthshow
- currentpoint
- }
- {
- false charpath currentpoint
- 4 index setmatrix stroke
- } ifelse
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 6 npop
-} def
-/sp
-{
- {
- 2 npop (0) exch
- 2 copy 0 exch put pop
- false charpath
- 2 copy rmoveto
- } exch cshow
- 2 npop
-} def
-/jsp
-{
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- _sp eq
- {
- exch 5 index 5 index 5 index 5 -1 roll widthshow
- }
- {
- false charpath
- } ifelse
- 2 copy rmoveto
- } exch cshow
- 5 npop
-} def
-/pl
-{
- transform
- 0.25 sub round 0.25 add exch
- 0.25 sub round 0.25 add exch
- itransform
-} def
-/setstrokeadjust where
-{
- pop true setstrokeadjust
- /c
- {
- curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll curveto
- } def
- /V
- /v load def
- /y
- {
- 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- lineto
- } def
- /L
- /l load def
- /m
- {
- moveto
- } def
-}
-{
- /c
- {
- pl curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll pl curveto
- } def
- /V
- /v load def
- /y
- {
- pl 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- pl lineto
- } def
- /L
- /l load def
- /m
- {
- pl moveto
- } def
-} ifelse
-/d
-{
- setdash
-} def
-/cf
-{
-} def
-/i
-{
- dup 0 eq
- {
- pop cf
- } if
- setflat
-} def
-/j
-{
- setlinejoin
-} def
-/J
-{
- setlinecap
-} def
-/M
-{
- setmiterlimit
-} def
-/w
-{
- setlinewidth
-} def
-/XR
-{
- 0 ne
- /_eo exch ddef
-} def
-/H
-{
-} def
-/h
-{
- closepath
-} def
-/N
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- _eo {eoclip} {clip} ifelse /_doClip 0 ddef
- } if
- newpath
- }
- {
- /CRender
- {
- N
- } ddef
- } ifelse
-} def
-/n
-{
- N
-} def
-/F
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc
- /_doClip 0 ddef
- }
- {
- _pf
- } ifelse
- }
- {
- /CRender
- {
- F
- } ddef
- } ifelse
-} def
-/f
-{
- closepath
- F
-} def
-/S
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- _ps
- } ifelse
- }
- {
- /CRender
- {
- S
- } ddef
- } ifelse
-} def
-/s
-{
- closepath
- S
-} def
-/B
-{
- _pola 0 eq
- {
- _doClip 1 eq
- gsave F grestore
- {
- gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- S
- } ifelse
- }
- {
- /CRender
- {
- B
- } ddef
- } ifelse
-} def
-/b
-{
- closepath
- B
-} def
-/W
-{
- /_doClip 1 ddef
-} def
-/*
-{
- count 0 ne
- {
- dup type /stringtype eq
- {
- pop
- } if
- } if
- newpath
-} def
-/u
-{
-} def
-/U
-{
-} def
-/q
-{
- _pola 0 eq
- {
- gsave
- } if
-} def
-/Q
-{
- _pola 0 eq
- {
- grestore
- } if
-} def
-/*u
-{
- _pola 1 add /_pola exch ddef
-} def
-/*U
-{
- _pola 1 sub /_pola exch ddef
- _pola 0 eq
- {
- CRender
- } if
-} def
-/D
-{
- pop
-} def
-/*w
-{
-} def
-/*W
-{
-} def
-/`
-{
- /_i save ddef
- clipForward?
- {
- nulldevice
- } if
- 6 1 roll 4 npop
- concat pop
- userdict begin
- /showpage
- {
- } def
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {pop false setstrokeadjust} if
- newpath
- 0 setgray
- false setoverprint
-} def
-/~
-{
- end
- _i restore
-} def
-/O
-{
- 0 ne
- /_of exch ddef
- /_lp /none ddef
-} def
-/R
-{
- 0 ne
- /_os exch ddef
- /_lp /none ddef
-} def
-/g
-{
- /_gf exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _gf setgray
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/G
-{
- /_gs exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _gs setgray
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/k
-{
- _cf astore pop
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _cf aload pop setcmykcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/K
-{
- _cs astore pop
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _cs aload pop setcmykcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/x
-{
- /_gf exch ddef
- findcmykcustomcolor
- /_if exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _if _gf 1 exch sub setcustomcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/X
-{
- /_gs exch ddef
- findcmykcustomcolor
- /_is exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _is _gs 1 exch sub setcustomcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/A
-{
- pop
-} def
-/annotatepage
-{
-userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse
-} def
-/XT {
- pop pop
-} def
-/discard
-{
- save /discardSave exch store
- discardDict begin
- /endString exch store
- gt38?
- {
- 2 add
- } if
- load
- stopped
- pop
- end
- discardSave restore
-} bind def
-userdict /discardDict 7 dict dup begin
-put
-/pre38Initialize
-{
- /endStringLength endString length store
- /newBuff buffer 0 endStringLength getinterval store
- /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store
- /newBuffLast newBuff endStringLength 1 sub 1 getinterval store
-} def
-/shiftBuffer
-{
- newBuff 0 newBuffButFirst putinterval
- newBuffLast 0
- currentfile read not
- {
- stop
- } if
- put
-} def
-0
-{
- pre38Initialize
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff endString eq
- {
- cleartomark stop
- } if
- shiftBuffer
- } loop
- }
- {
- stop
- } ifelse
-} def
-1
-{
- pre38Initialize
- /beginString exch store
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff beginString eq
- {
- /layerCount dup load 1 add store
- }
- {
- newBuff endString eq
- {
- /layerCount dup load 1 sub store
- layerCount 0 eq
- {
- cleartomark stop
- } if
- } if
- } ifelse
- shiftBuffer
- } loop
- } if
-} def
-2
-{
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- endString eq
- {
- cleartomark stop
- } if
- } loop
-} def
-3
-{
- /beginString exch store
- /layerCnt 1 store
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- dup beginString eq
- {
- pop /layerCnt dup load 1 add store
- }
- {
- endString eq
- {
- layerCnt 1 eq
- {
- cleartomark stop
- }
- {
- /layerCnt dup load 1 sub store
- } ifelse
- } if
- } ifelse
- } loop
-} def
-end
-userdict /clipRenderOff 15 dict dup begin
-put
-{
- /n /N /s /S /f /F /b /B
-}
-{
- {
- _doClip 1 eq
- {
- /_doClip 0 ddef _eo {eoclip} {clip} ifelse
- } if
- newpath
- } def
-} forall
-/Tr /pop load def
-/Bb {} def
-/BB /pop load def
-/Bg {12 npop} def
-/Bm {6 npop} def
-/Bc /Bm load def
-/Bh {4 npop} def
-end
-/Lb
-{
- 4 npop
- 6 1 roll
- pop
- 4 1 roll
- pop pop pop
- 0 eq
- {
- 0 eq
- {
- (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard
- }
- {
-
- /clipForward? true def
-
- /Tx /pop load def
- /Tj /pop load def
-
- currentdict end clipRenderOff begin begin
- } ifelse
- }
- {
- 0 eq
- {
- save /discardSave exch store
- } if
- } ifelse
-} bind def
-/LB
-{
- discardSave dup null ne
- {
- restore
- }
- {
- pop
- clipForward?
- {
- currentdict
- end
- end
- begin
-
- /clipForward? false ddef
- } if
- } ifelse
-} bind def
-/Pb
-{
- pop pop
- 0 (%AI5_EndPalette) discard
-} bind def
-/Np
-{
- 0 (%AI5_End_NonPrinting--) discard
-} bind def
-/Ln /pop load def
-/Ap
-/pop load def
-/Ar
-{
- 72 exch div
- 0 dtransform dup mul exch dup mul add sqrt
- dup 1 lt
- {
- pop 1
- } if
- setflat
-} def
-/Mb
-{
- q
-} def
-/Md
-{
-} def
-/MB
-{
- Q
-} def
-/nc 3 dict def
-nc begin
-/setgray
-{
- pop
-} bind def
-/setcmykcolor
-{
- 4 npop
-} bind def
-/setcustomcolor
-{
- 2 npop
-} bind def
-currentdict readonly pop
-end
-end
-setpacking
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%IncludeFont: Univers
-Adobe_level2_AI5 /initialize get exec
-Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec
-Adobe_ColorImage_AI6 /initialize get exec
-Adobe_Illustrator_AI5 /initialize get exec
-[
-39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
-/Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
-/egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
-/oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
-/udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
-/registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
-/.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
-/.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
-/questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
-/guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
-/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
-/.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
-/fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
-/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
-/Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
-/Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
-/hungarumlaut/ogonek/caron
-TE
-%AI3_BeginEncoding: _Univers Univers
-[/_Univers/Univers 0 0 1 TZ
-%AI3_EndEncoding AdobeType
-%AI5_Begin_NonPrinting
-Np
-8 Bn
-%AI5_BeginGradient: (Black & White)
-(Black & White) 0 2 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Green & Blue)
-(Green & Blue) 0 2 Bd
-[
-<
-99999A9A9B9B9B9C9C9D9D9D9E9E9F9F9FA0A0A1A1A1A2A2A3A3A3A4A4A5A5A5A6A6A7A7A7A8A8A9
-A9A9AAAAABABABACACADADADAEAEAFAFAFB0B0B1B1B1B2B2B3B3B3B4B4B5B5B5B6B6B7B7B7B8B8B9
-B9B9BABABBBBBBBCBCBDBDBDBEBEBFBFBFC0C0C1C1C1C2C2C3C3C3C4C4C5C5C5C6C6C7C7C7C8C8C9
-C9C9CACACBCBCBCCCCCDCDCDCECECFCFCFD0D0D1D1D1D2D2D3D3D3D4D4D5D5D5D6D6D7D7D7D8D8D9
-D9D9DADADBDBDBDCDCDDDDDDDEDEDFDFDFE0E0E1E1E1E2E2E3E3E3E4E4E5E5E5E6E6E7E7E7E8E8E9
-E9E9EAEAEBEBEBECECEDEDEDEEEEEFEFEFF0F0F1F1F1F2F2F3F3F3F4F4F5F5F5F6F6F7F7F7F8F8F9
-F9F9FAFAFBFBFBFCFCFDFDFDFEFEFFFF
->
-<
-000102020304050506070808090A0B0B0C0D0E0E0F101111121314141516171718191A1A1B1C1D1D
-1E1F20202122232324252626272829292A2B2C2C2D2E2F2F303132323334353536373838393A3B3B
-3C3D3E3E3F404141424344444546474748494A4A4B4C4D4D4E4F5050515253535455565657585959
-5A5B5C5C5D5E5F5F606162626364656566676868696A6B6B6C6D6E6E6F7071717273747475767777
-78797A7A7B7C7D7D7E7F80808182828384858586878888898A8B8B8C8D8E8E8F9091919293949495
-96979798999A9A9B9C9D9D9E9FA0A0A1A2A3A3A4A5A6A6A7A8A9A9AAABACACADAEAFAFB0B1B2B2B3
-B4B5B5B6B7B8B8B9BABBBBBCBDBEBEBF
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-[
-1 0.75 0 0 1 50 100 %_Bs
-0.6 0 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Pink, Yellow, Green)
-(Pink, Yellow, Green) 0 3 Bd
-[
-<
-00000000000000000000000000000000000000010101010101010101010101010101010101010101
-01010101010202020202020202020202020202020202020202020203030303030303030303030303
-03030303030303030404040404040404040404040404040404040404050505050505050505050505
-05050505050505060606060606060606060606060606060606060707070707070707070707070707
-07070707080808080808080808080808080808080809090909090909090909090909090909090A0A
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0C
-0C0C0C0C0C0C0C0D0D0D0D0D
->
-<
-050506060606070708080809090A0A0A0B0B0C0C0D0D0E0E0F0F1010111112121313141415151617
-17181819191A1A1B1C1C1D1D1E1F1F202021222223232425252626272828292A2A2B2C2C2D2D2E2F
-2F3031313233333435353637373839393A3B3B3C3D3E3E3F4040414242434445454647474849494A
-4B4C4C4D4E4F4F505151525354545556575758595A5A5B5C5C5D5E5F5F6061626363646566666768
-69696A6B6C6C6D6E6F707071727373747576777778797A7B7B7C7D7E7F7F80818283838485868787
-88898A8B8B8C8D8E8F8F9091929394949596979898999A9B9C9D9D9E9FA0A1A2A2A3A4A5A6A7A7A8
-A9AAABACADADAEAFB0B1B2B2
->
-<
-CCCCCBCBCBCACACAC9C9C8C8C7C7C6C6C5C5C4C4C3C2C2C1C1C0C0BFBEBEBDBDBCBBBBBAB9B9B8B7
-B7B6B6B5B4B4B3B2B1B1B0AFAFAEADADACABAAAAA9A8A8A7A6A5A5A4A3A2A2A1A0A09F9E9D9C9C9B
-9A999998979696959493929291908F8E8E8D8C8B8A8A8988878686858483828181807F7E7D7C7C7B
-7A7978777776757473727171706F6E6D6C6B6A6A69686766656463636261605F5E5D5C5B5B5A5958
-5756555453525151504F4E4D4C4B4A49484746464544434241403F3E3D3C3B3A3938383736353433
-3231302F2E2D2C2B2A29282726252423222221201F1E1D1C1B1A191817161514131211100F0E0D0C
-0B0A09080706050403020100
->
-0
-1 %_Br
-<
-737271706F6E6D6C6B6A696867666564636261605F5E5D5C5B5B5A59585756555453525150504F4E
-4D4C4B4A4949484746454443434241403F3E3E3D3C3B3A3A393837363635343333323130302F2E2D
-2D2C2B2A2A29282827262525242323222121201F1F1E1D1D1C1C1B1A1A1918181717161615141413
-1312121111100F0F0E0E0D0D0C0C0C0B0B0A0A090908080807070606060505050404040303030202
-020201010101010000000000
->
-<
-00000000000000000000000001010101010101010101010101010101010101010101010102020202
-02020202020202020202020202020202020202020202030303030303030303030303030303030303
-03030303030303030303030303040404040404040404040404040404040404040404040404040404
-04040404040404040404050505050505050505050505050505050505050505050505050505050505
-050505050505050505050505
->
-<
-BFBFBFC0C0C0C0C0C0C0C0C0C1C1C1C1C1C1C1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C3C3
-C3C4C4C4C4C4C4C4C4C4C4C5C5C5C5C5C5C5C5C5C5C5C6C6C6C6C6C6C6C6C6C6C6C6C7C7C7C7C7C7
-C7C7C7C7C7C7C8C8C8C8C8C8C8C8C8C8C8C8C8C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9CACACACACACA
-CACACACACACACACACACACBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCCCCCCCCCCCCCCCC
-CCCCCCCCCCCCCCCCCCCCCCCC
->
-0
-1 %_Br
-[
-0.05 0.7 0 0 1 50 100 %_Bs
-0 0.02 0.8 0 1 57 36 %_Bs
-0.45 0 0.75 0 1 37 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Purple, Red & Yellow)
-(Purple, Red & Yellow) 0 3 Bd
-[
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A
->
-<
-CCCCCCCDCDCDCDCDCECECECECECFCFCFCFD0D0D0D0D0D1D1D1D1D1D2D2D2D2D2D3D3D3D3D3D4D4D4
-D4D5D5D5D5D5D6D6D6D6D6D7D7D7D7D7D8D8D8D8D8D9D9D9D9DADADADADADBDBDBDBDBDCDCDCDCDC
-DDDDDDDDDDDEDEDEDEDFDFDFDFDFE0E0E0E0E0E1E1E1E1E1E2E2E2E2E2E3E3E3E3E4E4E4E4E4E5E5
-E5E5E5E6E6E6E6E6E7E7E7E7E7E8E8E8E8E9E9E9E9E9EAEAEAEAEAEBEBEBEBEBECECECECECEDEDED
-EDEEEEEEEEEEEFEFEFEFEFF0F0F0F0F0F1F1F1F1F1F2F2F2F2F3F3F3F3F3F4F4F4F4F4F5F5F5F5F5
-F6F6F6F6F6F7F7F7F7F8F8F8F8F8F9F9F9F9F9FAFAFAFAFAFBFBFBFBFBFCFCFCFCFDFDFDFDFDFEFE
-FEFEFEFFFFFF
->
-0
-1 %_Br
-<
-E5E4E3E2E1E0DFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBE
-BDBCBBBAB9B8B7B6B5B4B3B2B1B0AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A99989796
-9594939291908F8E8D8C8B8A898887868584838281807F7E7D7C7B7A797877767574737271706F6E
-6D6C6B6A696867666564636261605F5E5D5C5B5A595857565554535251504F4E4D4C4B4A49484746
-4544434241403F3E3D3C3B3A393837363534333231302F2E2D2C2B2A292827262524232221201F1E
-1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
->
-<
-E5E6E6E6E6E6E6E6E6E7E7E7E7E7E7E7E7E7E8E8E8E8E8E8E8E8E8E9E9E9E9E9E9E9E9E9EAEAEAEA
-EAEAEAEAEAEBEBEBEBEBEBEBEBEBECECECECECECECECECEDEDEDEDEDEDEDEDEDEEEEEEEEEEEEEEEE
-EEEFEFEFEFEFEFEFEFEFF0F0F0F0F0F0F0F0F0F1F1F1F1F1F1F1F1F1F2F2F2F2F2F2F2F2F2F3F3F3
-F3F3F3F3F3F3F4F4F4F4F4F4F4F4F4F5F5F5F5F5F5F5F5F5F6F6F6F6F6F6F6F6F6F7F7F7F7F7F7F7
-F7F7F8F8F8F8F8F8F8F8F8F9F9F9F9F9F9F9F9F9FAFAFAFAFAFAFAFAFAFBFBFBFBFBFBFBFBFBFCFC
-FCFCFCFCFCFCFCFDFDFDFDFDFDFDFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFF
->
-<
-00010203040405060708090A0B0C0C0D0E0F10111213141415161718191A1B1C1D1D1E1F20212223
-242525262728292A2B2C2D2D2E2F30313233343535363738393A3B3C3D3D3E3F4041424344454546
-4748494A4B4C4D4E4E4F50515253545556565758595A5B5C5D5E5E5F60616263646566666768696A
-6B6C6D6E6E6F70717273747576767778797A7B7C7D7E7F7F80818283848586878788898A8B8C8D8E
-8F8F90919293949596979798999A9B9C9D9E9F9FA0A1A2A3A4A5A6A7A7A8A9AAABACADAEAFAFB0B1
-B2B3B4B5B6B7B8B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C8C9CACBCC
->
-0
-1 %_Br
-[
-0 0.04 1 0 1 50 100 %_Bs
-0 1 0.8 0 1 50 50 %_Bs
-0.9 0.9 0 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Rainbow)
-(Rainbow) 0 6 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-0
-1 %_Br
-1
-<
-0708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E
-2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556
-5758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E
-7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6
-A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCE
-CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6
-F7F8F9FAFBFCFDFEFF
->
-0
-0
-1 %_Br
-1
-<
-00000000000000000000000000000000000001010101010101010101010101010101010101010101
-01010101010101010101010101010202020202020202020202020202020202020202020202020202
-02020202020202020202030303030303030303030303030303030303030303030303030303030303
-03030303030304040404040404040404040404040404040404040404040404040404040404040404
-04040505050505050505050505050505050505050505050505050505050505050505050505050606
-06060606060606060606060606060606060606060606060606060606060606060606070707070707
-07070707070707070707070707070707
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0
-1
-0
-1 %_Br
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-1 %_Br
-[
-0 1 0 0 1 50 100 %_Bs
-1 1 0 0 1 50 80 %_Bs
-1 0.0279 0 0 1 50 60 %_Bs
-1 0 1 0 1 50 40 %_Bs
-0 0 1 0 1 50 20 %_Bs
-0 1 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Steel Bar)
-(Steel Bar) 0 3 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 70 %_Bs
-0 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Orange Radial)
-(Yellow & Orange Radial) 1 2 Bd
-[
-0
-<
-0001010203040506060708090A0B0C0C0D0E0F10111213131415161718191A1B1C1D1D1E1F202122
-232425262728292A2B2B2C2D2E2F303132333435363738393A3B3C3D3E3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60606162636465666768696A6B6C6D6E6F
-707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C
->
-<
-FFFFFFFFFEFEFEFEFEFEFEFDFDFDFDFDFDFCFCFCFCFCFCFBFBFBFBFBFBFAFAFAFAFAFAF9F9F9F9F9
-F9F8F8F8F8F8F8F7F7F7F7F7F7F6F6F6F6F6F6F5F5F5F5F5F5F4F4F4F4F4F3F3F3F3F3F3F2F2F2F2
-F2F2F1F1F1F1F1F0F0F0F0F0F0EFEFEFEFEFEFEEEEEEEEEEEDEDEDEDEDEDECECECECECEBEBEBEBEB
-EBEAEAEAEAEAE9E9E9E9E9E9E8E8E8E8E8E8E7E7E7E7E7E6E6E6E6E6E5
->
-0
-1 %_Br
-[
-0 0 1 0 1 52 19 %_Bs
-0 0.55 0.9 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Purple Radial)
-(Yellow & Purple Radial) 1 2 Bd
-[
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-<
-1415161718191A1B1C1D1E1F1F202122232425262728292A2A2B2C2D2E2F30313233343536363738
-393A3B3C3D3E3F40414142434445464748494A4B4C4D4D4E4F50515253545556575858595A5B5C5D
-5E5F60616263646465666768696A6B6C6D6E6F6F707172737475767778797A7B7B7C7D7E7F808182
-83848586868788898A8B8C8D8E8F90919292939495969798999A9B9C9D9D9E9FA0A1A2A3A4A5A6A7
-A8A9A9AAABACADAEAFB0B1B2B3B4B4B5B6B7B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C9CACBCB
-CCCDCECFD0D1D2D3D4D5D6D7D7D8D9DADBDCDDDEDFE0E1E2E2E3E4E5E6E7E8E9EAEBECEDEEEEEFF0
-F1F2F3F4F5F6F7F8F9F9FAFBFCFDFEFF
->
-<
-ABAAAAA9A8A7A7A6A5A5A4A3A3A2A1A1A09F9F9E9D9D9C9B9B9A9999989797969595949393929191
-908F8F8E8D8D8C8B8B8A8989888787868585848383828181807F7F7E7D7D7C7B7B7A797978777776
-7575747373727171706F6F6E6D6D6C6B6B6A6969686767666565646362626160605F5E5E5D5C5C5B
-5A5A5958585756565554545352525150504F4E4E4D4C4C4B4A4A4948484746464544444342424140
-403F3E3E3D3C3C3B3A3A3938383736363534343332323130302F2E2E2D2C2C2B2A2A292828272626
-25242423222121201F1F1E1D1D1C1B1B1A1919181717161515141313121111100F0F0E0D0D0C0B0B
-0A090908070706050504030302010100
->
-0
-1 %_Br
-[
-0 0.08 0.67 0 1 50 14 %_Bs
-1 1 0 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_End_NonPrinting--
-%AI5_BeginPalette
-0 0 Pb
-Pn
-Pc
-1 g
-Pc
-0 g
-Pc
-0 0 0 0 k
-Pc
-0.75 g
-Pc
-0.5 g
-Pc
-0.25 g
-Pc
-0 g
-Pc
-Bb
-2 (Black & White) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0 0 0 k
-Pc
-0.5 0 0 0 k
-Pc
-0.75 0 0 0 k
-Pc
-1 0 0 0 k
-Pc
-0.25 0.25 0 0 k
-Pc
-0.5 0.5 0 0 k
-Pc
-0.75 0.75 0 0 k
-Pc
-1 1 0 0 k
-Pc
-Bb
-2 (Pink, Yellow, Green) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0 0 k
-Pc
-0 0.5 0 0 k
-Pc
-0 0.75 0 0 k
-Pc
-0 1 0 0 k
-Pc
-0 0.25 0.25 0 k
-Pc
-0 0.5 0.5 0 k
-Pc
-0 0.75 0.75 0 k
-Pc
-0 1 1 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Purple Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0 0.25 0 k
-Pc
-0 0 0.5 0 k
-Pc
-0 0 0.75 0 k
-Pc
-0 0 1 0 k
-Pc
-0.25 0 0.25 0 k
-Pc
-0.5 0 0.5 0 k
-Pc
-0.75 0 0.75 0 k
-Pc
-1 0 1 0 k
-Pc
-Bb
-2 (Rainbow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0 0 k
-Pc
-0.5 0.25 0 0 k
-Pc
-0.75 0.375 0 0 k
-Pc
-1 0.5 0 0 k
-Pc
-0.125 0.25 0 0 k
-Pc
-0.25 0.5 0 0 k
-Pc
-0.375 0.75 0 0 k
-Pc
-0.5 1 0 0 k
-Pc
-Bb
-2 (Steel Bar) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0.125 0 k
-Pc
-0 0.5 0.25 0 k
-Pc
-0 0.75 0.375 0 k
-Pc
-0 1 0.5 0 k
-Pc
-0 0.125 0.25 0 k
-Pc
-0 0.25 0.5 0 k
-Pc
-0 0.375 0.75 0 k
-Pc
-0 0.5 1 0 k
-Pc
-Bb
-2 (Purple, Red & Yellow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0 0.25 0 k
-Pc
-0.25 0 0.5 0 k
-Pc
-0.375 0 0.75 0 k
-Pc
-0.5 0 1 0 k
-Pc
-0.25 0 0.125 0 k
-Pc
-0.5 0 0.25 0 k
-Pc
-0.75 0 0.375 0 k
-Pc
-1 0 0.5 0 k
-Pc
-Bb
-2 (Green & Blue) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0.125 0 k
-Pc
-0.5 0.25 0.25 0 k
-Pc
-0.75 0.375 0.375 0 k
-Pc
-1 0.5 0.5 0 k
-Pc
-0.25 0.25 0.125 0 k
-Pc
-0.5 0.5 0.25 0 k
-Pc
-0.75 0.75 0.375 0 k
-Pc
-1 1 0.5 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Orange Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0.25 0.125 0 k
-Pc
-0.25 0.5 0.25 0 k
-Pc
-0.375 0.75 0.375 0 k
-Pc
-0.5 1 0.5 0 k
-Pc
-0.125 0.25 0.25 0 k
-Pc
-0.25 0.5 0.5 0 k
-Pc
-0.375 0.75 0.75 0 k
-Pc
-0.5 1 1 0 k
-Pc
-0 0 0 0 k
-Pc
-0.125 0.125 0.25 0 k
-Pc
-0.25 0.25 0.5 0 k
-Pc
-0.375 0.375 0.75 0 k
-Pc
-0.5 0.5 1 0 k
-Pc
-0.25 0.125 0.25 0 k
-Pc
-0.5 0.25 0.5 0 k
-Pc
-0.75 0.375 0.75 0 k
-Pc
-1 0.5 1 0 k
-Pc
-PB
-%AI5_EndPalette
-%%EndSetup
-%AI5_BeginLayer
-1 1 1 1 0 0 0 79 128 255 Lb
-(Layer 1) Ln
-0 A
-800 Ar
-0 J 0 j 1 w 4 M []0 d
-%AI3_Note:
-0 D
-0 XR
--4014 283.5 m
-4626 283.5 L
-(N) *
-453.5 4716 m
-453.5 -3924 L
-(N) *
-85 4716 m
-85 -3924 L
-(N) *
--4014 765.5 m
-4626 765.5 L
-(N) *
-1 Ap
-0 R
-0 G
-[6 8 6 8 6 8 ]0 d
-439.3333 689 m
-439.3333 751 L
-354 751 L
-354 689 L
-439.3333 689 L
-s
-322 523 m
-322 734.3333 L
-107.6667 734.3333 L
-107.6667 523 L
-322 523 L
-s
-u
-0 Ap
-1.1 w []0 d
-137.6876 560.816 m
-114.2154 572.6036 L
-114.2154 595.9724 L
-137.6876 607.7602 L
-161.1596 595.9724 L
-161.1596 572.6036 L
-137.6876 560.816 L
-s
-0 To
-1 0 0 1 137.6875 586.8542 0 Tp
-TP
--21.665 0 Td
-0 Tr
-0 O
-0 g
-1 w
-/_Univers 10 Tf
-0 Ts
-100 Tz
-0 Tt
-1 TA
-%_ 0 XL
-36 0 Xb
-XB
-0 0 5 TC
-100 100 200 TW
-0 0 0 Ti
-1 Ta
-0 0 2 2 3 Th
-0 Tq
-0 0 Tl
-0 Tc
-0 Tw
-(Standard\r) Tx
-12.2217 -12 Td
-(MIB) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-261.6169 564.0939 m
-244.5463 572.6667 L
-244.5463 589.6621 L
-261.6169 598.235 L
-278.6875 589.6621 L
-278.6875 572.6667 L
-261.6169 564.0939 L
-s
-0 To
-1 0 0 1 252.1735 577.7306 0 Tp
-TP
-0 Tr
-0 O
-0 g
-0 Ta
-(MIB) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-298.4248 564.0939 m
-281.3542 572.6667 L
-281.3542 589.6621 L
-298.4248 598.235 L
-315.4954 589.6621 L
-315.4954 572.6667 L
-298.4248 564.0939 L
-s
-0 To
-1 0 0 1 288.9813 577.7306 0 Tp
-TP
-0 Tr
-0 O
-0 g
-(MIB) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-203.1875 564.6667 m
-186.1168 573.2395 L
-186.1168 590.2349 L
-203.1875 598.8079 L
-220.2579 590.2349 L
-220.2579 573.2395 L
-203.1875 564.6667 L
-s
-0 To
-1 0 0 1 193.744 578.3034 0 Tp
-TP
-0 Tr
-0 O
-0 g
-(MIB) Tx
-(\r) TX
-TO
-U
-u
-1 Ap
-0 R
-0 G
-173.7708 529.6568 m
-193.3397 529.6568 209.2039 539.1753 209.2039 550.9166 c
-209.2039 562.6579 193.3397 572.1765 173.7708 572.1765 c
-154.2019 572.1765 138.3377 562.6579 138.3377 550.9166 c
-138.3377 539.1753 154.2019 529.6568 173.7708 529.6568 c
-s
-0 To
-1 0 0 1 173.7708 553.4828 0 Tp
-TP
--16.3867 0 Td
-0 Tr
-0 O
-0 g
-1 Ta
-(Master\r) Tx
-2.2253 -12 Td
-(Agent) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-280.0208 533.9921 m
-295.676 533.9921 308.3674 541.6069 308.3674 551 c
-308.3674 560.393 295.676 568.008 280.0208 568.008 c
-264.3656 568.008 251.6742 560.393 251.6742 551 c
-251.6742 541.6069 264.3656 533.9921 280.0208 533.9921 c
-s
-0 To
-1 0 0 1 280.0208 553.5662 0 Tp
-TP
--9.4434 0 Td
-0 Tr
-0 O
-0 g
-(Sub\r) Tx
--4.718 -12 Td
-(Agent) Tx
-(\r) TX
-TO
-U
-0 Ap
-0 R
-0 G
-98.6458 481.9583 m
-438.6458 481.9583 l
-S
-0 To
-1 0 0 1 93.3333 499.3333 0 Tp
-TP
-0 Tr
-0 O
-0 g
-0 Ta
-(Manager) Tx
-(\r) TX
-TO
-0 R
-0 G
-104.5 496.3333 m
-104.5 482 l
-S
-u
-195.3333 496.75 m
-195.3333 482 l
-S
-u
-1 Ap
-216.8333 496.75 m
-216.8333 523 L
-173.8333 523 L
-173.8333 496.75 L
-216.8333 496.75 L
-s
-0 To
-1 0 0 1 180.0574 506.4412 0 Tp
-TP
-0 Tr
-0 O
-0 g
-(Erlang) Tx
-(\r) TX
-TO
-U
-U
-u
-0 Ap
-0 R
-0 G
-391.6667 496.75 m
-391.6667 482 l
-S
-u
-1 Ap
-413.1667 496.75 m
-413.1667 523 L
-370.1667 523 L
-370.1667 496.75 L
-413.1667 496.75 L
-s
-0 To
-1 0 0 1 376.3908 506.4412 0 Tp
-TP
-0 Tr
-0 O
-0 g
-(Erlang) Tx
-(\r) TX
-TO
-U
-U
-u
-0 R
-0 G
-204.5065 690.9501 m
-207.8201 690.9501 210.5065 693.6364 210.5065 696.9501 C
-210.5065 720.3831 L
-210.5065 723.6969 207.8201 726.3832 204.5065 726.3832 C
-188.1602 726.3832 L
-184.8466 726.3832 182.1601 723.6969 182.1601 720.3831 C
-182.1601 696.9501 L
-182.1601 693.6364 184.8466 690.9501 188.1602 690.9501 C
-204.5065 690.9501 L
-s
-0 To
-1 0 0 1 196.3333 711.2328 0 Tp
-TP
--12.4963 0 Td
-0 Tr
-0 O
-0 g
-1 Ta
-(Appl.\r) Tx
-9.7168 -12 Td
-(1) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-238.5065 676.9501 m
-241.8201 676.9501 244.5065 679.6364 244.5065 682.9501 C
-244.5065 706.3831 L
-244.5065 709.6969 241.8201 712.3832 238.5065 712.3832 C
-222.1602 712.3832 L
-218.8466 712.3832 216.1601 709.6969 216.1601 706.3831 C
-216.1601 682.9501 L
-216.1601 679.6364 218.8466 676.9501 222.1602 676.9501 C
-238.5065 676.9501 L
-s
-0 To
-1 0 0 1 230.3333 697.2328 0 Tp
-TP
--12.4963 0 Td
-0 Tr
-0 O
-0 g
-(Appl.\r) Tx
-9.7168 -12 Td
-(2) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-272.5065 662.6168 m
-275.8201 662.6168 278.5065 665.3031 278.5065 668.6168 C
-278.5065 692.0498 L
-278.5065 695.3636 275.8201 698.0499 272.5065 698.0499 C
-256.1602 698.0499 L
-252.8466 698.0499 250.1601 695.3636 250.1601 692.0498 C
-250.1601 668.6168 L
-250.1601 665.3031 252.8466 662.6168 256.1602 662.6168 C
-272.5065 662.6168 L
-s
-0 To
-1 0 0 1 264.3333 682.8995 0 Tp
-TP
--12.4963 0 Td
-0 Tr
-0 O
-0 g
-(Appl.\r) Tx
-9.7168 -12 Td
-(3) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-306.5065 648.6168 m
-309.8201 648.6168 312.5065 651.3031 312.5065 654.6168 C
-312.5065 678.0498 L
-312.5065 681.3636 309.8201 684.0499 306.5065 684.0499 C
-290.1602 684.0499 L
-286.8466 684.0499 284.1601 681.3636 284.1601 678.0498 C
-284.1601 654.6168 L
-284.1601 651.3031 286.8466 648.6168 290.1602 648.6168 C
-306.5065 648.6168 L
-s
-0 To
-1 0 0 1 298.3333 668.8995 0 Tp
-TP
--12.4963 0 Td
-0 Tr
-0 O
-0 g
-(Appl.\r) Tx
-9.7168 -12 Td
-(4) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-373.1026 619.6168 m
-376.4161 619.6168 379.1026 622.3031 379.1026 625.6168 C
-379.1026 649.0498 L
-379.1026 652.3636 376.4161 655.0499 373.1026 655.0499 C
-356.7563 655.0499 L
-353.4427 655.0499 350.7561 652.3636 350.7561 649.0498 C
-350.7561 625.6168 L
-350.7561 622.3031 353.4427 619.6168 356.7563 619.6168 C
-373.1026 619.6168 L
-s
-0 To
-1 0 0 1 364.9293 639.8995 0 Tp
-TP
--12.4963 0 Td
-0 Tr
-0 O
-0 g
-(Appl.\r) Tx
-9.7168 -12 Td
-(5) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-416.1732 703.6168 m
-419.4868 703.6168 422.1732 706.3031 422.1732 709.6168 C
-422.1732 733.0498 L
-422.1732 736.3636 419.4868 739.0499 416.1732 739.0499 C
-399.8269 739.0499 L
-396.5133 739.0499 393.8268 736.3636 393.8268 733.0498 C
-393.8268 709.6168 L
-393.8268 706.3031 396.5133 703.6168 399.8269 703.6168 C
-416.1732 703.6168 L
-s
-0 To
-1 0 0 1 408 723.8995 0 Tp
-TP
--12.4963 0 Td
-0 Tr
-0 O
-0 g
-(Appl.\r) Tx
-9.7168 -12 Td
-(6) Tx
-(\r) TX
-TO
-U
-0 To
-1 0 0 1 210 738 0 Tp
-TP
--16.9458 0 Td
-0 Tr
-(Node 1) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 395.6667 755 0 Tp
-TP
--16.9458 0 Td
-0 Tr
-(Node 3) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 383.3333 670 0 Tp
-TP
--16.9458 0 Td
-0 Tr
-(Node 2) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 255 467.6667 0 Tp
-TP
--19.9951 0 Td
-0 Tr
-(Network) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 158.6667 503 0 Tp
-TP
--10.553 0 Td
-0 Tr
-(UDP) Tx
-(\r) TX
-TO
-u
-u
-0 Ap
-0 R
-0 G
-196.1667 682.9167 m
-202.5 606.5833 l
-S
-0 O
-0 g
-203.7167 604.3142 m
-204.0775 606.0031 204.447 607.1121 204.8679 608.478 c
-199.8409 608.0609 l
-200.1046 607.6064 201.0285 605.7501 201.6624 604.1437 c
-202.3416 602.4246 202.8386 600.8558 203.0548 599.8294 c
-203.0987 600.8774 203.3303 602.5066 203.7167 604.3142 c
-f
-194.9499 685.1859 m
-194.5892 683.4969 194.2196 682.388 193.7987 681.022 c
-198.8258 681.4391 l
-198.5621 681.8936 197.6381 683.7499 197.0042 685.3563 c
-196.325 687.0755 195.828 688.6442 195.6119 689.6706 c
-195.5679 688.6227 195.3363 686.9934 194.9499 685.1859 c
-f
-U
-U
-0 R
-0 G
-110.3333 492.3333 m
-152.1209 494.1551 165.3333 502 v
-176 508.3333 183.3333 519.3333 182 530 c
-S
-276.3333 533.6667 m
-281.3333 517.6667 296.3333 512.3333 v
-310.4293 507.3215 326.0289 506.8196 344.3333 512 c
-362 517 365.6667 521.3333 375.6667 534.6667 c
-S
-0 To
-1 0 0 1 310 497 0 Tp
-TP
--42.7673 0 Td
-0 Tr
-0 O
-0 g
-(Distributed Erlang) Tx
-(\r) TX
-TO
-u
-u
-0 R
-0 G
-233.6667 668.6667 m
-258.3333 605.3333 l
-S
-0 O
-0 g
-260.1455 603.5043 m
-260.0107 605.2261 260.0494 606.3943 260.0641 607.8236 c
-255.3637 605.993 l
-255.7458 605.6322 257.1599 604.1157 258.2248 602.7562 c
-259.3652 601.3015 260.2881 599.9391 260.7874 599.0167 c
-260.5313 600.0338 260.2896 601.6616 260.1455 603.5043 c
-f
-231.8545 670.4957 m
-231.9893 668.7739 231.9506 667.6056 231.9359 666.1764 c
-236.6363 668.007 l
-236.2542 668.3677 234.8401 669.8842 233.7752 671.2438 c
-232.6348 672.6985 231.7119 674.0609 231.2126 674.9833 c
-231.4687 673.9662 231.7104 672.3384 231.8545 670.4957 c
-f
-U
-U
-u
-u
-u
-0 R
-0 G
-268.8303 655 m
-286.3333 601.3333 l
-S
-0 O
-0 g
-288.0401 599.4055 m
-288.002 601.1321 288.1062 602.2964 288.201 603.7226 c
-283.4054 602.1585 l
-283.7667 601.777 285.0934 600.1835 286.0803 598.7664 c
-287.1373 597.25 287.9824 595.8379 288.4291 594.889 c
-288.2305 595.9188 288.0805 597.5576 288.0401 599.4055 c
-f
-267.1236 656.9278 m
-267.1616 655.2012 267.0575 654.0369 266.9626 652.6107 c
-271.7583 654.1748 l
-271.397 654.5563 270.0702 656.1498 269.0833 657.5669 c
-268.0263 659.0833 267.1813 660.4954 266.7345 661.4443 c
-266.9331 660.4145 267.0831 658.7757 267.1236 656.9278 c
-f
-U
-U
-U
-u
-u
-0 R
-0 G
-298.3333 640.3125 m
-298.3333 605.9792 l
-S
-0 O
-0 g
-299.3582 603.6172 m
-299.8574 605.2705 300.3174 606.3451 300.8498 607.6716 c
-295.8055 607.6716 l
-296.0307 607.1968 296.798 605.2705 297.2969 603.6172 c
-297.8316 601.8478 298.1972 600.2433 298.3277 599.2026 c
-298.4582 600.2433 298.8237 601.8478 299.3582 603.6172 c
-f
-297.3084 642.6745 m
-296.8092 641.0212 296.3492 639.9466 295.8168 638.6201 c
-300.8611 638.6201 l
-300.6359 639.0949 299.8686 641.0212 299.3697 642.6745 c
-298.835 644.4439 298.4694 646.0484 298.3389 647.0891 c
-298.2084 646.0484 297.8429 644.4439 297.3084 642.6745 c
-f
-U
-U
-u
-u
-0 R
-0 G
-217 550 m
-244 550 l
-S
-0 O
-0 g
-246.362 551.0249 m
-244.7087 551.5241 243.6341 551.9841 242.3076 552.5165 c
-242.3076 547.4722 l
-242.7824 547.6974 244.7087 548.4647 246.362 548.9636 c
-248.1314 549.4983 249.7359 549.8639 250.7766 549.9944 c
-249.7359 550.1249 248.1314 550.4904 246.362 551.0249 c
-f
-214.638 548.9751 m
-216.2913 548.4759 217.3659 548.0159 218.6924 547.4835 c
-218.6924 552.5278 l
-218.2176 552.3026 216.2913 551.5353 214.638 551.0364 c
-212.8686 550.5017 211.2641 550.1361 210.2234 550.0056 c
-211.2641 549.8751 212.8686 549.5096 214.638 548.9751 c
-f
-U
-U
-u
-0 R
-0 G
-364.9294 563.9595 m
-347.8588 572.5323 L
-347.8588 589.5277 L
-364.9294 598.1006 L
-382 589.5277 L
-382 572.5323 L
-364.9294 563.9595 L
-s
-0 To
-1 0 0 1 355.486 577.5962 0 Tp
-TP
-0 Tr
-0 O
-0 g
-0 Ta
-(MIB) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-401.7373 563.9595 m
-384.6667 572.5323 L
-384.6667 589.5277 L
-401.7373 598.1006 L
-418.8079 589.5277 L
-418.8079 572.5323 L
-401.7373 563.9595 L
-s
-0 To
-1 0 0 1 392.2938 577.5962 0 Tp
-TP
-0 Tr
-0 O
-0 g
-(MIB) Tx
-(\r) TX
-TO
-U
-u
-1 Ap
-0 R
-0 G
-383.3333 533.8577 m
-398.9885 533.8577 411.6799 541.4725 411.6799 550.8656 c
-411.6799 560.2586 398.9885 567.8736 383.3333 567.8736 c
-367.6781 567.8736 354.9867 560.2586 354.9867 550.8656 c
-354.9867 541.4725 367.6781 533.8577 383.3333 533.8577 c
-s
-0 To
-1 0 0 1 383.3333 553.4318 0 Tp
-TP
--9.4434 0 Td
-0 Tr
-0 O
-0 g
-1 Ta
-(Sub\r) Tx
--4.718 -12 Td
-(Agent) Tx
-(\r) TX
-TO
-U
-0 R
-0 G
-[6 8 6 8 6 8 ]0 d
-439.3333 523 m
-439.3333 666.3333 L
-331.3333 666.3333 L
-331.3333 523 L
-439.3333 523 L
-s
-u
-0 Ap
-[]0 d
-365.0208 604.6458 m
-365.0208 612.6458 l
-S
-0 O
-0 g
-363.9959 615.0078 m
-363.4967 613.3545 363.0367 612.2799 362.5043 610.9534 c
-367.5486 610.9534 l
-367.3234 611.4282 366.5561 613.3545 366.0572 615.0078 c
-365.5225 616.7772 365.1569 618.3817 365.0264 619.4224 c
-364.8959 618.3817 364.5304 616.7772 363.9959 615.0078 c
-f
-366.0457 602.2838 m
-366.5449 603.9371 367.0049 605.0117 367.5373 606.3382 c
-362.493 606.3382 l
-362.7182 605.8634 363.4855 603.9371 363.9844 602.2838 c
-364.5191 600.5144 364.8847 598.9099 365.0152 597.8692 c
-365.1457 598.9099 365.5112 600.5144 366.0457 602.2838 c
-f
-U
-u
-u
-0 R
-0 G
-402.4166 605.2917 m
-411.3333 695.6667 l
-S
-0 O
-0 g
-410.5453 698.1179 m
-409.8862 696.5216 409.3229 695.4974 408.6628 694.2295 c
-413.6827 693.7342 l
-413.5052 694.2289 412.9308 696.2212 412.5966 697.9155 c
-412.2383 699.7288 412.032 701.3615 412.0043 702.4099 c
-411.7722 701.3871 411.251 699.8262 410.5453 698.1179 c
-f
-U
-403.2089 602.8419 m
-403.8653 604.4393 404.4268 605.4645 405.0846 606.7335 c
-400.0639 607.22 l
-400.2422 606.7257 400.8201 604.7344 401.1573 603.0407 c
-401.5188 601.228 401.7279 599.5957 401.7575 598.5473 c
-401.9877 599.5705 402.5063 601.1323 403.2089 602.8419 c
-f
-U
-LB
-%AI5_EndLayer--
-%%PageTrailer
-gsave annotatepage grestore showpage
-%%Trailer
-Adobe_Illustrator_AI5 /terminate get exec
-Adobe_ColorImage_AI6 /terminate get exec
-Adobe_typography_AI5 /terminate get exec
-Adobe_level2_AI5 /terminate get exec
-%%EOF
diff --git a/lib/snmp/doc/src/snmp-um-1-image-8.ps b/lib/snmp/doc/src/snmp-um-1-image-8.ps
deleted file mode 100644
index b16739aba0..0000000000
--- a/lib/snmp/doc/src/snmp-um-1-image-8.ps
+++ /dev/null
@@ -1,2931 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: Adobe Illustrator(r) 6.0
-%%For: (Anna Fedoriw) (Ericsson Telecom)
-%%Title: (ProcessesOnOneNode.eps)
-%%CreationDate: (97-05-23) (14.05)
-%%BoundingBox: 84 522 452 731
-%%HiResBoundingBox: 84.5 522.5 451.1162 730.5099
-%%DocumentProcessColors: Black
-%%DocumentFonts: Univers
-%%DocumentSuppliedResources: procset Adobe_level2_AI5 1.0 0
-%%+ procset Adobe_typography_AI5 1.0 0
-%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6
-%%+ procset Adobe_Illustrator_AI5 1.0 0
-%AI5_FileFormat 2.0
-%AI3_ColorUsage: Black&White
-%%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set)
-%%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1
-%%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 ()
-%AI3_TemplateBox: 306 396 306 396
-%AI3_TileBox: 21 -12 588 802
-%AI3_DocumentPreview: Macintosh_ColorPic
-%AI5_ArtSize: 595.2756 841.8898
-%AI5_RulerUnits: 1
-%AI5_ArtFlags: 0 0 0 1 0 0 1 1 0
-%AI5_TargetResolution: 800
-%AI5_NumLayers: 1
-%AI5_OpenToView: 2 860 1.5 1146 827 58 1 1 3 40
-%AI5_OpenViewLayers: 7
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset Adobe_level2_AI5 1.2 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation)
-%%Version: 1.2
-%%CreationDate: (04/10/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-userdict /Adobe_level2_AI5 23 dict dup begin
- put
- /packedarray where not
- {
- userdict begin
- /packedarray
- {
- array astore readonly
- } bind def
- /setpacking /pop load def
- /currentpacking false def
- end
- 0
- } if
- pop
- userdict /defaultpacking currentpacking put true setpacking
- /initialize
- {
- Adobe_level2_AI5 begin
- } bind def
- /terminate
- {
- currentdict Adobe_level2_AI5 eq
- {
- end
- } if
- } bind def
- mark
- /setcustomcolor where not
- {
- /findcmykcustomcolor
- {
- 5 packedarray
- } bind def
- /setcustomcolor
- {
- exch aload pop pop
- 4
- {
- 4 index mul 4 1 roll
- } repeat
- 5 -1 roll pop
- setcmykcolor
- }
- def
- } if
-
- /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def
- userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put
- userdict /level2?
- systemdict /languagelevel known dup
- {
- pop systemdict /languagelevel get 2 ge
- } if
- put
-/level2ScreenFreq
-{
- begin
- 60
- HalftoneType 1 eq
- {
- pop Frequency
- } if
- HalftoneType 2 eq
- {
- pop GrayFrequency
- } if
- HalftoneType 5 eq
- {
- pop Default level2ScreenFreq
- } if
- end
-} bind def
-userdict /currentScreenFreq
- level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put
-level2? not
- {
- /setcmykcolor where not
- {
- /setcmykcolor
- {
- exch .11 mul add exch .59 mul add exch .3 mul add
- 1 exch sub setgray
- } def
- } if
- /currentcmykcolor where not
- {
- /currentcmykcolor
- {
- 0 0 0 1 currentgray sub
- } def
- } if
- /setoverprint where not
- {
- /setoverprint /pop load def
- } if
- /selectfont where not
- {
- /selectfont
- {
- exch findfont exch
- dup type /arraytype eq
- {
- makefont
- }
- {
- scalefont
- } ifelse
- setfont
- } bind def
- } if
- /cshow where not
- {
- /cshow
- {
- [
- 0 0 5 -1 roll aload pop
- ] cvx bind forall
- } bind def
- } if
- } if
- cleartomark
- /anyColor?
- {
- add add add 0 ne
- } bind def
- /testColor
- {
- gsave
- setcmykcolor currentcmykcolor
- grestore
- } bind def
- /testCMYKColorThrough
- {
- testColor anyColor?
- } bind def
- userdict /composite?
- level2?
- {
- gsave 1 1 1 1 setcmykcolor currentcmykcolor grestore
- add add add 4 eq
- }
- {
- 1 0 0 0 testCMYKColorThrough
- 0 1 0 0 testCMYKColorThrough
- 0 0 1 0 testCMYKColorThrough
- 0 0 0 1 testCMYKColorThrough
- and and and
- } ifelse
- put
- composite? not
- {
- userdict begin
- gsave
- /cyan? 1 0 0 0 testCMYKColorThrough def
- /magenta? 0 1 0 0 testCMYKColorThrough def
- /yellow? 0 0 1 0 testCMYKColorThrough def
- /black? 0 0 0 1 testCMYKColorThrough def
- grestore
- /isCMYKSep? cyan? magenta? yellow? black? or or or def
- /customColor? isCMYKSep? not def
- end
- } if
- end defaultpacking setpacking
-%%EndResource
-%%BeginResource: procset Adobe_typography_AI5 1.0 1
-%%Title: (Typography Operators)
-%%Version: 1.0
-%%CreationDate:(03/26/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_typography_AI5 54 dict dup begin
-put
-/initialize
-{
- begin
- begin
- Adobe_typography_AI5 begin
- Adobe_typography_AI5
- {
- dup xcheck
- {
- bind
- } if
- pop pop
- } forall
- end
- end
- end
- Adobe_typography_AI5 begin
-} def
-/terminate
-{
- currentdict Adobe_typography_AI5 eq
- {
- end
- } if
-} def
-/modifyEncoding
-{
- /_tempEncode exch ddef
- /_pntr 0 ddef
- {
- counttomark -1 roll
- dup type dup /marktype eq
- {
- pop pop exit
- }
- {
- /nametype eq
- {
- _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
- put
- }
- {
- /_pntr exch ddef
- } ifelse
- } ifelse
- } loop
- _tempEncode
-} def
-/TE
-{
- StandardEncoding 256 array copy modifyEncoding
- /_nativeEncoding exch def
-} def
-%
-/TZ
-{
- dup type /arraytype eq
- {
- /_wv exch def
- }
- {
- /_wv 0 def
- } ifelse
- /_useNativeEncoding exch def
- pop pop
- findfont _wv type /arraytype eq
- {
- _wv makeblendedfont
- } if
- dup length 2 add dict
- begin
- mark exch
- {
- 1 index /FID ne
- {
- def
- } if
- cleartomark mark
- } forall
- pop
- /FontName exch def
- counttomark 0 eq
- {
- 1 _useNativeEncoding eq
- {
- /Encoding _nativeEncoding def
- } if
- cleartomark
- }
- {
- /Encoding load 256 array copy
- modifyEncoding /Encoding exch def
- } ifelse
- FontName currentdict
- end
- definefont pop
-} def
-/tr
-{
- _ax _ay 3 2 roll
-} def
-/trj
-{
- _cx _cy _sp _ax _ay 6 5 roll
-} def
-/a0
-{
- /Tx
- {
- dup
- currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- } ddef
- /Tj
- {
- dup
- currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- } ddef
-} def
-/a1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/e0
-{
- /Tx
- {
- tr _psf
- } ddef
- /Tj
- {
- trj _pjsf
- } ddef
-} def
-/e1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- tr _psf
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- trj _pjsf
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/i0
-{
- /Tx
- {
- tr sp
- } ddef
- /Tj
- {
- trj jsp
- } ddef
-} def
-/i1
-{
- W N
-} def
-/o0
-{
- /Tx
- {
- tr sw rmoveto
- } ddef
- /Tj
- {
- trj swj rmoveto
- } ddef
-} def
-/r0
-{
- /Tx
- {
- tr _ctm _pss
- } ddef
- /Tj
- {
- trj _ctm _pjss
- } ddef
-} def
-/r1
-{
- /Tx
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/To
-{
- pop _ctm currentmatrix pop
-} def
-/TO
-{
- iTe _ctm setmatrix newpath
-} def
-/Tp
-{
- pop _tm astore pop _ctm setmatrix
- _tDict begin
- /W
- {
- } def
- /h
- {
- } def
-} def
-/TP
-{
- end
- iTm 0 0 moveto
-} def
-/Tr
-{
- _render 3 le
- {
- currentpoint newpath moveto
- } if
- dup 8 eq
- {
- pop 0
- }
- {
- dup 9 eq
- {
- pop 1
- } if
- } ifelse
- dup /_render exch ddef
- _renderStart exch get load exec
-} def
-/iTm
-{
- _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
-} def
-/Tm
-{
- _tm astore pop iTm 0 0 moveto
-} def
-/Td
-{
- _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
-} def
-/iTe
-{
- _render -1 eq
- {
- }
- {
- _renderEnd _render get dup null ne
- {
- load exec
- }
- {
- pop
- } ifelse
- } ifelse
- /_render -1 ddef
-} def
-/Ta
-{
- pop
-} def
-/Tf
-{
- dup 1000 div /_fScl exch ddef
-%
- selectfont
-} def
-/Tl
-{
- pop
- 0 exch _leading astore pop
-} def
-/Tt
-{
- pop
-} def
-/TW
-{
- 3 npop
-} def
-/Tw
-{
- /_cx exch ddef
-} def
-/TC
-{
- 3 npop
-} def
-/Tc
-{
- /_ax exch ddef
-} def
-/Ts
-{
- /_rise exch ddef
- currentpoint
- iTm
- moveto
-} def
-/Ti
-{
- 3 npop
-} def
-/Tz
-{
- 100 div /_hs exch ddef
- iTm
-} def
-/TA
-{
- pop
-} def
-/Tq
-{
- pop
-} def
-/Th
-{
- pop pop pop pop pop
-} def
-/TX
-{
- pop
-} def
-/Tk
-{
- exch pop _fScl mul neg 0 rmoveto
-} def
-/TK
-{
- 2 npop
-} def
-/T*
-{
- _leading aload pop neg Td
-} def
-/T*-
-{
- _leading aload pop Td
-} def
-/T-
-{
- _ax neg 0 rmoveto
- _hyphen Tx
-} def
-/T+
-{
-} def
-/TR
-{
- _ctm currentmatrix pop
- _tm astore pop
- iTm 0 0 moveto
-} def
-/TS
-{
- currentfont 3 1 roll
- /_Symbol_ _fScl 1000 mul selectfont
-
- 0 eq
- {
- Tx
- }
- {
- Tj
- } ifelse
- setfont
-} def
-/Xb
-{
- pop pop
-} def
-/Tb /Xb load def
-/Xe
-{
- pop pop pop pop
-} def
-/Te /Xe load def
-/XB
-{
-} def
-/TB /XB load def
-currentdict readonly pop
-end
-setpacking
-%%EndResource
-%%BeginProcSet: Adobe_ColorImage_AI6 1.0 0
-userdict /Adobe_ColorImage_AI6 known not
-{
- userdict /Adobe_ColorImage_AI6 17 dict put
-} if
-userdict /Adobe_ColorImage_AI6 get begin
-
- /initialize
- {
- Adobe_ColorImage_AI6 begin
- Adobe_ColorImage_AI6
- {
- dup type /arraytype eq
- {
- dup xcheck
- {
- bind
- } if
- } if
- pop pop
- } forall
- } def
- /terminate { end } def
-
- currentdict /Adobe_ColorImage_AI6_Vars known not
- {
- /Adobe_ColorImage_AI6_Vars 14 dict def
- } if
-
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 0 def
- /sourcecount 0 def
- /sourcearray 4 array def
- /plateindex -1 def
- /XIMask 0 def
- /XIBinary 0 def
- /XIChannelCount 0 def
- /XIBitsPerPixel 0 def
- /XIImageHeight 0 def
- /XIImageWidth 0 def
- /XIImageMatrix null def
- /XIBuffer null def
- /XIDataProc null def
- end
-
- /WalkRGBString null def
- /WalkCMYKString null def
-
- /StuffRGBIntoGrayString null def
- /RGBToGrayImageProc null def
- /StuffCMYKIntoGrayString null def
- /CMYKToGrayImageProc null def
- /ColorImageCompositeEmulator null def
-
- /SeparateCMYKImageProc null def
-
- /FourEqual null def
- /TestPlateIndex null def
-
- currentdict /_colorimage known not
- {
- /colorimage where
- {
- /colorimage get /_colorimage exch def
- }
- {
- /_colorimage null def
- } ifelse
- } if
-
- /_currenttransfer systemdict /currenttransfer get def
-
- /colorimage null def
- /XI null def
-
-
- /WalkRGBString
- {
- 0 3 index
-
- dup length 1 sub 0 3 3 -1 roll
- {
- 3 getinterval { } forall
-
- 5 index exec
-
- 3 index
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /WalkCMYKString
- {
- 0 3 index
-
- dup length 1 sub 0 4 3 -1 roll
- {
- 4 getinterval { } forall
-
- 6 index exec
-
- 3 index
-
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /StuffRGBIntoGrayString
- {
- .11 mul exch
-
- .59 mul add exch
-
- .3 mul add
-
- cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /RGBToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 3 idiv string
- dup 3 1 roll
-
- /StuffRGBIntoGrayString load exch
- WalkRGBString
- end
- } def
-
-
- /StuffCMYKIntoGrayString
- {
- exch .11 mul add
-
- exch .59 mul add
-
- exch .3 mul add
-
- dup 255 gt { pop 255 } if
-
- 255 exch sub cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /CMYKToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 4 idiv string
- dup 3 1 roll
-
- /StuffCMYKIntoGrayString load exch
- WalkCMYKString
- end
- } def
-
-
- /ColorImageCompositeEmulator
- {
- pop true eq
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
- }
- {
- Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 3 -1 roll put
-
- channelcount 3 eq
- {
- /RGBToGrayImageProc
- }
- {
- /CMYKToGrayImageProc
- } ifelse
- load
- end
- } if
- image
- } ifelse
- } def
-
-
- /SeparateCMYKImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
-
- sourcecount 0 ne
- {
- sourcearray plateindex get exec
- }
- {
- sourcearray 0 get exec
-
- dup length 4 idiv string
-
- 0 2 index
-
- plateindex 4 2 index length 1 sub
- {
- get 255 exch sub
-
- 3 copy put pop 1 add
-
- 2 index
- } for
-
- pop pop exch pop
- } ifelse
- end
- } def
-
-
- /FourEqual
- {
- 4 index ne
- {
- pop pop pop false
- }
- {
- 4 index ne
- {
- pop pop false
- }
- {
- 4 index ne
- {
- pop false
- }
- {
- 4 index eq
- } ifelse
- } ifelse
- } ifelse
- } def
-
-
- /TestPlateIndex
- {
- Adobe_ColorImage_AI6_Vars begin
- /plateindex -1 def
-
- /setcmykcolor where
- {
- pop
- gsave
- 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
- grestore
-
- 1 0 0 0 FourEqual
- {
- /plateindex 0 def
- }
- {
- 0 1 0 0 FourEqual
- {
- /plateindex 1 def
- }
- {
- 0 0 1 0 FourEqual
- {
- /plateindex 2 def
- }
- {
- 0 0 0 1 FourEqual
- {
- /plateindex 3 def
- }
- {
- 0 0 0 0 FourEqual
- {
- /plateindex 5 def
- } if
- } ifelse
- } ifelse
- } ifelse
- } ifelse
- pop pop pop pop
- } if
- plateindex
- end
- } def
-
-
- /colorimage
- {
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 1 index def
- /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
-
- 4 sourcecount add index dup
- 8 eq exch 1 eq or not
- end
-
- {
- /_colorimage load null ne
- {
- _colorimage
- }
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get
- 7 add { pop } repeat
- } ifelse
- }
- {
- dup 3 eq
- TestPlateIndex
- dup -1 eq exch 5 eq or or
- {
- /_colorimage load null eq
- {
- ColorImageCompositeEmulator
- }
- {
- dup 1 eq
- {
- pop pop image
- }
- {
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- gsave
-
- 0 _currenttransfer exec
- 1 _currenttransfer exec
- eq
- { 0 _currenttransfer exec 0.5 lt }
- { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
-
- { { pop 0 } } { { pop 1 } } ifelse
- systemdict /settransfer get exec
- } if
-
- _colorimage
-
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- grestore
- } if
- } ifelse
- } ifelse
- }
- {
- dup 1 eq
- {
- pop pop
- image
- }
- {
- pop pop
-
- Adobe_ColorImage_AI6_Vars begin
- sourcecount -1 0
- {
- exch sourcearray 3 1 roll put
- } for
-
- /SeparateCMYKImageProc load
- end
-
- systemdict /image get exec
- } ifelse
- } ifelse
- } ifelse
- } def
-
- /XI
- {
- Adobe_ColorImage_AI6_Vars begin
- gsave
- /XIMask exch 0 ne def
- /XIBinary exch 0 ne def
- pop
- pop
- /XIChannelCount exch def
- /XIBitsPerPixel exch def
- /XIImageHeight exch def
- /XIImageWidth exch def
- pop pop pop pop
- /XIImageMatrix exch def
-
- XIBitsPerPixel 1 eq
- {
- XIImageWidth 8 div ceiling cvi
- }
- {
- XIImageWidth XIChannelCount mul
- } ifelse
- /XIBuffer exch string def
-
- XIBinary
- {
- /XIDataProc { currentfile XIBuffer readstring pop } def
- currentfile 128 string readline pop pop
- }
- {
- /XIDataProc { currentfile XIBuffer readhexstring pop } def
- } ifelse
-
- 0 0 moveto
- XIImageMatrix concat
- XIImageWidth XIImageHeight scale
-
- XIMask
- {
- XIImageWidth XIImageHeight
- false
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- /_lp /null ddef
- _fc
- /_lp /imagemask ddef
-
- imagemask
- }
- {
- XIImageWidth XIImageHeight
- XIBitsPerPixel
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- XIChannelCount 1 eq
- {
-
- gsave
- 0 setgray
-
- image
-
- grestore
- }
- {
- false
- XIChannelCount
- colorimage
- } ifelse
- } ifelse
- grestore
- end
- } def
-
-end
-%%EndProcSet
-%%BeginResource: procset Adobe_Illustrator_AI5 1.1 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Full Prolog)
-%%Version: 1.1
-%%CreationDate: (3/7/1994) ()
-%%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_Illustrator_AI5_vars 81 dict dup begin
-put
-/_eo false def
-/_lp /none def
-/_pf
-{
-} def
-/_ps
-{
-} def
-/_psf
-{
-} def
-/_pss
-{
-} def
-/_pjsf
-{
-} def
-/_pjss
-{
-} def
-/_pola 0 def
-/_doClip 0 def
-/cf currentflat def
-/_tm matrix def
-/_renderStart
-[
-/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0
-] def
-/_renderEnd
-[
-null null null null /i1 /i1 /i1 /i1
-] def
-/_render -1 def
-/_rise 0 def
-/_ax 0 def
-/_ay 0 def
-/_cx 0 def
-/_cy 0 def
-/_leading
-[
-0 0
-] def
-/_ctm matrix def
-/_mtx matrix def
-/_sp 16#020 def
-/_hyphen (-) def
-/_fScl 0 def
-/_cnt 0 def
-/_hs 1 def
-/_nativeEncoding 0 def
-/_useNativeEncoding 0 def
-/_tempEncode 0 def
-/_pntr 0 def
-/_tDict 2 dict def
-/_wv 0 def
-/Tx
-{
-} def
-/Tj
-{
-} def
-/CRender
-{
-} def
-/_AI3_savepage
-{
-} def
-/_gf null def
-/_cf 4 array def
-/_if null def
-/_of false def
-/_fc
-{
-} def
-/_gs null def
-/_cs 4 array def
-/_is null def
-/_os false def
-/_sc
-{
-} def
-/_pd 1 dict def
-/_ed 15 dict def
-/_pm matrix def
-/_fm null def
-/_fd null def
-/_fdd null def
-/_sm null def
-/_sd null def
-/_sdd null def
-/_i null def
-/discardSave null def
-/buffer 256 string def
-/beginString null def
-/endString null def
-/endStringLength null def
-/layerCnt 1 def
-/layerCount 1 def
-/perCent (%) 0 get def
-/perCentSeen? false def
-/newBuff null def
-/newBuffButFirst null def
-/newBuffLast null def
-/clipForward? false def
-end
-userdict /Adobe_Illustrator_AI5 known not {
- userdict /Adobe_Illustrator_AI5 91 dict put
-} if
-userdict /Adobe_Illustrator_AI5 get begin
-/initialize
-{
- Adobe_Illustrator_AI5 dup begin
- Adobe_Illustrator_AI5_vars begin
- discardDict
- {
- bind pop pop
- } forall
- dup /nc get begin
- {
- dup xcheck 1 index type /operatortype ne and
- {
- bind
- } if
- pop pop
- } forall
- end
- newpath
-} def
-/terminate
-{
- end
- end
-} def
-/_
-null def
-/ddef
-{
- Adobe_Illustrator_AI5_vars 3 1 roll put
-} def
-/xput
-{
- dup load dup length exch maxlength eq
- {
- dup dup load dup
- length 2 mul dict copy def
- } if
- load begin
- def
- end
-} def
-/npop
-{
- {
- pop
- } repeat
-} def
-/sw
-{
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
-} def
-/swj
-{
- dup 4 1 roll
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
- 6 2 roll /_cnt 0 ddef
- {
- 1 index eq
- {
- /_cnt _cnt 1 add ddef
- } if
- } forall
- pop
- exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop
-} def
-/ss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put pop
- gsave
- false charpath currentpoint
- 4 index setmatrix
- stroke
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 3 npop
-} def
-/jss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- gsave
- _sp eq
- {
- exch 6 index 6 index 6 index 5 -1 roll widthshow
- currentpoint
- }
- {
- false charpath currentpoint
- 4 index setmatrix stroke
- } ifelse
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 6 npop
-} def
-/sp
-{
- {
- 2 npop (0) exch
- 2 copy 0 exch put pop
- false charpath
- 2 copy rmoveto
- } exch cshow
- 2 npop
-} def
-/jsp
-{
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- _sp eq
- {
- exch 5 index 5 index 5 index 5 -1 roll widthshow
- }
- {
- false charpath
- } ifelse
- 2 copy rmoveto
- } exch cshow
- 5 npop
-} def
-/pl
-{
- transform
- 0.25 sub round 0.25 add exch
- 0.25 sub round 0.25 add exch
- itransform
-} def
-/setstrokeadjust where
-{
- pop true setstrokeadjust
- /c
- {
- curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll curveto
- } def
- /V
- /v load def
- /y
- {
- 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- lineto
- } def
- /L
- /l load def
- /m
- {
- moveto
- } def
-}
-{
- /c
- {
- pl curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll pl curveto
- } def
- /V
- /v load def
- /y
- {
- pl 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- pl lineto
- } def
- /L
- /l load def
- /m
- {
- pl moveto
- } def
-} ifelse
-/d
-{
- setdash
-} def
-/cf
-{
-} def
-/i
-{
- dup 0 eq
- {
- pop cf
- } if
- setflat
-} def
-/j
-{
- setlinejoin
-} def
-/J
-{
- setlinecap
-} def
-/M
-{
- setmiterlimit
-} def
-/w
-{
- setlinewidth
-} def
-/XR
-{
- 0 ne
- /_eo exch ddef
-} def
-/H
-{
-} def
-/h
-{
- closepath
-} def
-/N
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- _eo {eoclip} {clip} ifelse /_doClip 0 ddef
- } if
- newpath
- }
- {
- /CRender
- {
- N
- } ddef
- } ifelse
-} def
-/n
-{
- N
-} def
-/F
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc
- /_doClip 0 ddef
- }
- {
- _pf
- } ifelse
- }
- {
- /CRender
- {
- F
- } ddef
- } ifelse
-} def
-/f
-{
- closepath
- F
-} def
-/S
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- _ps
- } ifelse
- }
- {
- /CRender
- {
- S
- } ddef
- } ifelse
-} def
-/s
-{
- closepath
- S
-} def
-/B
-{
- _pola 0 eq
- {
- _doClip 1 eq
- gsave F grestore
- {
- gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- S
- } ifelse
- }
- {
- /CRender
- {
- B
- } ddef
- } ifelse
-} def
-/b
-{
- closepath
- B
-} def
-/W
-{
- /_doClip 1 ddef
-} def
-/*
-{
- count 0 ne
- {
- dup type /stringtype eq
- {
- pop
- } if
- } if
- newpath
-} def
-/u
-{
-} def
-/U
-{
-} def
-/q
-{
- _pola 0 eq
- {
- gsave
- } if
-} def
-/Q
-{
- _pola 0 eq
- {
- grestore
- } if
-} def
-/*u
-{
- _pola 1 add /_pola exch ddef
-} def
-/*U
-{
- _pola 1 sub /_pola exch ddef
- _pola 0 eq
- {
- CRender
- } if
-} def
-/D
-{
- pop
-} def
-/*w
-{
-} def
-/*W
-{
-} def
-/`
-{
- /_i save ddef
- clipForward?
- {
- nulldevice
- } if
- 6 1 roll 4 npop
- concat pop
- userdict begin
- /showpage
- {
- } def
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {pop false setstrokeadjust} if
- newpath
- 0 setgray
- false setoverprint
-} def
-/~
-{
- end
- _i restore
-} def
-/O
-{
- 0 ne
- /_of exch ddef
- /_lp /none ddef
-} def
-/R
-{
- 0 ne
- /_os exch ddef
- /_lp /none ddef
-} def
-/g
-{
- /_gf exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _gf setgray
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/G
-{
- /_gs exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _gs setgray
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/k
-{
- _cf astore pop
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _cf aload pop setcmykcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/K
-{
- _cs astore pop
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _cs aload pop setcmykcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/x
-{
- /_gf exch ddef
- findcmykcustomcolor
- /_if exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _if _gf 1 exch sub setcustomcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/X
-{
- /_gs exch ddef
- findcmykcustomcolor
- /_is exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _is _gs 1 exch sub setcustomcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/A
-{
- pop
-} def
-/annotatepage
-{
-userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse
-} def
-/XT {
- pop pop
-} def
-/discard
-{
- save /discardSave exch store
- discardDict begin
- /endString exch store
- gt38?
- {
- 2 add
- } if
- load
- stopped
- pop
- end
- discardSave restore
-} bind def
-userdict /discardDict 7 dict dup begin
-put
-/pre38Initialize
-{
- /endStringLength endString length store
- /newBuff buffer 0 endStringLength getinterval store
- /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store
- /newBuffLast newBuff endStringLength 1 sub 1 getinterval store
-} def
-/shiftBuffer
-{
- newBuff 0 newBuffButFirst putinterval
- newBuffLast 0
- currentfile read not
- {
- stop
- } if
- put
-} def
-0
-{
- pre38Initialize
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff endString eq
- {
- cleartomark stop
- } if
- shiftBuffer
- } loop
- }
- {
- stop
- } ifelse
-} def
-1
-{
- pre38Initialize
- /beginString exch store
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff beginString eq
- {
- /layerCount dup load 1 add store
- }
- {
- newBuff endString eq
- {
- /layerCount dup load 1 sub store
- layerCount 0 eq
- {
- cleartomark stop
- } if
- } if
- } ifelse
- shiftBuffer
- } loop
- } if
-} def
-2
-{
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- endString eq
- {
- cleartomark stop
- } if
- } loop
-} def
-3
-{
- /beginString exch store
- /layerCnt 1 store
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- dup beginString eq
- {
- pop /layerCnt dup load 1 add store
- }
- {
- endString eq
- {
- layerCnt 1 eq
- {
- cleartomark stop
- }
- {
- /layerCnt dup load 1 sub store
- } ifelse
- } if
- } ifelse
- } loop
-} def
-end
-userdict /clipRenderOff 15 dict dup begin
-put
-{
- /n /N /s /S /f /F /b /B
-}
-{
- {
- _doClip 1 eq
- {
- /_doClip 0 ddef _eo {eoclip} {clip} ifelse
- } if
- newpath
- } def
-} forall
-/Tr /pop load def
-/Bb {} def
-/BB /pop load def
-/Bg {12 npop} def
-/Bm {6 npop} def
-/Bc /Bm load def
-/Bh {4 npop} def
-end
-/Lb
-{
- 4 npop
- 6 1 roll
- pop
- 4 1 roll
- pop pop pop
- 0 eq
- {
- 0 eq
- {
- (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard
- }
- {
-
- /clipForward? true def
-
- /Tx /pop load def
- /Tj /pop load def
-
- currentdict end clipRenderOff begin begin
- } ifelse
- }
- {
- 0 eq
- {
- save /discardSave exch store
- } if
- } ifelse
-} bind def
-/LB
-{
- discardSave dup null ne
- {
- restore
- }
- {
- pop
- clipForward?
- {
- currentdict
- end
- end
- begin
-
- /clipForward? false ddef
- } if
- } ifelse
-} bind def
-/Pb
-{
- pop pop
- 0 (%AI5_EndPalette) discard
-} bind def
-/Np
-{
- 0 (%AI5_End_NonPrinting--) discard
-} bind def
-/Ln /pop load def
-/Ap
-/pop load def
-/Ar
-{
- 72 exch div
- 0 dtransform dup mul exch dup mul add sqrt
- dup 1 lt
- {
- pop 1
- } if
- setflat
-} def
-/Mb
-{
- q
-} def
-/Md
-{
-} def
-/MB
-{
- Q
-} def
-/nc 3 dict def
-nc begin
-/setgray
-{
- pop
-} bind def
-/setcmykcolor
-{
- 4 npop
-} bind def
-/setcustomcolor
-{
- 2 npop
-} bind def
-currentdict readonly pop
-end
-end
-setpacking
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%IncludeFont: Univers
-Adobe_level2_AI5 /initialize get exec
-Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec
-Adobe_ColorImage_AI6 /initialize get exec
-Adobe_Illustrator_AI5 /initialize get exec
-[
-39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
-/Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
-/egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
-/oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
-/udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
-/registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
-/.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
-/.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
-/questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
-/guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
-/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
-/.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
-/fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
-/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
-/Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
-/Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
-/hungarumlaut/ogonek/caron
-TE
-%AI3_BeginEncoding: _Univers Univers
-[/_Univers/Univers 0 0 1 TZ
-%AI3_EndEncoding AdobeType
-%AI5_Begin_NonPrinting
-Np
-8 Bn
-%AI5_BeginGradient: (Black & White)
-(Black & White) 0 2 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Green & Blue)
-(Green & Blue) 0 2 Bd
-[
-<
-99999A9A9B9B9B9C9C9D9D9D9E9E9F9F9FA0A0A1A1A1A2A2A3A3A3A4A4A5A5A5A6A6A7A7A7A8A8A9
-A9A9AAAAABABABACACADADADAEAEAFAFAFB0B0B1B1B1B2B2B3B3B3B4B4B5B5B5B6B6B7B7B7B8B8B9
-B9B9BABABBBBBBBCBCBDBDBDBEBEBFBFBFC0C0C1C1C1C2C2C3C3C3C4C4C5C5C5C6C6C7C7C7C8C8C9
-C9C9CACACBCBCBCCCCCDCDCDCECECFCFCFD0D0D1D1D1D2D2D3D3D3D4D4D5D5D5D6D6D7D7D7D8D8D9
-D9D9DADADBDBDBDCDCDDDDDDDEDEDFDFDFE0E0E1E1E1E2E2E3E3E3E4E4E5E5E5E6E6E7E7E7E8E8E9
-E9E9EAEAEBEBEBECECEDEDEDEEEEEFEFEFF0F0F1F1F1F2F2F3F3F3F4F4F5F5F5F6F6F7F7F7F8F8F9
-F9F9FAFAFBFBFBFCFCFDFDFDFEFEFFFF
->
-<
-000102020304050506070808090A0B0B0C0D0E0E0F101111121314141516171718191A1A1B1C1D1D
-1E1F20202122232324252626272829292A2B2C2C2D2E2F2F303132323334353536373838393A3B3B
-3C3D3E3E3F404141424344444546474748494A4A4B4C4D4D4E4F5050515253535455565657585959
-5A5B5C5C5D5E5F5F606162626364656566676868696A6B6B6C6D6E6E6F7071717273747475767777
-78797A7A7B7C7D7D7E7F80808182828384858586878888898A8B8B8C8D8E8E8F9091919293949495
-96979798999A9A9B9C9D9D9E9FA0A0A1A2A3A3A4A5A6A6A7A8A9A9AAABACACADAEAFAFB0B1B2B2B3
-B4B5B5B6B7B8B8B9BABBBBBCBDBEBEBF
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-[
-1 0.75 0 0 1 50 100 %_Bs
-0.6 0 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Pink, Yellow, Green)
-(Pink, Yellow, Green) 0 3 Bd
-[
-<
-00000000000000000000000000000000000000010101010101010101010101010101010101010101
-01010101010202020202020202020202020202020202020202020203030303030303030303030303
-03030303030303030404040404040404040404040404040404040404050505050505050505050505
-05050505050505060606060606060606060606060606060606060707070707070707070707070707
-07070707080808080808080808080808080808080809090909090909090909090909090909090A0A
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0C
-0C0C0C0C0C0C0C0D0D0D0D0D
->
-<
-050506060606070708080809090A0A0A0B0B0C0C0D0D0E0E0F0F1010111112121313141415151617
-17181819191A1A1B1C1C1D1D1E1F1F202021222223232425252626272828292A2A2B2C2C2D2D2E2F
-2F3031313233333435353637373839393A3B3B3C3D3E3E3F4040414242434445454647474849494A
-4B4C4C4D4E4F4F505151525354545556575758595A5A5B5C5C5D5E5F5F6061626363646566666768
-69696A6B6C6C6D6E6F707071727373747576777778797A7B7B7C7D7E7F7F80818283838485868787
-88898A8B8B8C8D8E8F8F9091929394949596979898999A9B9C9D9D9E9FA0A1A2A2A3A4A5A6A7A7A8
-A9AAABACADADAEAFB0B1B2B2
->
-<
-CCCCCBCBCBCACACAC9C9C8C8C7C7C6C6C5C5C4C4C3C2C2C1C1C0C0BFBEBEBDBDBCBBBBBAB9B9B8B7
-B7B6B6B5B4B4B3B2B1B1B0AFAFAEADADACABAAAAA9A8A8A7A6A5A5A4A3A2A2A1A0A09F9E9D9C9C9B
-9A999998979696959493929291908F8E8E8D8C8B8A8A8988878686858483828181807F7E7D7C7C7B
-7A7978777776757473727171706F6E6D6C6B6A6A69686766656463636261605F5E5D5C5B5B5A5958
-5756555453525151504F4E4D4C4B4A49484746464544434241403F3E3D3C3B3A3938383736353433
-3231302F2E2D2C2B2A29282726252423222221201F1E1D1C1B1A191817161514131211100F0E0D0C
-0B0A09080706050403020100
->
-0
-1 %_Br
-<
-737271706F6E6D6C6B6A696867666564636261605F5E5D5C5B5B5A59585756555453525150504F4E
-4D4C4B4A4949484746454443434241403F3E3E3D3C3B3A3A393837363635343333323130302F2E2D
-2D2C2B2A2A29282827262525242323222121201F1F1E1D1D1C1C1B1A1A1918181717161615141413
-1312121111100F0F0E0E0D0D0C0C0C0B0B0A0A090908080807070606060505050404040303030202
-020201010101010000000000
->
-<
-00000000000000000000000001010101010101010101010101010101010101010101010102020202
-02020202020202020202020202020202020202020202030303030303030303030303030303030303
-03030303030303030303030303040404040404040404040404040404040404040404040404040404
-04040404040404040404050505050505050505050505050505050505050505050505050505050505
-050505050505050505050505
->
-<
-BFBFBFC0C0C0C0C0C0C0C0C0C1C1C1C1C1C1C1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C3C3
-C3C4C4C4C4C4C4C4C4C4C4C5C5C5C5C5C5C5C5C5C5C5C6C6C6C6C6C6C6C6C6C6C6C6C7C7C7C7C7C7
-C7C7C7C7C7C7C8C8C8C8C8C8C8C8C8C8C8C8C8C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9CACACACACACA
-CACACACACACACACACACACBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCCCCCCCCCCCCCCCC
-CCCCCCCCCCCCCCCCCCCCCCCC
->
-0
-1 %_Br
-[
-0.05 0.7 0 0 1 50 100 %_Bs
-0 0.02 0.8 0 1 57 36 %_Bs
-0.45 0 0.75 0 1 37 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Purple, Red & Yellow)
-(Purple, Red & Yellow) 0 3 Bd
-[
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A
->
-<
-CCCCCCCDCDCDCDCDCECECECECECFCFCFCFD0D0D0D0D0D1D1D1D1D1D2D2D2D2D2D3D3D3D3D3D4D4D4
-D4D5D5D5D5D5D6D6D6D6D6D7D7D7D7D7D8D8D8D8D8D9D9D9D9DADADADADADBDBDBDBDBDCDCDCDCDC
-DDDDDDDDDDDEDEDEDEDFDFDFDFDFE0E0E0E0E0E1E1E1E1E1E2E2E2E2E2E3E3E3E3E4E4E4E4E4E5E5
-E5E5E5E6E6E6E6E6E7E7E7E7E7E8E8E8E8E9E9E9E9E9EAEAEAEAEAEBEBEBEBEBECECECECECEDEDED
-EDEEEEEEEEEEEFEFEFEFEFF0F0F0F0F0F1F1F1F1F1F2F2F2F2F3F3F3F3F3F4F4F4F4F4F5F5F5F5F5
-F6F6F6F6F6F7F7F7F7F8F8F8F8F8F9F9F9F9F9FAFAFAFAFAFBFBFBFBFBFCFCFCFCFDFDFDFDFDFEFE
-FEFEFEFFFFFF
->
-0
-1 %_Br
-<
-E5E4E3E2E1E0DFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBE
-BDBCBBBAB9B8B7B6B5B4B3B2B1B0AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A99989796
-9594939291908F8E8D8C8B8A898887868584838281807F7E7D7C7B7A797877767574737271706F6E
-6D6C6B6A696867666564636261605F5E5D5C5B5A595857565554535251504F4E4D4C4B4A49484746
-4544434241403F3E3D3C3B3A393837363534333231302F2E2D2C2B2A292827262524232221201F1E
-1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
->
-<
-E5E6E6E6E6E6E6E6E6E7E7E7E7E7E7E7E7E7E8E8E8E8E8E8E8E8E8E9E9E9E9E9E9E9E9E9EAEAEAEA
-EAEAEAEAEAEBEBEBEBEBEBEBEBEBECECECECECECECECECEDEDEDEDEDEDEDEDEDEEEEEEEEEEEEEEEE
-EEEFEFEFEFEFEFEFEFEFF0F0F0F0F0F0F0F0F0F1F1F1F1F1F1F1F1F1F2F2F2F2F2F2F2F2F2F3F3F3
-F3F3F3F3F3F3F4F4F4F4F4F4F4F4F4F5F5F5F5F5F5F5F5F5F6F6F6F6F6F6F6F6F6F7F7F7F7F7F7F7
-F7F7F8F8F8F8F8F8F8F8F8F9F9F9F9F9F9F9F9F9FAFAFAFAFAFAFAFAFAFBFBFBFBFBFBFBFBFBFCFC
-FCFCFCFCFCFCFCFDFDFDFDFDFDFDFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFF
->
-<
-00010203040405060708090A0B0C0C0D0E0F10111213141415161718191A1B1C1D1D1E1F20212223
-242525262728292A2B2C2D2D2E2F30313233343535363738393A3B3C3D3D3E3F4041424344454546
-4748494A4B4C4D4E4E4F50515253545556565758595A5B5C5D5E5E5F60616263646566666768696A
-6B6C6D6E6E6F70717273747576767778797A7B7C7D7E7F7F80818283848586878788898A8B8C8D8E
-8F8F90919293949596979798999A9B9C9D9E9F9FA0A1A2A3A4A5A6A7A7A8A9AAABACADAEAFAFB0B1
-B2B3B4B5B6B7B8B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C8C9CACBCC
->
-0
-1 %_Br
-[
-0 0.04 1 0 1 50 100 %_Bs
-0 1 0.8 0 1 50 50 %_Bs
-0.9 0.9 0 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Rainbow)
-(Rainbow) 0 6 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-0
-1 %_Br
-1
-<
-0708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E
-2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556
-5758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E
-7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6
-A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCE
-CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6
-F7F8F9FAFBFCFDFEFF
->
-0
-0
-1 %_Br
-1
-<
-00000000000000000000000000000000000001010101010101010101010101010101010101010101
-01010101010101010101010101010202020202020202020202020202020202020202020202020202
-02020202020202020202030303030303030303030303030303030303030303030303030303030303
-03030303030304040404040404040404040404040404040404040404040404040404040404040404
-04040505050505050505050505050505050505050505050505050505050505050505050505050606
-06060606060606060606060606060606060606060606060606060606060606060606070707070707
-07070707070707070707070707070707
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0
-1
-0
-1 %_Br
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-1 %_Br
-[
-0 1 0 0 1 50 100 %_Bs
-1 1 0 0 1 50 80 %_Bs
-1 0.0279 0 0 1 50 60 %_Bs
-1 0 1 0 1 50 40 %_Bs
-0 0 1 0 1 50 20 %_Bs
-0 1 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Steel Bar)
-(Steel Bar) 0 3 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 70 %_Bs
-0 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Orange Radial)
-(Yellow & Orange Radial) 1 2 Bd
-[
-0
-<
-0001010203040506060708090A0B0C0C0D0E0F10111213131415161718191A1B1C1D1D1E1F202122
-232425262728292A2B2B2C2D2E2F303132333435363738393A3B3C3D3E3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60606162636465666768696A6B6C6D6E6F
-707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C
->
-<
-FFFFFFFFFEFEFEFEFEFEFEFDFDFDFDFDFDFCFCFCFCFCFCFBFBFBFBFBFBFAFAFAFAFAFAF9F9F9F9F9
-F9F8F8F8F8F8F8F7F7F7F7F7F7F6F6F6F6F6F6F5F5F5F5F5F5F4F4F4F4F4F3F3F3F3F3F3F2F2F2F2
-F2F2F1F1F1F1F1F0F0F0F0F0F0EFEFEFEFEFEFEEEEEEEEEEEDEDEDEDEDEDECECECECECEBEBEBEBEB
-EBEAEAEAEAEAE9E9E9E9E9E9E8E8E8E8E8E8E7E7E7E7E7E6E6E6E6E6E5
->
-0
-1 %_Br
-[
-0 0 1 0 1 52 19 %_Bs
-0 0.55 0.9 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Purple Radial)
-(Yellow & Purple Radial) 1 2 Bd
-[
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-<
-1415161718191A1B1C1D1E1F1F202122232425262728292A2A2B2C2D2E2F30313233343536363738
-393A3B3C3D3E3F40414142434445464748494A4B4C4D4D4E4F50515253545556575858595A5B5C5D
-5E5F60616263646465666768696A6B6C6D6E6F6F707172737475767778797A7B7B7C7D7E7F808182
-83848586868788898A8B8C8D8E8F90919292939495969798999A9B9C9D9D9E9FA0A1A2A3A4A5A6A7
-A8A9A9AAABACADAEAFB0B1B2B3B4B4B5B6B7B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C9CACBCB
-CCCDCECFD0D1D2D3D4D5D6D7D7D8D9DADBDCDDDEDFE0E1E2E2E3E4E5E6E7E8E9EAEBECEDEEEEEFF0
-F1F2F3F4F5F6F7F8F9F9FAFBFCFDFEFF
->
-<
-ABAAAAA9A8A7A7A6A5A5A4A3A3A2A1A1A09F9F9E9D9D9C9B9B9A9999989797969595949393929191
-908F8F8E8D8D8C8B8B8A8989888787868585848383828181807F7F7E7D7D7C7B7B7A797978777776
-7575747373727171706F6F6E6D6D6C6B6B6A6969686767666565646362626160605F5E5E5D5C5C5B
-5A5A5958585756565554545352525150504F4E4E4D4C4C4B4A4A4948484746464544444342424140
-403F3E3E3D3C3C3B3A3A3938383736363534343332323130302F2E2E2D2C2C2B2A2A292828272626
-25242423222121201F1F1E1D1D1C1B1B1A1919181717161515141313121111100F0F0E0D0D0C0B0B
-0A090908070706050504030302010100
->
-0
-1 %_Br
-[
-0 0.08 0.67 0 1 50 14 %_Bs
-1 1 0 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_End_NonPrinting--
-%AI5_BeginPalette
-0 2 Pb
-Pn
-Pc
-1 g
-Pc
-0 g
-Pc
-0 0 0 0 k
-Pc
-0.75 g
-Pc
-0.5 g
-Pc
-0.25 g
-Pc
-0 g
-Pc
-Bb
-2 (Black & White) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0 0 0 k
-Pc
-0.5 0 0 0 k
-Pc
-0.75 0 0 0 k
-Pc
-1 0 0 0 k
-Pc
-0.25 0.25 0 0 k
-Pc
-0.5 0.5 0 0 k
-Pc
-0.75 0.75 0 0 k
-Pc
-1 1 0 0 k
-Pc
-Bb
-2 (Pink, Yellow, Green) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0 0 k
-Pc
-0 0.5 0 0 k
-Pc
-0 0.75 0 0 k
-Pc
-0 1 0 0 k
-Pc
-0 0.25 0.25 0 k
-Pc
-0 0.5 0.5 0 k
-Pc
-0 0.75 0.75 0 k
-Pc
-0 1 1 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Purple Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0 0.25 0 k
-Pc
-0 0 0.5 0 k
-Pc
-0 0 0.75 0 k
-Pc
-0 0 1 0 k
-Pc
-0.25 0 0.25 0 k
-Pc
-0.5 0 0.5 0 k
-Pc
-0.75 0 0.75 0 k
-Pc
-1 0 1 0 k
-Pc
-Bb
-2 (Rainbow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0 0 k
-Pc
-0.5 0.25 0 0 k
-Pc
-0.75 0.375 0 0 k
-Pc
-1 0.5 0 0 k
-Pc
-0.125 0.25 0 0 k
-Pc
-0.25 0.5 0 0 k
-Pc
-0.375 0.75 0 0 k
-Pc
-0.5 1 0 0 k
-Pc
-Bb
-2 (Steel Bar) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0.125 0 k
-Pc
-0 0.5 0.25 0 k
-Pc
-0 0.75 0.375 0 k
-Pc
-0 1 0.5 0 k
-Pc
-0 0.125 0.25 0 k
-Pc
-0 0.25 0.5 0 k
-Pc
-0 0.375 0.75 0 k
-Pc
-0 0.5 1 0 k
-Pc
-Bb
-2 (Purple, Red & Yellow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0 0.25 0 k
-Pc
-0.25 0 0.5 0 k
-Pc
-0.375 0 0.75 0 k
-Pc
-0.5 0 1 0 k
-Pc
-0.25 0 0.125 0 k
-Pc
-0.5 0 0.25 0 k
-Pc
-0.75 0 0.375 0 k
-Pc
-1 0 0.5 0 k
-Pc
-Bb
-2 (Green & Blue) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0.125 0 k
-Pc
-0.5 0.25 0.25 0 k
-Pc
-0.75 0.375 0.375 0 k
-Pc
-1 0.5 0.5 0 k
-Pc
-0.25 0.25 0.125 0 k
-Pc
-0.5 0.5 0.25 0 k
-Pc
-0.75 0.75 0.375 0 k
-Pc
-1 1 0.5 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Orange Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0.25 0.125 0 k
-Pc
-0.25 0.5 0.25 0 k
-Pc
-0.375 0.75 0.375 0 k
-Pc
-0.5 1 0.5 0 k
-Pc
-0.125 0.25 0.25 0 k
-Pc
-0.25 0.5 0.5 0 k
-Pc
-0.375 0.75 0.75 0 k
-Pc
-0.5 1 1 0 k
-Pc
-0 0 0 0 k
-Pc
-0.125 0.125 0.25 0 k
-Pc
-0.25 0.25 0.5 0 k
-Pc
-0.375 0.375 0.75 0 k
-Pc
-0.5 0.5 1 0 k
-Pc
-0.25 0.125 0.25 0 k
-Pc
-0.5 0.25 0.5 0 k
-Pc
-0.75 0.375 0.75 0 k
-Pc
-1 0.5 1 0 k
-Pc
-PB
-%AI5_EndPalette
-%%EndSetup
-%AI5_BeginLayer
-1 1 1 1 0 0 0 79 128 255 Lb
-(Layer 1) Ln
-0 A
-800 Ar
-0 J 0 j 1 w 4 M []0 d
-%AI3_Note:
-0 D
-0 XR
--4014 283.5 m
-4626 283.5 L
-(N) *
-453.5 4716 m
-453.5 -3924 L
-(N) *
-85 4716 m
-85 -3924 L
-(N) *
--4014 765.5 m
-4626 765.5 L
-(N) *
-u
-1 Ap
-0 R
-0 G
-415.1831 559.9902 m
-434.752 559.9902 450.6162 569.5087 450.6162 581.25 c
-450.6162 592.9914 434.752 602.5099 415.1831 602.5099 c
-395.6142 602.5099 379.75 592.9914 379.75 581.25 c
-379.75 569.5087 395.6142 559.9902 415.1831 559.9902 c
-s
-0 To
-1 0 0 1 415.1831 577.8162 0 Tp
-TP
--9.4434 0 Td
-0 Tr
-0 O
-0 g
-/_Univers 10 Tf
-0 Ts
-100 Tz
-0 Tt
-1 TA
-%_ 0 XL
-36 0 Xb
-XB
-0 0 5 TC
-100 100 200 TW
-0 0 0 Ti
-1 Ta
-0 0 2 2 3 Th
-0 Tq
-0 0 Tl
-0 Tc
-0 Tw
-(MIB) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-341.4331 559.9902 m
-361.002 559.9902 376.8662 569.5087 376.8662 581.25 c
-376.8662 592.9914 361.002 602.5099 341.4331 602.5099 c
-321.8642 602.5099 306 592.9914 306 581.25 c
-306 569.5087 321.8642 559.9902 341.4331 559.9902 c
-s
-0 To
-1 0 0 1 341.4331 577.8162 0 Tp
-TP
--9.4434 0 Td
-0 Tr
-0 O
-0 g
-(MIB) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-267.6831 559.9902 m
-287.252 559.9902 303.1162 569.5087 303.1162 581.25 c
-303.1162 592.9914 287.252 602.5099 267.6831 602.5099 c
-248.1142 602.5099 232.25 592.9914 232.25 581.25 c
-232.25 569.5087 248.1142 559.9902 267.6831 559.9902 c
-s
-0 To
-1 0 0 1 267.6831 577.8162 0 Tp
-TP
--12.7747 0 Td
-0 Tr
-0 O
-0 g
-(Net if) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-415.1831 616.7402 m
-434.752 616.7402 450.6162 626.2587 450.6162 638 c
-450.6162 649.7414 434.752 659.2599 415.1831 659.2599 c
-395.6142 659.2599 379.75 649.7414 379.75 638 c
-379.75 626.2587 395.6142 616.7402 415.1831 616.7402 c
-s
-0 To
-1 0 0 1 415.1831 634.5662 0 Tp
-TP
--6.9446 0 Td
-0 Tr
-0 O
-0 g
-(SA) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-341.4331 616.7402 m
-361.002 616.7402 376.8662 626.2587 376.8662 638 c
-376.8662 649.7414 361.002 659.2599 341.4331 659.2599 c
-321.8642 659.2599 306 649.7414 306 638 c
-306 626.2587 321.8642 616.7402 341.4331 616.7402 c
-s
-0 To
-1 0 0 1 341.4331 634.5662 0 Tp
-TP
--8.3289 0 Td
-0 Tr
-0 O
-0 g
-(MA) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-267.6831 616.7402 m
-287.252 616.7402 303.1162 626.2587 303.1162 638 c
-303.1162 649.7414 287.252 659.2599 267.6831 659.2599 c
-248.1142 659.2599 232.25 649.7414 232.25 638 c
-232.25 626.2587 248.1142 616.7402 267.6831 616.7402 c
-s
-0 To
-1 0 0 1 267.6831 640.5662 0 Tp
-TP
--21.3855 0 Td
-0 Tr
-0 O
-0 g
-(symbolic\r) Tx
-9.4434 -12 Td
-(store) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-193.9331 616.7402 m
-213.502 616.7402 229.3662 626.2587 229.3662 638 c
-229.3662 649.7414 213.502 659.2599 193.9331 659.2599 c
-174.3642 659.2599 158.5 649.7414 158.5 638 c
-158.5 626.2587 174.3642 616.7402 193.9331 616.7402 c
-s
-0 To
-1 0 0 1 193.9331 634.5662 0 Tp
-TP
--23.8831 0 Td
-0 Tr
-0 O
-0 g
-(note store) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-120.4331 616.7402 m
-140.002 616.7402 155.8662 626.2587 155.8662 638 c
-155.8662 649.7414 140.002 659.2599 120.4331 659.2599 c
-100.8642 659.2599 85 649.7414 85 638 c
-85 626.2587 100.8642 616.7402 120.4331 616.7402 c
-s
-0 To
-1 0 0 1 120.4331 634.5662 0 Tp
-TP
--18.6096 0 Td
-0 Tr
-0 O
-0 g
-(local db) Tx
-(\r) TX
-TO
-U
-u
-0 R
-0 G
-231 687.4902 m
-250.5689 687.4902 266.4331 697.0087 266.4331 708.75 c
-266.4331 720.4914 250.5689 730.0099 231 730.0099 c
-211.4311 730.0099 195.5669 720.4914 195.5669 708.75 c
-195.5669 697.0087 211.4311 687.4902 231 687.4902 c
-s
-0 To
-1 0 0 1 231 705.3162 0 Tp
-TP
--25 0 Td
-0 Tr
-0 O
-0 g
-(supervisor) Tx
-(\r) TX
-TO
-U
-0 Ap
-0 R
-0 G
-96.6667 526 m
-156.6667 526 l
-S
-0 To
-1 0 0 1 171.6667 525 0 Tp
-TP
--9.7229 0 Td
-0 Tr
-0 O
-0 g
-(Link) Tx
-(\r) TX
-TO
-0 R
-0 G
-193.9331 659.2599 m
-231 687.4902 l
-267.6831 659.2599 l
-S
-231 687.4902 m
-341.4331 659.2599 l
-S
-415.1831 659.2599 m
-231 687.4902 l
-120.4331 659.2599 l
-S
-341.4331 602.5 m
-341.4331 616.7402 l
-267.6831 602.5099 l
-S
-376.8662 638 m
-379.75 638 l
-S
-415.1831 616.7402 m
-415.1831 602.5099 l
-S
-LB
-%AI5_EndLayer--
-%%PageTrailer
-gsave annotatepage grestore showpage
-%%Trailer
-Adobe_Illustrator_AI5 /terminate get exec
-Adobe_ColorImage_AI6 /terminate get exec
-Adobe_typography_AI5 /terminate get exec
-Adobe_level2_AI5 /terminate get exec
-%%EOF
diff --git a/lib/snmp/doc/src/snmp.xml b/lib/snmp/doc/src/snmp.xml
index 3e6610891f..801193675c 100644
--- a/lib/snmp/doc/src/snmp.xml
+++ b/lib/snmp/doc/src/snmp.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1996</year><year>2012</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -341,8 +342,9 @@
<func>
<name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) -> ok | {error, Reason}</name>
- <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) -> ok | {error, Reason}</name>
- <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block | Start) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Block | Stop) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop, Block) -> ok | {error, Reason}</name>
<fsummary>Convert an Audit Trail Log to text format</fsummary>
<type>
<v>LogDir = string()</v>
@@ -352,53 +354,56 @@
<v>LogName = string()</v>
<v>LogFile = string()</v>
<v>Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} </v>
+ <v>Block = boolean()</v>
<v>Reason = term()</v>
</type>
<desc>
- <p>Converts an Audit Trail Log to a readable text file, where
- each item has a trailing TAB character, and any TAB
- character in the body of an item has been replaced by ESC
- TAB.
- </p>
+ <p>Converts an Audit Trail Log to a readable text file, where
+ each item has a trailing TAB character, and any TAB
+ character in the body of an item has been replaced by ESC
+ TAB. </p>
<p>The function can be used on a running system, or by copying
- the entire log directory and calling this function. SNMP
- must be running in order to provide MIB information.
- </p>
+ the entire log directory and calling this function. SNMP
+ must be running in order to provide MIB information. </p>
<p><c>LogDir</c> is the name of the directory where the audit
- trail log is stored.
- <c>Mibs</c> is a list of Mibs to be used. The function uses
- the information in the Mibs to convert for example object
- identifiers to their symbolic name.
- <c>OutFile</c> is the name of the generated text-file.
- <c>LogName</c> is the name of the log,
- <c>LogFile</c> is the name of the log file.
- <c>Start</c> is the start (first) date and time from which
- log events will be converted and
- <c>Stop</c> is the stop (last) date and time to which log
- events will be converted.
- </p>
- <p>The format of an audit trail log text item is as follows:
- </p>
- <p><c>Tag Addr - Community [TimeStamp] Vsn</c><br></br>
- <c>PDU</c></p>
- <p>where <c>Tag</c> is <c>request</c>, <c>response</c>,
- <c>report</c>, <c>trap</c> or <c>inform</c>; Addr is
- <c>IP:Port</c> (or comma space separated list of such);
- <c>Community</c> is the community parameter (SNMP version
- v1 and v2), or <c>SecLevel:"AuthEngineID":"UserName"</c>
- (SNMP v3); <c>TimeStamp</c> is a date and time stamp,
- and <c>Vsn</c> is the SNMP version. <c>PDU</c> is a textual
- version of the protocol data unit. There is a new line
- between <c>Vsn</c> and <c>PDU</c>.</p>
-
+ trail log is stored.
+ <c>Mibs</c> is a list of Mibs to be used. The function uses
+ the information in the Mibs to convert for example object
+ identifiers to their symbolic name.
+ <c>OutFile</c> is the name of the generated text-file.
+ <c>LogName</c> is the name of the log,
+ <c>LogFile</c> is the name of the log file.
+ <c>Start</c> is the start (first) date and time from which
+ log events will be converted and
+ <c>Stop</c> is the stop (last) date and time to which log
+ events will be converted.
+ The <c>Block</c> argument indicates if the log should be blocked
+ during conversion. This could be usefull when converting large
+ logs (when otherwise the log could wrap during conversion).
+ Defaults to <c>true</c>.
+ </p>
+ <p>The format of an audit trail log text item is as follows: </p>
+ <p><c>Tag Addr - Community [TimeStamp] Vsn</c><br></br>
+ <c>PDU</c></p>
+ <p>where <c>Tag</c> is <c>request</c>, <c>response</c>,
+ <c>report</c>, <c>trap</c> or <c>inform</c>; Addr is
+ <c>IP:Port</c> (or comma space separated list of such);
+ <c>Community</c> is the community parameter (SNMP version
+ v1 and v2), or <c>SecLevel:"AuthEngineID":"UserName"</c>
+ (SNMP v3); <c>TimeStamp</c> is a date and time stamp,
+ and <c>Vsn</c> is the SNMP version. <c>PDU</c> is a textual
+ version of the protocol data unit. There is a new line
+ between <c>Vsn</c> and <c>PDU</c>.</p>
+
<marker id="log_to_io"></marker>
</desc>
</func>
<func>
<name>log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Block | Start) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start, Block | Stop) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop, Block) -> ok | {error, Reason}</name>
<fsummary>Convert an Audit Trail Log to text format</fsummary>
<type>
<v>LogDir = string()</v>
diff --git a/lib/snmp/doc/src/snmp_advanced_agent.xml b/lib/snmp/doc/src/snmp_advanced_agent.xml
index 6600206c2d..b17246438d 100644
--- a/lib/snmp/doc/src/snmp_advanced_agent.xml
+++ b/lib/snmp/doc/src/snmp_advanced_agent.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -339,7 +340,7 @@
SEQUENCE {
empDepNo INTEGER,
empName DisplayString,
- empTelNo DisplayString
+ empTelNo DisplayString,
empStatus RowStatus
}
</code>
diff --git a/lib/snmp/doc/src/snmp_agent_config_files.xml b/lib/snmp/doc/src/snmp_agent_config_files.xml
index bd5c537522..e1a4c143cd 100644
--- a/lib/snmp/doc/src/snmp_agent_config_files.xml
+++ b/lib/snmp/doc/src/snmp_agent_config_files.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2011</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -32,13 +33,15 @@
<file>snmp_agent_config_files.xml</file>
</header>
<p>All configuration data must be included in configuration files
- that are located in the configuration directory. The name of this
- directory is given in the <c>config_dir</c> configuration
- parameter. These files are read at start-up, and are used to
- initialize the SNMPv2-MIB or STANDARD-MIB, SNMP-FRAMEWORK-MIB,
- SNMP-MPD-MIB, SNMP-VIEW-BASED-ACM-MIB, SNMP-COMMUNITY-MIB,
- SNMP-USER-BASED-SM-MIB, SNMP-TARGET-MIB and SNMP-NOTIFICATION-MIB
- (refer to the <seealso marker="snmp_agent_funct_descr#management">Management of the Agent</seealso> for a description of the MIBs). </p>
+ that are located in the configuration directory. The name of this
+ directory is given in the <c>config_dir</c> configuration
+ parameter. These files are read at start-up, and are used to
+ initialize the SNMPv2-MIB or STANDARD-MIB, SNMP-FRAMEWORK-MIB,
+ SNMP-MPD-MIB, SNMP-VIEW-BASED-ACM-MIB, SNMP-COMMUNITY-MIB,
+ SNMP-USER-BASED-SM-MIB, SNMP-TARGET-MIB and SNMP-NOTIFICATION-MIB
+ (refer to the
+ <seealso marker="snmp_agent_funct_descr#management">Management of the Agent</seealso>
+ for a description of the MIBs). </p>
<p>The files are: </p>
<list type="bulleted">
<item>
@@ -79,85 +82,104 @@
</item>
</list>
<p>The directory where the configuration files are found is given as
- a parameter to the agent. </p>
+ a parameter to the agent. </p>
<p>The entry format in all files are Erlang terms, separated by a
- '<em>.</em>' and a <em>newline</em>. In the following sections, the
- formats of these terms are described. Comments may be specified as
- ordinary Erlang comments. </p>
+ '<em>.</em>' and a <em>newline</em>. In the following sections, the
+ formats of these terms are described. Comments may be specified as
+ ordinary Erlang comments. </p>
<p>Syntax errors in these files are discovered and reported with the
- function <c>config_err/2</c> of the error report module at start-up. </p>
-
+ function <c>config_err/2</c> of the error report module at start-up. </p>
+
+ <marker id="agent_information"></marker>
+
<section>
- <marker id="agent_information"></marker>
<title>Agent Information</title>
<p>The agent information should be stored in a file called
- <c>agent.conf</c>.
- </p>
- <p>Each entry is a tuple of size two:
- </p>
+ <c>agent.conf</c>. </p>
+ <p>Each entry is a tuple of size two:</p>
<p><c>{AgentVariable, Value}.</c></p>
<list type="bulleted">
- <item><c>AgentVariable</c> is one of the variables is
- SNMP-FRAMEWORK-MIB or one of the internal variables
- <c>intAgentUDPPort</c>, which defines which UDP port the agent
- listens to, or <c>intAgentIpAddress</c>, which defines the IP
- address of the agent.
+ <item>
+ <p><c>AgentVariable</c> is one of the variables is
+ SNMP-FRAMEWORK-MIB or one of the internal variables
+ <c>intAgentUDPPort</c>, which defines which UDP port the agent
+ listens to, or <c>intAgentTransports</c>, which defines the
+ transport domains and addresses of the agent. </p>
</item>
- <item><c>Value</c> is the value for the variable.
+ <item>
+ <p><c>Value</c> is the value for the variable.</p>
</item>
</list>
- <p>The following example shows a <c>agent.conf</c> file:
- </p>
+ <p>The following example shows an <c>agent.conf</c> file: </p>
<pre>
{intAgentUDPPort, 4000}.
-{intAgentIpAddress,[141,213,11,24]}.
+{intAgentTransports,
+ [{transportDomainUdpIpv4, {141,213,11,24}},
+ {transportDomainUdpIpv6, {0,0,0,0,0,0,0,1}}]}.
{snmpEngineID, "mbj's engine"}.
{snmpEngineMaxPacketSize, 484}.
</pre>
+ <p>The value of <c>intAgentTransports</c> is a list of
+ <c>{Domain, Addr}</c> tuples, where <c>Domain</c>
+ is either <c>transportDomainUdpIpv4</c> or <c>transportDomainUdpIpv6</c>,
+ and <c>Addr</c> is the address in the domain.
+ <c>Addr</c> can be specified either as an
+ <c>IpAddr</c> or as an <c>{IpAddr, IpPort}</c> tuple.
+ <c>IpAddr</c> is either a regular Erlang/OTP
+ <seealso marker="kernel:inet#type-ip_address"><c>ip_address()</c></seealso>
+ or a traditional SNMP integer list and <c>IpPort</c> is an integer.
+ </p>
+
+ <p>When the <c>Addr</c> value does not contain a port number,
+ the value of <c>intAgentUDPPort</c> is used.</p>
+
+ <p>The legacy and intermediate variables <c>intAgentIpAddress</c>
+ and <c>intAgentTransportDomain</c> are still supported so old
+ <c>agent.conf</c> files will work.
+ </p>
+
<p>The value of <c>snmpEngineID</c> is a string, which for a
- deployed agent should have a very specific structure. See
- RFC 2271/2571 for details.
- </p>
+ deployed agent should have a very specific structure. See
+ RFC 2271/2571 for details.</p>
+
+ <marker id="context"></marker>
</section>
<section>
- <marker id="context"></marker>
<title>Contexts</title>
<p>The context information should be stored in a file called
- <c>context.conf</c>. The default context <c>""</c>
- need not be present.
- </p>
+ <c>context.conf</c>. The default context <c>""</c>
+ need not be present.</p>
<p>Each row defines a context in the agent. This information is
- used in the table <c>vacmContextTable</c> in the
- SNMP-VIEW-BASED-ACM-MIB.
- </p>
- <p>Each entry is a term:
- </p>
+ used in the table <c>vacmContextTable</c> in the
+ SNMP-VIEW-BASED-ACM-MIB.</p>
+ <p>Each entry is a term:</p>
<p><c>ContextName.</c></p>
<list type="bulleted">
- <item><c>ContextName</c> is a string.
+ <item>
+ <p><c>ContextName</c> is a string.</p>
</item>
</list>
+
+ <marker id="system_information"></marker>
</section>
<section>
- <marker id="system_information"></marker>
<title>System Information</title>
<p>The system information should be stored in a file called
- <c>standard.conf</c>.
- </p>
- <p>Each entry is a tuple of size two:
- </p>
+ <c>standard.conf</c>.</p>
+ <p>Each entry is a tuple of size two:</p>
<p><c>{SystemVariable, Value}.</c></p>
<list type="bulleted">
- <item><c>SystemVariable</c> is one of the variables in the
- system group, or <c>snmpEnableAuthenTraps</c>.
+ <item>
+ <p><c>SystemVariable</c> is one of the variables in the
+ system group, or <c>snmpEnableAuthenTraps</c>. </p>
</item>
- <item><c>Value</c> is the value for the variable.
+ <item>
+ <p><c>Value</c> is the value for the variable. </p>
</item>
</list>
- <p>The following example shows a valid <c>standard.conf</c> file:
- </p>
+ <p>The following example shows a valid <c>standard.conf</c> file: </p>
<pre>
{sysDescr, "Erlang SNMP agent"}.
{sysObjectID, [1,2,3]}.
@@ -167,59 +189,60 @@
{snmpEnableAuthenTraps, enabled}.
</pre>
<p>A value must be provided for all variables, which lack default
- values in the MIB.
- </p>
+ values in the MIB. </p>
+
+ <marker id="community"></marker>
</section>
<section>
- <marker id="community"></marker>
<title>Communities</title>
<p>The community information should be stored in a file called
- <c>community.conf</c>. It must be present if the agent is
- configured for SNMPv1 or SNMPv2c.
- </p>
+ <c>community.conf</c>. It must be present if the agent is
+ configured for SNMPv1 or SNMPv2c. </p>
<p>An SNMP <em>community</em> is a relationship between an SNMP
agent and a set of SNMP managers that defines authentication, access
control and proxy characteristics. </p>
<p>The corresponding table is <c>snmpCommunityTable</c> in the
- SNMP-COMMUNITY-MIB. </p>
+ SNMP-COMMUNITY-MIB. </p>
<p>Each entry is a term: </p>
- <p><c>{CommunityIndex, CommunityName, SecurityName, ContextName, TransportTag}.</c></p>
+ <p><c>{CommunityIndex, CommunityName, SecurityName, ContextName, TransportTag}.</c> </p>
<list type="bulleted">
- <item><c>CommunityIndex</c> is a non-empty string.
+ <item>
+ <p><c>CommunityIndex</c> is a non-empty string.</p>
</item>
- <item><c>CommunityName</c> is a string.
+ <item>
+ <p><c>CommunityName</c> is a string.</p>
</item>
- <item><c>SecurityName</c> is a string.
+ <item>
+ <p><c>SecurityName</c> is a string.</p>
</item>
- <item><c>ContextName</c> is a string.
+ <item>
+ <p><c>ContextName</c> is a string.</p>
</item>
- <item><c>TransportTag</c> is a string.
+ <item>
+ <p><c>TransportTag</c> is a string.</p>
</item>
</list>
+
+ <marker id="vacm"></marker>
</section>
<section>
- <marker id="vacm"></marker>
<title>MIB Views for VACM</title>
<p>The information about MIB Views for VACM should be stored in a
- file called
- <c>vacm.conf</c>.
- </p>
+ file called <c>vacm.conf</c>.</p>
<p>The corresponding tables are <c>vacmSecurityToGroupTable</c>,
- <c>vacmAccessTable</c> and <c>vacmViewTreeFamilyTable</c> in the
- SNMP-VIEW-BASED-ACM-MIB.
- </p>
+ <c>vacmAccessTable</c> and <c>vacmViewTreeFamilyTable</c> in the
+ SNMP-VIEW-BASED-ACM-MIB.</p>
<p>Each entry is one of the terms, one entry corresponds to one
- row in one of the tables.
- </p>
+ row in one of the tables.</p>
<p><c>{vacmSecurityToGroup, SecModel, SecName, GroupName}.</c></p>
<p><c>{vacmAccess, GroupName, Prefix, SecModel, SecLevel, Match, ReadView, WriteView, NotifyView}.</c></p>
<p><c>{vacmViewTreeFamily, ViewIndex, ViewSubtree, ViewStatus, ViewMask}.</c></p>
<list type="bulleted">
<item>
<p><c>SecModel</c> is <c>any</c>, <c>v1</c>, <c>v2c</c>, or
- <c>usm</c>.</p>
+ <c>usm</c>.</p>
</item>
<item>
<p><c>SecName</c> is a string.</p>
@@ -232,7 +255,7 @@
</item>
<item>
<p><c>SecLevel</c> is <c>noAuthNoPriv</c>, <c>authNoPriv</c>,
- or <c>authPriv</c></p>
+ or <c>authPriv</c></p>
</item>
<item>
<p><c>Match</c> is <c>prefix</c> or <c>exact</c>.</p>
@@ -244,8 +267,7 @@
<p><c>WriteView</c> is a string.</p>
</item>
<item>
- <p><c>NotifyView</c> is a string.
- </p>
+ <p><c>NotifyView</c> is a string.</p>
</item>
<item>
<p><c>ViewIndex</c> is an integer.</p>
@@ -258,33 +280,29 @@
</item>
<item>
<p><c>ViewMask</c> is either <c>null</c> or a list of ones and
- zeros. Ones nominate that an exact match is used for this
- sub-identifier. Zeros are wild-cards which match any
- sub-identifier. If the mask is shorter than the sub-tree, the
- tail is regarded as all ones. <c>null</c> is shorthand for a
- mask with all ones.</p>
+ zeros. Ones nominate that an exact match is used for this
+ sub-identifier. Zeros are wild-cards which match any
+ sub-identifier. If the mask is shorter than the sub-tree, the
+ tail is regarded as all ones. <c>null</c> is shorthand for a
+ mask with all ones. </p>
</item>
</list>
+
+ <marker id="usm"></marker>
</section>
<section>
- <marker id="usm"></marker>
<title>Security data for USM</title>
<p>The information about Security data for USM should be stored in a
- file called
- <c>usm.conf</c>, which must be present if the agent is configured
- for SNMPv3.
- </p>
+ file called <c>usm.conf</c>, which must be present if the agent is
+ configured for SNMPv3. </p>
<p>The corresponding table is <c>usmUserTable</c> in the
- SNMP-USER-BASED-SM-MIB.
- </p>
- <p>Each entry is a term:
- </p>
+ SNMP-USER-BASED-SM-MIB.</p>
+ <p>Each entry is a term:</p>
<p><c>{EngineID, UserName, SecName, Clone, AuthP, AuthKeyC, OwnAuthKeyC, PrivP, PrivKeyC, OwnPrivKeyC, Public, AuthKey, PrivKey}.</c></p>
<list type="bulleted">
<item>
- <p><c>EngineID</c> is a string.
- </p>
+ <p><c>EngineID</c> is a string.</p>
</item>
<item>
<p><c>UserName</c> is a string.</p>
@@ -297,7 +315,7 @@
</item>
<item>
<p><c>AuthP</c> is a <c>usmNoAuthProtocol</c>,
- <c>usmHMACMD5AuthProtocol</c>, or <c>usmHMACSHAAuthProtocol</c>.</p>
+ <c>usmHMACMD5AuthProtocol</c>, or <c>usmHMACSHAAuthProtocol</c>.</p>
</item>
<item>
<p><c>AuthKeyC</c> is a string.</p>
@@ -307,7 +325,7 @@
</item>
<item>
<p><c>PrivP</c> is a <c>usmNoPrivProtocol</c>,
- <c>usmDESPrivProtocol</c> or <c>usmAesCfb128Protocol</c>.</p>
+ <c>usmDESPrivProtocol</c> or <c>usmAesCfb128Protocol</c>.</p>
</item>
<item>
<p><c>PrivKeyC</c> is a string.</p>
@@ -319,77 +337,73 @@
<p><c>Public</c> is a string.</p>
</item>
<item>
- <p><c>AuthKey</c> is a list (of integer). This is the User's secret
- localized authentication key. It is not visible in the MIB. The length
- of this key needs to be 16 if <c>usmHMACMD5AuthProtocol</c> is used, and
- 20 if <c>usmHMACSHAAuthProtocol</c> is used.</p>
+ <p><c>AuthKey</c> is a list (of integer). This is the User's secret
+ localized authentication key. It is not visible in the MIB. The length
+ of this key needs to be 16 if <c>usmHMACMD5AuthProtocol</c> is used,
+ and 20 if <c>usmHMACSHAAuthProtocol</c> is used.</p>
</item>
<item>
<p><c>PrivKey</c> is a list (of integer). This is the User's secret
- localized encryption key. It is not visible in the MIB. The length
- of this key needs to be 16 if <c>usmDESPrivProtocol</c> or
- <c>usmAesCfb128Protocol</c> is used.
- </p>
+ localized encryption key. It is not visible in the MIB. The length
+ of this key needs to be 16 if <c>usmDESPrivProtocol</c> or
+ <c>usmAesCfb128Protocol</c> is used. </p>
</item>
</list>
+
+ <marker id="notify"></marker>
</section>
<section>
- <marker id="notify"></marker>
<title>Notify Definitions</title>
<p>The information about Notify Definitions should be stored in a
- file called
- <c>notify.conf</c>.
- </p>
+ file called <c>notify.conf</c>. </p>
<p>The corresponding table is <c>snmpNotifyTable</c> in the
- SNMP-NOTIFICATION-MIB.
- </p>
- <p>Each entry is a term:
- </p>
+ SNMP-NOTIFICATION-MIB.</p>
+ <p>Each entry is a term:</p>
<p><c>{NotifyName, Tag, Type}.</c></p>
<list type="bulleted">
<item>
- <p><c>NotifyName</c> is a unique non-empty string.
- </p>
+ <p><c>NotifyName</c> is a unique non-empty string.</p>
</item>
<item>
- <p><c>Tag</c> is a string.
- </p>
+ <p><c>Tag</c> is a string.</p>
</item>
<item>
- <p><c>Type</c> is <c>trap</c> or <c>inform</c>.
- </p>
+ <p><c>Type</c> is <c>trap</c> or <c>inform</c>.</p>
</item>
</list>
+
+ <marker id="target_addr"></marker>
</section>
<section>
- <marker id="target_addr"></marker>
<title>Target Address Definitions</title>
<p>The information about Target Address Definitions should be
- stored in a file called <c>target_addr.conf</c>. </p>
+ stored in a file called <c>target_addr.conf</c>. </p>
<p>The corresponding tables are <c>snmpTargetAddrTable</c> in the
- SNMP-TARGET-MIB and <c>snmpTargetAddrExtTable</c> in the
- SNMP-COMMUNITY-MIB. </p>
+ SNMP-TARGET-MIB and <c>snmpTargetAddrExtTable</c> in the
+ SNMP-COMMUNITY-MIB. </p>
<p>Each entry is a term: </p>
- <p><c>{TargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId}.</c> <br></br> or <br></br>
-<c>{TargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize}.</c> <br></br> or <br></br>
-<c>{TargetName, Domain, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize}.</c></p>
+ <p><c>{TargetName, Domain, Addr, Timeout, RetryCount, TagList, ParamsName, EngineId}.</c>
+ <br></br> or <br></br>
+ <c>{TargetName, Domain, Addr, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize}.</c> </p>
<list type="bulleted">
<item>
- <p><c>TargetName</c> is a unique non-empty string.
- </p>
+ <p><c>TargetName</c> is a unique non-empty string. </p>
</item>
<item>
<p><c>Domain</c> is one of the atoms:
<c>transportDomainUdpIpv4</c> | <c>transportDomainUdpIpv6</c>. </p>
</item>
<item>
- <p><c>Ip</c> is a list of four or eight integers. </p>
- </item>
- <item>
- <p><c>Udp</c> is an integer. </p>
+ <p><c>Addr</c> is either an <c>IpAddr</c> or
+ an <c>{IpAddr, IpPort}</c> tuple. <c>IpAddr</c> is either
+ a regular Erlang/OTP
+ <seealso marker="kernel:inet#type-ip_address"><c>ip_address()</c></seealso>
+ or a traditional SNMP integer list, and <c>IpPort</c> is an integer.</p>
+ <p>If <c>IpPort</c> is omitted <c>162</c> is used.</p>
</item>
+
<item>
<p><c>Timeout</c> is an integer. </p>
</item>
@@ -406,48 +420,49 @@
<p><c>EngineId</c> is a string or the atom <c>discovery</c>. </p>
</item>
<item>
- <p><c>TMask</c> is a list of integer() of size 0,
- size 6 or size 10 (default: []). </p>
+ <p><c>TMask</c> is specified just as <c>Addr</c> or as <c>[]</c>.
+ Note in particular that using a list of 6 bytes for IPv4
+ or 8 words plus 2 bytes for IPv6 are still valid address formats
+ so old configurations will work.</p>
</item>
<item>
<p><c>MaxMessageSize</c> is an integer (default: 2048). </p>
</item>
</list>
+ <p>The old tuple formats with <c>Ip</c> address and <c>Udp</c>
+ port number found in old configurations still work.</p>
<p>Note that if <c>EngineId</c> has the value <c>discovery</c>,
- the agent cannot send
- <c>inform</c> messages to that manager until it has performed the
- <em>discovery</em> process with that manager. </p>
+ the agent cannot send
+ <c>inform</c> messages to that manager until it has performed the
+ <em>discovery</em> process with that manager. </p>
+
+ <marker id="target_params"></marker>
</section>
<section>
- <marker id="target_params"></marker>
<title>Target Parameters Definitions</title>
<p>The information about Target Parameters Definitions should be
- stored in a file called <c>target_params.conf</c>. </p>
+ stored in a file called <c>target_params.conf</c>. </p>
<p>The corresponding table is <c>snmpTargetParamsTable</c> in the
- SNMP-TARGET-MIB. </p>
+ SNMP-TARGET-MIB. </p>
<p>Each entry is a term: </p>
<p><c>{ParamsName, MPModel, SecurityModel, SecurityName, SecurityLevel}.</c></p>
<list type="bulleted">
<item>
- <p><c>ParamsName</c> is a unique non-empty string.
- </p>
+ <p><c>ParamsName</c> is a unique non-empty string. </p>
</item>
<item>
<p><c>MPModel</c> is <c>v1</c>, <c>v2c</c> or <c>v3</c></p>
</item>
<item>
- <p><c>SecurityModel</c> is <c>v1</c>, <c>v2c</c>, or <c>usm</c>.
- </p>
+ <p><c>SecurityModel</c> is <c>v1</c>, <c>v2c</c>, or <c>usm</c>.</p>
</item>
<item>
- <p><c>SecurityName</c> is a string.
- </p>
+ <p><c>SecurityName</c> is a string.</p>
</item>
<item>
<p><c>SecurityLevel</c> is <c>noAuthNoPriv</c>, <c>authNoPriv</c>
- or <c>authPriv</c>.
- </p>
+ or <c>authPriv</c>. </p>
</item>
</list>
</section>
diff --git a/lib/snmp/doc/src/snmp_agent_funct_descr.xml b/lib/snmp/doc/src/snmp_agent_funct_descr.xml
index 9a1bf28ab1..fdcab79646 100644
--- a/lib/snmp/doc/src/snmp_agent_funct_descr.xml
+++ b/lib/snmp/doc/src/snmp_agent_funct_descr.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_agent_netif.xml b/lib/snmp/doc/src/snmp_agent_netif.xml
index 8f1d860d58..a8dea5ab7b 100644
--- a/lib/snmp/doc/src/snmp_agent_netif.xml
+++ b/lib/snmp/doc/src/snmp_agent_netif.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2011</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -51,7 +52,8 @@
</p>
<p>It is also possible to write your own Net if process. The default
Net if process is implemented in the module <c>snmpa_net_if</c> and
- it uses UDP as the transport protocol.
+ it uses UDP as the transport protocol i.e the transport domains
+ <c>transportDomainUdpIpv4</c> and/or <c>transportDomainUdpIpv6</c>.
</p>
<p>This section describes how to write a Net if process.
</p>
@@ -70,6 +72,11 @@
<p>The section <em>Messages</em> describes mandatory messages, which
Net if must send and be able to receive.
</p>
+ <p>In this section an <c>Address</c> field is a
+ <c>{Domain, Addr}</c> tuple where <c>Domain</c> is
+ <c>transportDomainUdpIpv4</c> or <c>transportDomainUdpIpv4</c>,
+ and <c>Addr</c> is an
+ <c>{</c><seealso marker="kernel:inet#type-ip_address"><c>IpAddr</c></seealso><c>,IpPort}</c> tuple.</p>
<section>
<marker id="outgoing_messages"></marker>
@@ -96,10 +103,7 @@ MasterAgent ! {snmp_pdu, Vsn, Pdu, PduMS, ACMData, From, Extra}
in use. Normally this is returned from
<c>snmpa_mpd:process_packet</c> (see Reference Manual).
</item>
- <item><c>From</c> is the source address. If UDP over IP is
- used, this should be a 2-tuple <c>{IP, UDPport}</c>, where
- <c>IP</c> is a 4-tuple with the IP address, and <c>UDPport</c>
- is an integer.
+ <item><c>From</c> is the source <c>Address</c>.
</item>
<item><c>Extra</c> is any term the Net if process wishes to
send to the agent. This term can be retrieved by the
@@ -127,10 +131,7 @@ Pid ! {snmp_response_received, Vsn, Pdu, From}
</item>
<item><c>Pdu</c> is the SNMP Pdu received
</item>
- <item><c>From</c> is the source address. If UDP over IP is
- used, this should be a 2-tuple <c>{IP, UDPport}</c>, where
- <c>IP</c> is a 4-tuple with the IP address, and <c>UDPport</c>
- is an integer.
+ <item><c>From</c> is the source <c>Address</c>.
</item>
</list>
</section>
@@ -168,10 +169,9 @@ Pid ! {snmp_response_received, Vsn, Pdu, From}
(see Reference Manual). </p>
</item>
<item>
- <p><c>To</c> is the destination address. If UDP over IP
- is used, this should be a 2-tuple <c>{IP, UDPport}</c>,
- where <c>IP</c> is a 4-tuple with the IP address, and
- <c>UDPport</c> is an integer. </p>
+ <p><c>To</c> is the destination <c>Address</c> that comes
+ from the <c>From</c> field in the corresponding <c>snmp_pdu</c>
+ message previously sent to the MasterAgent.</p>
</item>
<item>
<p><c>Extra</c> is the term that the Net if process
@@ -230,7 +230,8 @@ Pid ! {snmp_response_received, Vsn, Pdu, From}
SNMPv3, it is the context information. </p>
</item>
<item>
- <p><c>To</c> is a list of the destination addresses and
+ <p><c>To</c> is a list of <c>{Address, SecData}</c>
+ tuples i.e the destination addresses and
their corresponding security parameters. This value is
normally sent to <c>snmpa_mpd:generate_message/4</c>. </p>
</item>
@@ -268,7 +269,8 @@ Pid ! {snmp_response_received, Vsn, Pdu, From}
SNMPv3, it is the context information. </p>
</item>
<item>
- <p><c>To</c> is a list of the destination addresses and
+ <p><c>To</c> is a list of <c>{Address, SecData}</c>
+ tuples i.e the destination addresses and
their corresponding security parameters. This value is
normally sent to <c>snmpa_mpd:generate_message/4</c>. </p>
</item>
diff --git a/lib/snmp/doc/src/snmp_agent_netif_1.ps b/lib/snmp/doc/src/snmp_agent_netif_1.ps
deleted file mode 100644
index 40a6376591..0000000000
--- a/lib/snmp/doc/src/snmp_agent_netif_1.ps
+++ /dev/null
@@ -1,2909 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: Adobe Illustrator(r) 6.0
-%%For: (Anna Fedoriw) (Ericsson Telecom)
-%%Title: (PurposeofNetif.eps)
-%%CreationDate: (97-05-23) (14.06)
-%%BoundingBox: 89 539 446 708
-%%HiResBoundingBox: 89.6046 539.5735 445.5998 707.3677
-%%DocumentProcessColors: Black
-%%DocumentFonts: Univers
-%%DocumentSuppliedResources: procset Adobe_level2_AI5 1.0 0
-%%+ procset Adobe_typography_AI5 1.0 0
-%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6
-%%+ procset Adobe_Illustrator_AI5 1.0 0
-%AI5_FileFormat 2.0
-%AI3_ColorUsage: Black&White
-%%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set)
-%%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1
-%%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 ()
-%AI3_TemplateBox: 306 396 306 396
-%AI3_TileBox: 21 -12 588 802
-%AI3_DocumentPreview: Macintosh_ColorPic
-%AI5_ArtSize: 595.2756 841.8898
-%AI5_RulerUnits: 1
-%AI5_ArtFlags: 0 0 0 1 0 0 1 1 0
-%AI5_TargetResolution: 800
-%AI5_NumLayers: 1
-%AI5_OpenToView: 2 796 1.5 1146 827 58 1 1 3 40
-%AI5_OpenViewLayers: 7
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset Adobe_level2_AI5 1.2 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation)
-%%Version: 1.2
-%%CreationDate: (04/10/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-userdict /Adobe_level2_AI5 23 dict dup begin
- put
- /packedarray where not
- {
- userdict begin
- /packedarray
- {
- array astore readonly
- } bind def
- /setpacking /pop load def
- /currentpacking false def
- end
- 0
- } if
- pop
- userdict /defaultpacking currentpacking put true setpacking
- /initialize
- {
- Adobe_level2_AI5 begin
- } bind def
- /terminate
- {
- currentdict Adobe_level2_AI5 eq
- {
- end
- } if
- } bind def
- mark
- /setcustomcolor where not
- {
- /findcmykcustomcolor
- {
- 5 packedarray
- } bind def
- /setcustomcolor
- {
- exch aload pop pop
- 4
- {
- 4 index mul 4 1 roll
- } repeat
- 5 -1 roll pop
- setcmykcolor
- }
- def
- } if
-
- /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def
- userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put
- userdict /level2?
- systemdict /languagelevel known dup
- {
- pop systemdict /languagelevel get 2 ge
- } if
- put
-/level2ScreenFreq
-{
- begin
- 60
- HalftoneType 1 eq
- {
- pop Frequency
- } if
- HalftoneType 2 eq
- {
- pop GrayFrequency
- } if
- HalftoneType 5 eq
- {
- pop Default level2ScreenFreq
- } if
- end
-} bind def
-userdict /currentScreenFreq
- level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put
-level2? not
- {
- /setcmykcolor where not
- {
- /setcmykcolor
- {
- exch .11 mul add exch .59 mul add exch .3 mul add
- 1 exch sub setgray
- } def
- } if
- /currentcmykcolor where not
- {
- /currentcmykcolor
- {
- 0 0 0 1 currentgray sub
- } def
- } if
- /setoverprint where not
- {
- /setoverprint /pop load def
- } if
- /selectfont where not
- {
- /selectfont
- {
- exch findfont exch
- dup type /arraytype eq
- {
- makefont
- }
- {
- scalefont
- } ifelse
- setfont
- } bind def
- } if
- /cshow where not
- {
- /cshow
- {
- [
- 0 0 5 -1 roll aload pop
- ] cvx bind forall
- } bind def
- } if
- } if
- cleartomark
- /anyColor?
- {
- add add add 0 ne
- } bind def
- /testColor
- {
- gsave
- setcmykcolor currentcmykcolor
- grestore
- } bind def
- /testCMYKColorThrough
- {
- testColor anyColor?
- } bind def
- userdict /composite?
- level2?
- {
- gsave 1 1 1 1 setcmykcolor currentcmykcolor grestore
- add add add 4 eq
- }
- {
- 1 0 0 0 testCMYKColorThrough
- 0 1 0 0 testCMYKColorThrough
- 0 0 1 0 testCMYKColorThrough
- 0 0 0 1 testCMYKColorThrough
- and and and
- } ifelse
- put
- composite? not
- {
- userdict begin
- gsave
- /cyan? 1 0 0 0 testCMYKColorThrough def
- /magenta? 0 1 0 0 testCMYKColorThrough def
- /yellow? 0 0 1 0 testCMYKColorThrough def
- /black? 0 0 0 1 testCMYKColorThrough def
- grestore
- /isCMYKSep? cyan? magenta? yellow? black? or or or def
- /customColor? isCMYKSep? not def
- end
- } if
- end defaultpacking setpacking
-%%EndResource
-%%BeginResource: procset Adobe_typography_AI5 1.0 1
-%%Title: (Typography Operators)
-%%Version: 1.0
-%%CreationDate:(03/26/93) ()
-%%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_typography_AI5 54 dict dup begin
-put
-/initialize
-{
- begin
- begin
- Adobe_typography_AI5 begin
- Adobe_typography_AI5
- {
- dup xcheck
- {
- bind
- } if
- pop pop
- } forall
- end
- end
- end
- Adobe_typography_AI5 begin
-} def
-/terminate
-{
- currentdict Adobe_typography_AI5 eq
- {
- end
- } if
-} def
-/modifyEncoding
-{
- /_tempEncode exch ddef
- /_pntr 0 ddef
- {
- counttomark -1 roll
- dup type dup /marktype eq
- {
- pop pop exit
- }
- {
- /nametype eq
- {
- _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
- put
- }
- {
- /_pntr exch ddef
- } ifelse
- } ifelse
- } loop
- _tempEncode
-} def
-/TE
-{
- StandardEncoding 256 array copy modifyEncoding
- /_nativeEncoding exch def
-} def
-%
-/TZ
-{
- dup type /arraytype eq
- {
- /_wv exch def
- }
- {
- /_wv 0 def
- } ifelse
- /_useNativeEncoding exch def
- pop pop
- findfont _wv type /arraytype eq
- {
- _wv makeblendedfont
- } if
- dup length 2 add dict
- begin
- mark exch
- {
- 1 index /FID ne
- {
- def
- } if
- cleartomark mark
- } forall
- pop
- /FontName exch def
- counttomark 0 eq
- {
- 1 _useNativeEncoding eq
- {
- /Encoding _nativeEncoding def
- } if
- cleartomark
- }
- {
- /Encoding load 256 array copy
- modifyEncoding /Encoding exch def
- } ifelse
- FontName currentdict
- end
- definefont pop
-} def
-/tr
-{
- _ax _ay 3 2 roll
-} def
-/trj
-{
- _cx _cy _sp _ax _ay 6 5 roll
-} def
-/a0
-{
- /Tx
- {
- dup
- currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- } ddef
- /Tj
- {
- dup
- currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- } ddef
-} def
-/a1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- tr _psf
- newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- dup currentpoint 3 2 roll
- trj _pjsf
- newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/e0
-{
- /Tx
- {
- tr _psf
- } ddef
- /Tj
- {
- trj _pjsf
- } ddef
-} def
-/e1
-{
- /Tx
- {
- dup currentpoint 4 2 roll gsave
- tr _psf
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll gsave
- trj _pjsf
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/i0
-{
- /Tx
- {
- tr sp
- } ddef
- /Tj
- {
- trj jsp
- } ddef
-} def
-/i1
-{
- W N
-} def
-/o0
-{
- /Tx
- {
- tr sw rmoveto
- } ddef
- /Tj
- {
- trj swj rmoveto
- } ddef
-} def
-/r0
-{
- /Tx
- {
- tr _ctm _pss
- } ddef
- /Tj
- {
- trj _ctm _pjss
- } ddef
-} def
-/r1
-{
- /Tx
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- tr _ctm _pss
- grestore 3 1 roll moveto tr sp
- } ddef
- /Tj
- {
- dup currentpoint 4 2 roll currentpoint gsave newpath moveto
- trj _ctm _pjss
- grestore 3 1 roll moveto tr jsp
- } ddef
-} def
-/To
-{
- pop _ctm currentmatrix pop
-} def
-/TO
-{
- iTe _ctm setmatrix newpath
-} def
-/Tp
-{
- pop _tm astore pop _ctm setmatrix
- _tDict begin
- /W
- {
- } def
- /h
- {
- } def
-} def
-/TP
-{
- end
- iTm 0 0 moveto
-} def
-/Tr
-{
- _render 3 le
- {
- currentpoint newpath moveto
- } if
- dup 8 eq
- {
- pop 0
- }
- {
- dup 9 eq
- {
- pop 1
- } if
- } ifelse
- dup /_render exch ddef
- _renderStart exch get load exec
-} def
-/iTm
-{
- _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
-} def
-/Tm
-{
- _tm astore pop iTm 0 0 moveto
-} def
-/Td
-{
- _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
-} def
-/iTe
-{
- _render -1 eq
- {
- }
- {
- _renderEnd _render get dup null ne
- {
- load exec
- }
- {
- pop
- } ifelse
- } ifelse
- /_render -1 ddef
-} def
-/Ta
-{
- pop
-} def
-/Tf
-{
- dup 1000 div /_fScl exch ddef
-%
- selectfont
-} def
-/Tl
-{
- pop
- 0 exch _leading astore pop
-} def
-/Tt
-{
- pop
-} def
-/TW
-{
- 3 npop
-} def
-/Tw
-{
- /_cx exch ddef
-} def
-/TC
-{
- 3 npop
-} def
-/Tc
-{
- /_ax exch ddef
-} def
-/Ts
-{
- /_rise exch ddef
- currentpoint
- iTm
- moveto
-} def
-/Ti
-{
- 3 npop
-} def
-/Tz
-{
- 100 div /_hs exch ddef
- iTm
-} def
-/TA
-{
- pop
-} def
-/Tq
-{
- pop
-} def
-/Th
-{
- pop pop pop pop pop
-} def
-/TX
-{
- pop
-} def
-/Tk
-{
- exch pop _fScl mul neg 0 rmoveto
-} def
-/TK
-{
- 2 npop
-} def
-/T*
-{
- _leading aload pop neg Td
-} def
-/T*-
-{
- _leading aload pop Td
-} def
-/T-
-{
- _ax neg 0 rmoveto
- _hyphen Tx
-} def
-/T+
-{
-} def
-/TR
-{
- _ctm currentmatrix pop
- _tm astore pop
- iTm 0 0 moveto
-} def
-/TS
-{
- currentfont 3 1 roll
- /_Symbol_ _fScl 1000 mul selectfont
-
- 0 eq
- {
- Tx
- }
- {
- Tj
- } ifelse
- setfont
-} def
-/Xb
-{
- pop pop
-} def
-/Tb /Xb load def
-/Xe
-{
- pop pop pop pop
-} def
-/Te /Xe load def
-/XB
-{
-} def
-/TB /XB load def
-currentdict readonly pop
-end
-setpacking
-%%EndResource
-%%BeginProcSet: Adobe_ColorImage_AI6 1.0 0
-userdict /Adobe_ColorImage_AI6 known not
-{
- userdict /Adobe_ColorImage_AI6 17 dict put
-} if
-userdict /Adobe_ColorImage_AI6 get begin
-
- /initialize
- {
- Adobe_ColorImage_AI6 begin
- Adobe_ColorImage_AI6
- {
- dup type /arraytype eq
- {
- dup xcheck
- {
- bind
- } if
- } if
- pop pop
- } forall
- } def
- /terminate { end } def
-
- currentdict /Adobe_ColorImage_AI6_Vars known not
- {
- /Adobe_ColorImage_AI6_Vars 14 dict def
- } if
-
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 0 def
- /sourcecount 0 def
- /sourcearray 4 array def
- /plateindex -1 def
- /XIMask 0 def
- /XIBinary 0 def
- /XIChannelCount 0 def
- /XIBitsPerPixel 0 def
- /XIImageHeight 0 def
- /XIImageWidth 0 def
- /XIImageMatrix null def
- /XIBuffer null def
- /XIDataProc null def
- end
-
- /WalkRGBString null def
- /WalkCMYKString null def
-
- /StuffRGBIntoGrayString null def
- /RGBToGrayImageProc null def
- /StuffCMYKIntoGrayString null def
- /CMYKToGrayImageProc null def
- /ColorImageCompositeEmulator null def
-
- /SeparateCMYKImageProc null def
-
- /FourEqual null def
- /TestPlateIndex null def
-
- currentdict /_colorimage known not
- {
- /colorimage where
- {
- /colorimage get /_colorimage exch def
- }
- {
- /_colorimage null def
- } ifelse
- } if
-
- /_currenttransfer systemdict /currenttransfer get def
-
- /colorimage null def
- /XI null def
-
-
- /WalkRGBString
- {
- 0 3 index
-
- dup length 1 sub 0 3 3 -1 roll
- {
- 3 getinterval { } forall
-
- 5 index exec
-
- 3 index
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /WalkCMYKString
- {
- 0 3 index
-
- dup length 1 sub 0 4 3 -1 roll
- {
- 4 getinterval { } forall
-
- 6 index exec
-
- 3 index
-
- } for
-
- 5 { pop } repeat
-
- } def
-
-
- /StuffRGBIntoGrayString
- {
- .11 mul exch
-
- .59 mul add exch
-
- .3 mul add
-
- cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /RGBToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 3 idiv string
- dup 3 1 roll
-
- /StuffRGBIntoGrayString load exch
- WalkRGBString
- end
- } def
-
-
- /StuffCMYKIntoGrayString
- {
- exch .11 mul add
-
- exch .59 mul add
-
- exch .3 mul add
-
- dup 255 gt { pop 255 } if
-
- 255 exch sub cvi 3 copy put
-
- pop 1 add
- } def
-
-
- /CMYKToGrayImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 get exec
- dup length 4 idiv string
- dup 3 1 roll
-
- /StuffCMYKIntoGrayString load exch
- WalkCMYKString
- end
- } def
-
-
- /ColorImageCompositeEmulator
- {
- pop true eq
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get 5 add { pop } repeat
- }
- {
- Adobe_ColorImage_AI6_Vars /channelcount get 1 ne
- {
- Adobe_ColorImage_AI6_Vars begin
- sourcearray 0 3 -1 roll put
-
- channelcount 3 eq
- {
- /RGBToGrayImageProc
- }
- {
- /CMYKToGrayImageProc
- } ifelse
- load
- end
- } if
- image
- } ifelse
- } def
-
-
- /SeparateCMYKImageProc
- {
- Adobe_ColorImage_AI6_Vars begin
-
- sourcecount 0 ne
- {
- sourcearray plateindex get exec
- }
- {
- sourcearray 0 get exec
-
- dup length 4 idiv string
-
- 0 2 index
-
- plateindex 4 2 index length 1 sub
- {
- get 255 exch sub
-
- 3 copy put pop 1 add
-
- 2 index
- } for
-
- pop pop exch pop
- } ifelse
- end
- } def
-
-
- /FourEqual
- {
- 4 index ne
- {
- pop pop pop false
- }
- {
- 4 index ne
- {
- pop pop false
- }
- {
- 4 index ne
- {
- pop false
- }
- {
- 4 index eq
- } ifelse
- } ifelse
- } ifelse
- } def
-
-
- /TestPlateIndex
- {
- Adobe_ColorImage_AI6_Vars begin
- /plateindex -1 def
-
- /setcmykcolor where
- {
- pop
- gsave
- 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub
- 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub
- grestore
-
- 1 0 0 0 FourEqual
- {
- /plateindex 0 def
- }
- {
- 0 1 0 0 FourEqual
- {
- /plateindex 1 def
- }
- {
- 0 0 1 0 FourEqual
- {
- /plateindex 2 def
- }
- {
- 0 0 0 1 FourEqual
- {
- /plateindex 3 def
- }
- {
- 0 0 0 0 FourEqual
- {
- /plateindex 5 def
- } if
- } ifelse
- } ifelse
- } ifelse
- } ifelse
- pop pop pop pop
- } if
- plateindex
- end
- } def
-
-
- /colorimage
- {
- Adobe_ColorImage_AI6_Vars begin
- /channelcount 1 index def
- /sourcecount 2 index 1 eq { channelcount 1 sub } { 0 } ifelse def
-
- 4 sourcecount add index dup
- 8 eq exch 1 eq or not
- end
-
- {
- /_colorimage load null ne
- {
- _colorimage
- }
- {
- Adobe_ColorImage_AI6_Vars /sourcecount get
- 7 add { pop } repeat
- } ifelse
- }
- {
- dup 3 eq
- TestPlateIndex
- dup -1 eq exch 5 eq or or
- {
- /_colorimage load null eq
- {
- ColorImageCompositeEmulator
- }
- {
- dup 1 eq
- {
- pop pop image
- }
- {
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- gsave
-
- 0 _currenttransfer exec
- 1 _currenttransfer exec
- eq
- { 0 _currenttransfer exec 0.5 lt }
- { 0 _currenttransfer exec 1 _currenttransfer exec gt } ifelse
-
- { { pop 0 } } { { pop 1 } } ifelse
- systemdict /settransfer get exec
- } if
-
- _colorimage
-
- Adobe_ColorImage_AI6_Vars /plateindex get 5 eq
- {
- grestore
- } if
- } ifelse
- } ifelse
- }
- {
- dup 1 eq
- {
- pop pop
- image
- }
- {
- pop pop
-
- Adobe_ColorImage_AI6_Vars begin
- sourcecount -1 0
- {
- exch sourcearray 3 1 roll put
- } for
-
- /SeparateCMYKImageProc load
- end
-
- systemdict /image get exec
- } ifelse
- } ifelse
- } ifelse
- } def
-
- /XI
- {
- Adobe_ColorImage_AI6_Vars begin
- gsave
- /XIMask exch 0 ne def
- /XIBinary exch 0 ne def
- pop
- pop
- /XIChannelCount exch def
- /XIBitsPerPixel exch def
- /XIImageHeight exch def
- /XIImageWidth exch def
- pop pop pop pop
- /XIImageMatrix exch def
-
- XIBitsPerPixel 1 eq
- {
- XIImageWidth 8 div ceiling cvi
- }
- {
- XIImageWidth XIChannelCount mul
- } ifelse
- /XIBuffer exch string def
-
- XIBinary
- {
- /XIDataProc { currentfile XIBuffer readstring pop } def
- currentfile 128 string readline pop pop
- }
- {
- /XIDataProc { currentfile XIBuffer readhexstring pop } def
- } ifelse
-
- 0 0 moveto
- XIImageMatrix concat
- XIImageWidth XIImageHeight scale
-
- XIMask
- {
- XIImageWidth XIImageHeight
- false
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- /_lp /null ddef
- _fc
- /_lp /imagemask ddef
-
- imagemask
- }
- {
- XIImageWidth XIImageHeight
- XIBitsPerPixel
- [ XIImageWidth 0 0 XIImageHeight neg 0 0 ]
- /XIDataProc load
-
- XIChannelCount 1 eq
- {
-
- gsave
- 0 setgray
-
- image
-
- grestore
- }
- {
- false
- XIChannelCount
- colorimage
- } ifelse
- } ifelse
- grestore
- end
- } def
-
-end
-%%EndProcSet
-%%BeginResource: procset Adobe_Illustrator_AI5 1.1 0
-%%Title: (Adobe Illustrator (R) Version 5.0 Full Prolog)
-%%Version: 1.1
-%%CreationDate: (3/7/1994) ()
-%%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved)
-currentpacking true setpacking
-userdict /Adobe_Illustrator_AI5_vars 81 dict dup begin
-put
-/_eo false def
-/_lp /none def
-/_pf
-{
-} def
-/_ps
-{
-} def
-/_psf
-{
-} def
-/_pss
-{
-} def
-/_pjsf
-{
-} def
-/_pjss
-{
-} def
-/_pola 0 def
-/_doClip 0 def
-/cf currentflat def
-/_tm matrix def
-/_renderStart
-[
-/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0
-] def
-/_renderEnd
-[
-null null null null /i1 /i1 /i1 /i1
-] def
-/_render -1 def
-/_rise 0 def
-/_ax 0 def
-/_ay 0 def
-/_cx 0 def
-/_cy 0 def
-/_leading
-[
-0 0
-] def
-/_ctm matrix def
-/_mtx matrix def
-/_sp 16#020 def
-/_hyphen (-) def
-/_fScl 0 def
-/_cnt 0 def
-/_hs 1 def
-/_nativeEncoding 0 def
-/_useNativeEncoding 0 def
-/_tempEncode 0 def
-/_pntr 0 def
-/_tDict 2 dict def
-/_wv 0 def
-/Tx
-{
-} def
-/Tj
-{
-} def
-/CRender
-{
-} def
-/_AI3_savepage
-{
-} def
-/_gf null def
-/_cf 4 array def
-/_if null def
-/_of false def
-/_fc
-{
-} def
-/_gs null def
-/_cs 4 array def
-/_is null def
-/_os false def
-/_sc
-{
-} def
-/_pd 1 dict def
-/_ed 15 dict def
-/_pm matrix def
-/_fm null def
-/_fd null def
-/_fdd null def
-/_sm null def
-/_sd null def
-/_sdd null def
-/_i null def
-/discardSave null def
-/buffer 256 string def
-/beginString null def
-/endString null def
-/endStringLength null def
-/layerCnt 1 def
-/layerCount 1 def
-/perCent (%) 0 get def
-/perCentSeen? false def
-/newBuff null def
-/newBuffButFirst null def
-/newBuffLast null def
-/clipForward? false def
-end
-userdict /Adobe_Illustrator_AI5 known not {
- userdict /Adobe_Illustrator_AI5 91 dict put
-} if
-userdict /Adobe_Illustrator_AI5 get begin
-/initialize
-{
- Adobe_Illustrator_AI5 dup begin
- Adobe_Illustrator_AI5_vars begin
- discardDict
- {
- bind pop pop
- } forall
- dup /nc get begin
- {
- dup xcheck 1 index type /operatortype ne and
- {
- bind
- } if
- pop pop
- } forall
- end
- newpath
-} def
-/terminate
-{
- end
- end
-} def
-/_
-null def
-/ddef
-{
- Adobe_Illustrator_AI5_vars 3 1 roll put
-} def
-/xput
-{
- dup load dup length exch maxlength eq
- {
- dup dup load dup
- length 2 mul dict copy def
- } if
- load begin
- def
- end
-} def
-/npop
-{
- {
- pop
- } repeat
-} def
-/sw
-{
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
-} def
-/swj
-{
- dup 4 1 roll
- dup length exch stringwidth
- exch 5 -1 roll 3 index mul add
- 4 1 roll 3 1 roll mul add
- 6 2 roll /_cnt 0 ddef
- {
- 1 index eq
- {
- /_cnt _cnt 1 add ddef
- } if
- } forall
- pop
- exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop
-} def
-/ss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put pop
- gsave
- false charpath currentpoint
- 4 index setmatrix
- stroke
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 3 npop
-} def
-/jss
-{
- 4 1 roll
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- gsave
- _sp eq
- {
- exch 6 index 6 index 6 index 5 -1 roll widthshow
- currentpoint
- }
- {
- false charpath currentpoint
- 4 index setmatrix stroke
- } ifelse
- grestore
- moveto
- 2 copy rmoveto
- } exch cshow
- 6 npop
-} def
-/sp
-{
- {
- 2 npop (0) exch
- 2 copy 0 exch put pop
- false charpath
- 2 copy rmoveto
- } exch cshow
- 2 npop
-} def
-/jsp
-{
- {
- 2 npop
- (0) exch 2 copy 0 exch put
- _sp eq
- {
- exch 5 index 5 index 5 index 5 -1 roll widthshow
- }
- {
- false charpath
- } ifelse
- 2 copy rmoveto
- } exch cshow
- 5 npop
-} def
-/pl
-{
- transform
- 0.25 sub round 0.25 add exch
- 0.25 sub round 0.25 add exch
- itransform
-} def
-/setstrokeadjust where
-{
- pop true setstrokeadjust
- /c
- {
- curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll curveto
- } def
- /V
- /v load def
- /y
- {
- 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- lineto
- } def
- /L
- /l load def
- /m
- {
- moveto
- } def
-}
-{
- /c
- {
- pl curveto
- } def
- /C
- /c load def
- /v
- {
- currentpoint 6 2 roll pl curveto
- } def
- /V
- /v load def
- /y
- {
- pl 2 copy curveto
- } def
- /Y
- /y load def
- /l
- {
- pl lineto
- } def
- /L
- /l load def
- /m
- {
- pl moveto
- } def
-} ifelse
-/d
-{
- setdash
-} def
-/cf
-{
-} def
-/i
-{
- dup 0 eq
- {
- pop cf
- } if
- setflat
-} def
-/j
-{
- setlinejoin
-} def
-/J
-{
- setlinecap
-} def
-/M
-{
- setmiterlimit
-} def
-/w
-{
- setlinewidth
-} def
-/XR
-{
- 0 ne
- /_eo exch ddef
-} def
-/H
-{
-} def
-/h
-{
- closepath
-} def
-/N
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- _eo {eoclip} {clip} ifelse /_doClip 0 ddef
- } if
- newpath
- }
- {
- /CRender
- {
- N
- } ddef
- } ifelse
-} def
-/n
-{
- N
-} def
-/F
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc
- /_doClip 0 ddef
- }
- {
- _pf
- } ifelse
- }
- {
- /CRender
- {
- F
- } ddef
- } ifelse
-} def
-/f
-{
- closepath
- F
-} def
-/S
-{
- _pola 0 eq
- {
- _doClip 1 eq
- {
- gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- _ps
- } ifelse
- }
- {
- /CRender
- {
- S
- } ddef
- } ifelse
-} def
-/s
-{
- closepath
- S
-} def
-/B
-{
- _pola 0 eq
- {
- _doClip 1 eq
- gsave F grestore
- {
- gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc
- /_doClip 0 ddef
- }
- {
- S
- } ifelse
- }
- {
- /CRender
- {
- B
- } ddef
- } ifelse
-} def
-/b
-{
- closepath
- B
-} def
-/W
-{
- /_doClip 1 ddef
-} def
-/*
-{
- count 0 ne
- {
- dup type /stringtype eq
- {
- pop
- } if
- } if
- newpath
-} def
-/u
-{
-} def
-/U
-{
-} def
-/q
-{
- _pola 0 eq
- {
- gsave
- } if
-} def
-/Q
-{
- _pola 0 eq
- {
- grestore
- } if
-} def
-/*u
-{
- _pola 1 add /_pola exch ddef
-} def
-/*U
-{
- _pola 1 sub /_pola exch ddef
- _pola 0 eq
- {
- CRender
- } if
-} def
-/D
-{
- pop
-} def
-/*w
-{
-} def
-/*W
-{
-} def
-/`
-{
- /_i save ddef
- clipForward?
- {
- nulldevice
- } if
- 6 1 roll 4 npop
- concat pop
- userdict begin
- /showpage
- {
- } def
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {pop false setstrokeadjust} if
- newpath
- 0 setgray
- false setoverprint
-} def
-/~
-{
- end
- _i restore
-} def
-/O
-{
- 0 ne
- /_of exch ddef
- /_lp /none ddef
-} def
-/R
-{
- 0 ne
- /_os exch ddef
- /_lp /none ddef
-} def
-/g
-{
- /_gf exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _gf setgray
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/G
-{
- /_gs exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _gs setgray
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/k
-{
- _cf astore pop
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _cf aload pop setcmykcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/K
-{
- _cs astore pop
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _cs aload pop setcmykcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/x
-{
- /_gf exch ddef
- findcmykcustomcolor
- /_if exch ddef
- /_fc
- {
- _lp /fill ne
- {
- _of setoverprint
- _if _gf 1 exch sub setcustomcolor
- /_lp /fill ddef
- } if
- } ddef
- /_pf
- {
- _fc
- _eo {eofill} {fill} ifelse
- } ddef
- /_psf
- {
- _fc
- ashow
- } ddef
- /_pjsf
- {
- _fc
- awidthshow
- } ddef
- /_lp /none ddef
-} def
-/X
-{
- /_gs exch ddef
- findcmykcustomcolor
- /_is exch ddef
- /_sc
- {
- _lp /stroke ne
- {
- _os setoverprint
- _is _gs 1 exch sub setcustomcolor
- /_lp /stroke ddef
- } if
- } ddef
- /_ps
- {
- _sc
- stroke
- } ddef
- /_pss
- {
- _sc
- ss
- } ddef
- /_pjss
- {
- _sc
- jss
- } ddef
- /_lp /none ddef
-} def
-/A
-{
- pop
-} def
-/annotatepage
-{
-userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse
-} def
-/XT {
- pop pop
-} def
-/discard
-{
- save /discardSave exch store
- discardDict begin
- /endString exch store
- gt38?
- {
- 2 add
- } if
- load
- stopped
- pop
- end
- discardSave restore
-} bind def
-userdict /discardDict 7 dict dup begin
-put
-/pre38Initialize
-{
- /endStringLength endString length store
- /newBuff buffer 0 endStringLength getinterval store
- /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store
- /newBuffLast newBuff endStringLength 1 sub 1 getinterval store
-} def
-/shiftBuffer
-{
- newBuff 0 newBuffButFirst putinterval
- newBuffLast 0
- currentfile read not
- {
- stop
- } if
- put
-} def
-0
-{
- pre38Initialize
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff endString eq
- {
- cleartomark stop
- } if
- shiftBuffer
- } loop
- }
- {
- stop
- } ifelse
-} def
-1
-{
- pre38Initialize
- /beginString exch store
- mark
- currentfile newBuff readstring exch pop
- {
- {
- newBuff beginString eq
- {
- /layerCount dup load 1 add store
- }
- {
- newBuff endString eq
- {
- /layerCount dup load 1 sub store
- layerCount 0 eq
- {
- cleartomark stop
- } if
- } if
- } ifelse
- shiftBuffer
- } loop
- } if
-} def
-2
-{
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- endString eq
- {
- cleartomark stop
- } if
- } loop
-} def
-3
-{
- /beginString exch store
- /layerCnt 1 store
- mark
- {
- currentfile buffer readline not
- {
- stop
- } if
- dup beginString eq
- {
- pop /layerCnt dup load 1 add store
- }
- {
- endString eq
- {
- layerCnt 1 eq
- {
- cleartomark stop
- }
- {
- /layerCnt dup load 1 sub store
- } ifelse
- } if
- } ifelse
- } loop
-} def
-end
-userdict /clipRenderOff 15 dict dup begin
-put
-{
- /n /N /s /S /f /F /b /B
-}
-{
- {
- _doClip 1 eq
- {
- /_doClip 0 ddef _eo {eoclip} {clip} ifelse
- } if
- newpath
- } def
-} forall
-/Tr /pop load def
-/Bb {} def
-/BB /pop load def
-/Bg {12 npop} def
-/Bm {6 npop} def
-/Bc /Bm load def
-/Bh {4 npop} def
-end
-/Lb
-{
- 4 npop
- 6 1 roll
- pop
- 4 1 roll
- pop pop pop
- 0 eq
- {
- 0 eq
- {
- (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard
- }
- {
-
- /clipForward? true def
-
- /Tx /pop load def
- /Tj /pop load def
-
- currentdict end clipRenderOff begin begin
- } ifelse
- }
- {
- 0 eq
- {
- save /discardSave exch store
- } if
- } ifelse
-} bind def
-/LB
-{
- discardSave dup null ne
- {
- restore
- }
- {
- pop
- clipForward?
- {
- currentdict
- end
- end
- begin
-
- /clipForward? false ddef
- } if
- } ifelse
-} bind def
-/Pb
-{
- pop pop
- 0 (%AI5_EndPalette) discard
-} bind def
-/Np
-{
- 0 (%AI5_End_NonPrinting--) discard
-} bind def
-/Ln /pop load def
-/Ap
-/pop load def
-/Ar
-{
- 72 exch div
- 0 dtransform dup mul exch dup mul add sqrt
- dup 1 lt
- {
- pop 1
- } if
- setflat
-} def
-/Mb
-{
- q
-} def
-/Md
-{
-} def
-/MB
-{
- Q
-} def
-/nc 3 dict def
-nc begin
-/setgray
-{
- pop
-} bind def
-/setcmykcolor
-{
- 4 npop
-} bind def
-/setcustomcolor
-{
- 2 npop
-} bind def
-currentdict readonly pop
-end
-end
-setpacking
-%%EndResource
-%%EndProlog
-%%BeginSetup
-%%IncludeFont: Univers
-Adobe_level2_AI5 /initialize get exec
-Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec
-Adobe_ColorImage_AI6 /initialize get exec
-Adobe_Illustrator_AI5 /initialize get exec
-[
-39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
-/Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
-/egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
-/oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
-/udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
-/registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
-/.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
-/.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
-/questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
-/guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
-/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
-/.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
-/fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
-/Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
-/Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
-/Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
-/hungarumlaut/ogonek/caron
-TE
-%AI3_BeginEncoding: _Univers Univers
-[/_Univers/Univers 0 0 1 TZ
-%AI3_EndEncoding AdobeType
-%AI5_Begin_NonPrinting
-Np
-8 Bn
-%AI5_BeginGradient: (Black & White)
-(Black & White) 0 2 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Green & Blue)
-(Green & Blue) 0 2 Bd
-[
-<
-99999A9A9B9B9B9C9C9D9D9D9E9E9F9F9FA0A0A1A1A1A2A2A3A3A3A4A4A5A5A5A6A6A7A7A7A8A8A9
-A9A9AAAAABABABACACADADADAEAEAFAFAFB0B0B1B1B1B2B2B3B3B3B4B4B5B5B5B6B6B7B7B7B8B8B9
-B9B9BABABBBBBBBCBCBDBDBDBEBEBFBFBFC0C0C1C1C1C2C2C3C3C3C4C4C5C5C5C6C6C7C7C7C8C8C9
-C9C9CACACBCBCBCCCCCDCDCDCECECFCFCFD0D0D1D1D1D2D2D3D3D3D4D4D5D5D5D6D6D7D7D7D8D8D9
-D9D9DADADBDBDBDCDCDDDDDDDEDEDFDFDFE0E0E1E1E1E2E2E3E3E3E4E4E5E5E5E6E6E7E7E7E8E8E9
-E9E9EAEAEBEBEBECECEDEDEDEEEEEFEFEFF0F0F1F1F1F2F2F3F3F3F4F4F5F5F5F6F6F7F7F7F8F8F9
-F9F9FAFAFBFBFBFCFCFDFDFDFEFEFFFF
->
-<
-000102020304050506070808090A0B0B0C0D0E0E0F101111121314141516171718191A1A1B1C1D1D
-1E1F20202122232324252626272829292A2B2C2C2D2E2F2F303132323334353536373838393A3B3B
-3C3D3E3E3F404141424344444546474748494A4A4B4C4D4D4E4F5050515253535455565657585959
-5A5B5C5C5D5E5F5F606162626364656566676868696A6B6B6C6D6E6E6F7071717273747475767777
-78797A7A7B7C7D7D7E7F80808182828384858586878888898A8B8B8C8D8E8E8F9091919293949495
-96979798999A9A9B9C9D9D9E9FA0A0A1A2A3A3A4A5A6A6A7A8A9A9AAABACACADAEAFAFB0B1B2B2B3
-B4B5B5B6B7B8B8B9BABBBBBCBDBEBEBF
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-[
-1 0.75 0 0 1 50 100 %_Bs
-0.6 0 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Pink, Yellow, Green)
-(Pink, Yellow, Green) 0 3 Bd
-[
-<
-00000000000000000000000000000000000000010101010101010101010101010101010101010101
-01010101010202020202020202020202020202020202020202020203030303030303030303030303
-03030303030303030404040404040404040404040404040404040404050505050505050505050505
-05050505050505060606060606060606060606060606060606060707070707070707070707070707
-07070707080808080808080808080808080808080809090909090909090909090909090909090A0A
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0C
-0C0C0C0C0C0C0C0D0D0D0D0D
->
-<
-050506060606070708080809090A0A0A0B0B0C0C0D0D0E0E0F0F1010111112121313141415151617
-17181819191A1A1B1C1C1D1D1E1F1F202021222223232425252626272828292A2A2B2C2C2D2D2E2F
-2F3031313233333435353637373839393A3B3B3C3D3E3E3F4040414242434445454647474849494A
-4B4C4C4D4E4F4F505151525354545556575758595A5A5B5C5C5D5E5F5F6061626363646566666768
-69696A6B6C6C6D6E6F707071727373747576777778797A7B7B7C7D7E7F7F80818283838485868787
-88898A8B8B8C8D8E8F8F9091929394949596979898999A9B9C9D9D9E9FA0A1A2A2A3A4A5A6A7A7A8
-A9AAABACADADAEAFB0B1B2B2
->
-<
-CCCCCBCBCBCACACAC9C9C8C8C7C7C6C6C5C5C4C4C3C2C2C1C1C0C0BFBEBEBDBDBCBBBBBAB9B9B8B7
-B7B6B6B5B4B4B3B2B1B1B0AFAFAEADADACABAAAAA9A8A8A7A6A5A5A4A3A2A2A1A0A09F9E9D9C9C9B
-9A999998979696959493929291908F8E8E8D8C8B8A8A8988878686858483828181807F7E7D7C7C7B
-7A7978777776757473727171706F6E6D6C6B6A6A69686766656463636261605F5E5D5C5B5B5A5958
-5756555453525151504F4E4D4C4B4A49484746464544434241403F3E3D3C3B3A3938383736353433
-3231302F2E2D2C2B2A29282726252423222221201F1E1D1C1B1A191817161514131211100F0E0D0C
-0B0A09080706050403020100
->
-0
-1 %_Br
-<
-737271706F6E6D6C6B6A696867666564636261605F5E5D5C5B5B5A59585756555453525150504F4E
-4D4C4B4A4949484746454443434241403F3E3E3D3C3B3A3A393837363635343333323130302F2E2D
-2D2C2B2A2A29282827262525242323222121201F1F1E1D1D1C1C1B1A1A1918181717161615141413
-1312121111100F0F0E0E0D0D0C0C0C0B0B0A0A090908080807070606060505050404040303030202
-020201010101010000000000
->
-<
-00000000000000000000000001010101010101010101010101010101010101010101010102020202
-02020202020202020202020202020202020202020202030303030303030303030303030303030303
-03030303030303030303030303040404040404040404040404040404040404040404040404040404
-04040404040404040404050505050505050505050505050505050505050505050505050505050505
-050505050505050505050505
->
-<
-BFBFBFC0C0C0C0C0C0C0C0C0C1C1C1C1C1C1C1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C3C3
-C3C4C4C4C4C4C4C4C4C4C4C5C5C5C5C5C5C5C5C5C5C5C6C6C6C6C6C6C6C6C6C6C6C6C7C7C7C7C7C7
-C7C7C7C7C7C7C8C8C8C8C8C8C8C8C8C8C8C8C8C9C9C9C9C9C9C9C9C9C9C9C9C9C9C9CACACACACACA
-CACACACACACACACACACACBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCCCCCCCCCCCCCCCC
-CCCCCCCCCCCCCCCCCCCCCCCC
->
-0
-1 %_Br
-[
-0.05 0.7 0 0 1 50 100 %_Bs
-0 0.02 0.8 0 1 57 36 %_Bs
-0.45 0 0.75 0 1 37 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Purple, Red & Yellow)
-(Purple, Red & Yellow) 0 3 Bd
-[
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A
->
-<
-CCCCCCCDCDCDCDCDCECECECECECFCFCFCFD0D0D0D0D0D1D1D1D1D1D2D2D2D2D2D3D3D3D3D3D4D4D4
-D4D5D5D5D5D5D6D6D6D6D6D7D7D7D7D7D8D8D8D8D8D9D9D9D9DADADADADADBDBDBDBDBDCDCDCDCDC
-DDDDDDDDDDDEDEDEDEDFDFDFDFDFE0E0E0E0E0E1E1E1E1E1E2E2E2E2E2E3E3E3E3E4E4E4E4E4E5E5
-E5E5E5E6E6E6E6E6E7E7E7E7E7E8E8E8E8E9E9E9E9E9EAEAEAEAEAEBEBEBEBEBECECECECECEDEDED
-EDEEEEEEEEEEEFEFEFEFEFF0F0F0F0F0F1F1F1F1F1F2F2F2F2F3F3F3F3F3F4F4F4F4F4F5F5F5F5F5
-F6F6F6F6F6F7F7F7F7F8F8F8F8F8F9F9F9F9F9FAFAFAFAFAFBFBFBFBFBFCFCFCFCFDFDFDFDFDFEFE
-FEFEFEFFFFFF
->
-0
-1 %_Br
-<
-E5E4E3E2E1E0DFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBE
-BDBCBBBAB9B8B7B6B5B4B3B2B1B0AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A99989796
-9594939291908F8E8D8C8B8A898887868584838281807F7E7D7C7B7A797877767574737271706F6E
-6D6C6B6A696867666564636261605F5E5D5C5B5A595857565554535251504F4E4D4C4B4A49484746
-4544434241403F3E3D3C3B3A393837363534333231302F2E2D2C2B2A292827262524232221201F1E
-1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
->
-<
-E5E6E6E6E6E6E6E6E6E7E7E7E7E7E7E7E7E7E8E8E8E8E8E8E8E8E8E9E9E9E9E9E9E9E9E9EAEAEAEA
-EAEAEAEAEAEBEBEBEBEBEBEBEBEBECECECECECECECECECEDEDEDEDEDEDEDEDEDEEEEEEEEEEEEEEEE
-EEEFEFEFEFEFEFEFEFEFF0F0F0F0F0F0F0F0F0F1F1F1F1F1F1F1F1F1F2F2F2F2F2F2F2F2F2F3F3F3
-F3F3F3F3F3F3F4F4F4F4F4F4F4F4F4F5F5F5F5F5F5F5F5F5F6F6F6F6F6F6F6F6F6F7F7F7F7F7F7F7
-F7F7F8F8F8F8F8F8F8F8F8F9F9F9F9F9F9F9F9F9FAFAFAFAFAFAFAFAFAFBFBFBFBFBFBFBFBFBFCFC
-FCFCFCFCFCFCFCFDFDFDFDFDFDFDFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFF
->
-<
-00010203040405060708090A0B0C0C0D0E0F10111213141415161718191A1B1C1D1D1E1F20212223
-242525262728292A2B2C2D2D2E2F30313233343535363738393A3B3C3D3D3E3F4041424344454546
-4748494A4B4C4D4E4E4F50515253545556565758595A5B5C5D5E5E5F60616263646566666768696A
-6B6C6D6E6E6F70717273747576767778797A7B7C7D7E7F7F80818283848586878788898A8B8C8D8E
-8F8F90919293949596979798999A9B9C9D9E9F9FA0A1A2A3A4A5A6A7A7A8A9AAABACADAEAFAFB0B1
-B2B3B4B5B6B7B8B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C8C9CACBCC
->
-0
-1 %_Br
-[
-0 0.04 1 0 1 50 100 %_Bs
-0 1 0.8 0 1 50 50 %_Bs
-0.9 0.9 0 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Rainbow)
-(Rainbow) 0 6 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-0
-1 %_Br
-1
-<
-0708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E
-2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556
-5758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E
-7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6
-A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCE
-CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6
-F7F8F9FAFBFCFDFEFF
->
-0
-0
-1 %_Br
-1
-<
-00000000000000000000000000000000000001010101010101010101010101010101010101010101
-01010101010101010101010101010202020202020202020202020202020202020202020202020202
-02020202020202020202030303030303030303030303030303030303030303030303030303030303
-03030303030304040404040404040404040404040404040404040404040404040404040404040404
-04040505050505050505050505050505050505050505050505050505050505050505050505050606
-06060606060606060606060606060606060606060606060606060606060606060606070707070707
-07070707070707070707070707070707
->
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0
-1 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0
-1
-0
-1 %_Br
-0
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-1
-0
-1 %_Br
-[
-0 1 0 0 1 50 100 %_Bs
-1 1 0 0 1 50 80 %_Bs
-1 0.0279 0 0 1 50 60 %_Bs
-1 0 1 0 1 50 40 %_Bs
-0 0 1 0 1 50 20 %_Bs
-0 1 1 0 1 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Steel Bar)
-(Steel Bar) 0 3 Bd
-[
-<
-FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0EFEEEDECEBEAE9E8E7E6E5E4E3E2E1E0DFDEDDDCDBDAD9D8
-D7D6D5D4D3D2D1D0CFCECDCCCBCAC9C8C7C6C5C4C3C2C1C0BFBEBDBCBBBAB9B8B7B6B5B4B3B2B1B0
-AFAEADACABAAA9A8A7A6A5A4A3A2A1A09F9E9D9C9B9A999897969594939291908F8E8D8C8B8A8988
-87868584838281807F7E7D7C7B7A797877767574737271706F6E6D6C6B6A69686766656463626160
-5F5E5D5C5B5A595857565554535251504F4E4D4C4B4A494847464544434241403F3E3D3C3B3A3938
-37363534333231302F2E2D2C2B2A292827262524232221201F1E1D1C1B1A19181716151413121110
-0F0E0D0C0B0A09080706050403020100
->
-0 %_Br
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-0 %_Br
-[
-0 0 50 100 %_Bs
-1 0 50 70 %_Bs
-0 0 50 0 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Orange Radial)
-(Yellow & Orange Radial) 1 2 Bd
-[
-0
-<
-0001010203040506060708090A0B0C0C0D0E0F10111213131415161718191A1B1C1D1D1E1F202122
-232425262728292A2B2B2C2D2E2F303132333435363738393A3B3C3D3E3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60606162636465666768696A6B6C6D6E6F
-707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C
->
-<
-FFFFFFFFFEFEFEFEFEFEFEFDFDFDFDFDFDFCFCFCFCFCFCFBFBFBFBFBFBFAFAFAFAFAFAF9F9F9F9F9
-F9F8F8F8F8F8F8F7F7F7F7F7F7F6F6F6F6F6F6F5F5F5F5F5F5F4F4F4F4F4F3F3F3F3F3F3F2F2F2F2
-F2F2F1F1F1F1F1F0F0F0F0F0F0EFEFEFEFEFEFEEEEEEEEEEEDEDEDEDEDEDECECECECECEBEBEBEBEB
-EBEAEAEAEAEAE9E9E9E9E9E9E8E8E8E8E8E8E7E7E7E7E7E6E6E6E6E6E5
->
-0
-1 %_Br
-[
-0 0 1 0 1 52 19 %_Bs
-0 0.55 0.9 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_BeginGradient: (Yellow & Purple Radial)
-(Yellow & Purple Radial) 1 2 Bd
-[
-<
-000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
-28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F
-505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677
-78797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
-A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
-C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
-F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
->
-<
-1415161718191A1B1C1D1E1F1F202122232425262728292A2A2B2C2D2E2F30313233343536363738
-393A3B3C3D3E3F40414142434445464748494A4B4C4D4D4E4F50515253545556575858595A5B5C5D
-5E5F60616263646465666768696A6B6C6D6E6F6F707172737475767778797A7B7B7C7D7E7F808182
-83848586868788898A8B8C8D8E8F90919292939495969798999A9B9C9D9D9E9FA0A1A2A3A4A5A6A7
-A8A9A9AAABACADAEAFB0B1B2B3B4B4B5B6B7B8B9BABBBCBDBEBFC0C0C1C2C3C4C5C6C7C8C9CACBCB
-CCCDCECFD0D1D2D3D4D5D6D7D7D8D9DADBDCDDDEDFE0E1E2E2E3E4E5E6E7E8E9EAEBECEDEEEEEFF0
-F1F2F3F4F5F6F7F8F9F9FAFBFCFDFEFF
->
-<
-ABAAAAA9A8A7A7A6A5A5A4A3A3A2A1A1A09F9F9E9D9D9C9B9B9A9999989797969595949393929191
-908F8F8E8D8D8C8B8B8A8989888787868585848383828181807F7F7E7D7D7C7B7B7A797978777776
-7575747373727171706F6F6E6D6D6C6B6B6A6969686767666565646362626160605F5E5E5D5C5C5B
-5A5A5958585756565554545352525150504F4E4E4D4C4C4B4A4A4948484746464544444342424140
-403F3E3E3D3C3C3B3A3A3938383736363534343332323130302F2E2E2D2C2C2B2A2A292828272626
-25242423222121201F1F1E1D1D1C1B1B1A1919181717161515141313121111100F0F0E0D0D0C0B0B
-0A090908070706050504030302010100
->
-0
-1 %_Br
-[
-0 0.08 0.67 0 1 50 14 %_Bs
-1 1 0 0 1 50 100 %_Bs
-BD
-%AI5_EndGradient
-%AI5_End_NonPrinting--
-%AI5_BeginPalette
-0 2 Pb
-Pn
-Pc
-1 g
-Pc
-0 g
-Pc
-0 0 0 0 k
-Pc
-0.75 g
-Pc
-0.5 g
-Pc
-0.25 g
-Pc
-0 g
-Pc
-Bb
-2 (Black & White) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0 0 0 k
-Pc
-0.5 0 0 0 k
-Pc
-0.75 0 0 0 k
-Pc
-1 0 0 0 k
-Pc
-0.25 0.25 0 0 k
-Pc
-0.5 0.5 0 0 k
-Pc
-0.75 0.75 0 0 k
-Pc
-1 1 0 0 k
-Pc
-Bb
-2 (Pink, Yellow, Green) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0 0 k
-Pc
-0 0.5 0 0 k
-Pc
-0 0.75 0 0 k
-Pc
-0 1 0 0 k
-Pc
-0 0.25 0.25 0 k
-Pc
-0 0.5 0.5 0 k
-Pc
-0 0.75 0.75 0 k
-Pc
-0 1 1 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Purple Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0 0.25 0 k
-Pc
-0 0 0.5 0 k
-Pc
-0 0 0.75 0 k
-Pc
-0 0 1 0 k
-Pc
-0.25 0 0.25 0 k
-Pc
-0.5 0 0.5 0 k
-Pc
-0.75 0 0.75 0 k
-Pc
-1 0 1 0 k
-Pc
-Bb
-2 (Rainbow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0 0 k
-Pc
-0.5 0.25 0 0 k
-Pc
-0.75 0.375 0 0 k
-Pc
-1 0.5 0 0 k
-Pc
-0.125 0.25 0 0 k
-Pc
-0.25 0.5 0 0 k
-Pc
-0.375 0.75 0 0 k
-Pc
-0.5 1 0 0 k
-Pc
-Bb
-2 (Steel Bar) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0 0.25 0.125 0 k
-Pc
-0 0.5 0.25 0 k
-Pc
-0 0.75 0.375 0 k
-Pc
-0 1 0.5 0 k
-Pc
-0 0.125 0.25 0 k
-Pc
-0 0.25 0.5 0 k
-Pc
-0 0.375 0.75 0 k
-Pc
-0 0.5 1 0 k
-Pc
-Bb
-2 (Purple, Red & Yellow) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0 0.25 0 k
-Pc
-0.25 0 0.5 0 k
-Pc
-0.375 0 0.75 0 k
-Pc
-0.5 0 1 0 k
-Pc
-0.25 0 0.125 0 k
-Pc
-0.5 0 0.25 0 k
-Pc
-0.75 0 0.375 0 k
-Pc
-1 0 0.5 0 k
-Pc
-Bb
-2 (Green & Blue) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.25 0.125 0.125 0 k
-Pc
-0.5 0.25 0.25 0 k
-Pc
-0.75 0.375 0.375 0 k
-Pc
-1 0.5 0.5 0 k
-Pc
-0.25 0.25 0.125 0 k
-Pc
-0.5 0.5 0.25 0 k
-Pc
-0.75 0.75 0.375 0 k
-Pc
-1 1 0.5 0 k
-Pc
-Bb
-0 0 0 0 Bh
-2 (Yellow & Orange Radial) -4014 4716 0 0 1 0 0 1 0 0 Bg
-0 BB
-Pc
-0.125 0.25 0.125 0 k
-Pc
-0.25 0.5 0.25 0 k
-Pc
-0.375 0.75 0.375 0 k
-Pc
-0.5 1 0.5 0 k
-Pc
-0.125 0.25 0.25 0 k
-Pc
-0.25 0.5 0.5 0 k
-Pc
-0.375 0.75 0.75 0 k
-Pc
-0.5 1 1 0 k
-Pc
-0 0 0 0 k
-Pc
-0.125 0.125 0.25 0 k
-Pc
-0.25 0.25 0.5 0 k
-Pc
-0.375 0.375 0.75 0 k
-Pc
-0.5 0.5 1 0 k
-Pc
-0.25 0.125 0.25 0 k
-Pc
-0.5 0.25 0.5 0 k
-Pc
-0.75 0.375 0.75 0 k
-Pc
-1 0.5 1 0 k
-Pc
-PB
-%AI5_EndPalette
-%%EndSetup
-%AI5_BeginLayer
-1 1 1 1 0 0 0 79 128 255 Lb
-(Layer 1) Ln
-0 A
-800 Ar
-0 J 0 j 1 w 4 M []0 d
-%AI3_Note:
-0 D
-0 XR
--4014 283.5 m
-4626 283.5 L
-(N) *
-453.5 4716 m
-453.5 -3924 L
-(N) *
-85 4716 m
-85 -3924 L
-(N) *
--4014 765.5 m
-4626 765.5 L
-(N) *
-u
-0 R
-0.25 G
-2 w
-152.7439 649.8296 m
-164.3439 653.4296 158.3439 667.0297 v
-153.0847 678.9503 141.5439 672.6297 y
-141.9635 683.3994 130.3438 683.8297 v
-119.5438 684.2297 118.7438 672.6297 y
-113.429 685.1021 100.7437 677.0297 v
-91.9437 671.4297 96.3437 661.0297 y
-85.9436 655.0296 93.1437 643.0296 v
-98.1213 634.7336 107.5437 638.6296 y
-105.5437 626.6295 118.7438 627.0295 v
-131.9438 627.4295 130.3438 638.6296 y
-138.0225 629.4983 148.3439 636.2296 v
-157.5439 642.2296 152.7439 649.8296 y
-s
-0 To
-1 0 0 1 125.3333 652 0 Tp
-TP
--19.9951 0 Td
-0 Tr
-0 O
-0 g
-1 w
-/_Univers 10 Tf
-0 Ts
-100 Tz
-0 Tt
-1 TA
-%_ 0 XL
-36 0 Xb
-XB
-0 0 5 TC
-100 100 200 TW
-0 0 0 Ti
-1 Ta
-0 0 2 2 3 Th
-0 Tq
-0 0 Tl
-0 Tc
-0 Tw
-(Network) Tx
-(\r) TX
-TO
-U
-1 Ap
-0 R
-0 G
-245 630.7402 m
-256.7413 630.7402 266.2598 640.2587 266.2598 652 c
-266.2598 663.7413 256.7413 673.2598 245 673.2598 c
-233.2587 673.2598 223.7402 663.7413 223.7402 652 c
-223.7402 640.2587 233.2587 630.7402 245 630.7402 c
-s
-u
-409.6667 630.7402 m
-429.2355 630.7402 445.0998 640.2587 445.0998 652 c
-445.0998 663.7414 429.2355 673.2599 409.6667 673.2599 c
-390.0978 673.2599 374.2335 663.7414 374.2335 652 c
-374.2335 640.2587 390.0978 630.7402 409.6667 630.7402 c
-s
-0 To
-1 0 0 1 409.6667 654.5662 0 Tp
-TP
--16.3867 0 Td
-0 Tr
-0 O
-0 g
-(Master\r) Tx
-2.2253 -12 Td
-(Agent) Tx
-(\r) TX
-TO
-U
-0 To
-1 0 0 1 415 698 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-u
-0 R
-0 G
-341.6667 540.0735 m
-361.2355 540.0735 377.0998 549.592 377.0998 561.3333 c
-377.0998 573.0747 361.2355 582.5932 341.6667 582.5932 c
-322.0978 582.5932 306.2335 573.0747 306.2335 561.3333 c
-306.2335 549.592 322.0978 540.0735 341.6667 540.0735 c
-s
-0 To
-1 0 0 1 341.6667 563.8995 0 Tp
-TP
--29.1626 0 Td
-0 Tr
-0 O
-0 g
-(Proxy Agent\r) Tx
-2.7771 -12 Td
-(Subsystem) Tx
-(\r) TX
-TO
-U
-u
-u
-0 Ap
-0 R
-0 G
-274.4641 652 m
-366 652 l
-S
-0 O
-0 g
-368.362 653.0249 m
-366.7087 653.5241 365.6341 653.9841 364.3076 654.5165 c
-364.3076 649.4722 l
-364.7824 649.6974 366.7087 650.4647 368.362 650.9636 c
-370.1314 651.4983 371.7359 651.8639 372.7766 651.9944 c
-371.7359 652.1249 370.1314 652.4904 368.362 653.0249 c
-f
-U
-272.1021 650.9751 m
-273.7554 650.4759 274.83 650.0159 276.1565 649.4835 c
-276.1565 654.5278 l
-275.6817 654.3026 273.7554 653.5353 272.1021 653.0364 c
-270.3327 652.5017 268.7282 652.1361 267.6875 652.0056 c
-268.7282 651.8751 270.3327 651.5096 272.1021 650.9751 c
-f
-U
-u
-0 R
-0 G
-265.2292 630.5208 m
-314.2292 584.5208 l
-S
-0 O
-0 g
-316.6527 583.6514 m
-315.789 585.147 315.3204 586.2179 314.7176 587.5139 c
-311.2651 583.8362 l
-311.7654 583.6754 313.695 582.9164 315.2419 582.1486 c
-316.8979 581.3274 318.3179 580.4958 319.166 579.8786 c
-318.4966 580.6861 317.5769 582.0507 316.6527 583.6514 c
-f
-262.8056 631.3902 m
-263.6693 629.8947 264.1379 628.8238 264.7407 627.5278 c
-268.1932 631.2055 l
-267.6929 631.3663 265.7633 632.1252 264.2164 632.8931 c
-262.5604 633.7143 261.1404 634.5459 260.2923 635.163 c
-260.9617 634.3556 261.8814 632.9909 262.8056 631.3902 c
-f
-U
-0 To
-1 0 0 1 245 648.5662 0 Tp
-TP
--12.7747 0 Td
-0 Tr
-(Net if) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 319.6667 656.6667 0 Tp
-TP
--31.1438 0 Td
-0 Tr
-(Erlang T) Tx 1 104 Tk
-(erms) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 294.3333 606.3333 0 Tp
-TP
--73.335 0 Td
-0 Tr
-2 Ta
-(Proxy agent\312\312\312\312\312\312\r) Tx
--33.8769 -12 Td
-(specific representation) Tx
-(\r) TX
-TO
-0 To
-1 0 0 1 263.6667 601.3333 0 Tp
-TP
-0 Tr
-(\r) Tx
-TO
-u
-0 R
-0 G
-168 652 m
-215.3333 652 l
-B
-217.6953 653.0249 m
-216.042 653.5241 214.9674 653.9841 213.6409 654.5165 c
-213.6409 649.4722 l
-214.1157 649.6974 216.042 650.4647 217.6953 650.9636 c
-219.4647 651.4983 221.0692 651.8639 222.1099 651.9944 c
-221.0692 652.1249 219.4647 652.4904 217.6953 653.0249 c
-f
-165.638 650.9751 m
-167.2913 650.4759 168.3659 650.0159 169.6924 649.4835 c
-169.6924 654.5278 l
-169.2176 654.3026 167.2913 653.5353 165.638 653.0364 c
-163.8686 652.5017 162.2641 652.1361 161.2234 652.0056 c
-162.2641 651.8751 163.8686 651.5096 165.638 650.9751 c
-f
-U
-0 To
-1 0 0 1 190.75 656.25 0 Tp
-TP
--13.0579 0 Td
-0 Tr
-1 Ta
-(Bytes) Tx
-(\r) TX
-TO
-LB
-%AI5_EndLayer--
-%%PageTrailer
-gsave annotatepage grestore showpage
-%%Trailer
-Adobe_Illustrator_AI5 /terminate get exec
-Adobe_ColorImage_AI6 /terminate get exec
-Adobe_typography_AI5 /terminate get exec
-Adobe_level2_AI5 /terminate get exec
-%%EOF
diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml
index 62dfa515d1..d5ac97ef15 100644
--- a/lib/snmp/doc/src/snmp_app.xml
+++ b/lib/snmp/doc/src/snmp_app.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE appref SYSTEM "appref.dtd">
<appref>
<header>
<copyright>
- <year>1997</year><year>2012</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -134,16 +135,16 @@
<marker id="agent_opts_and_types"></marker>
<p>Agent specific config options and types:</p>
<taglist>
- <marker id="agent_type"></marker>
- <tag><c><![CDATA[agent_type() = master | sub <optional>]]></c></tag>
+ <tag><marker id="agent_type"></marker>
+ <c><![CDATA[agent_type() = master | sub <optional>]]></c></tag>
<item>
<p>If <c>master</c>, one master agent is
started. Otherwise, no agents are started. </p>
<p>Default is <c>master</c>.</p>
</item>
- <marker id="agent_disco"></marker>
- <tag><c><![CDATA[agent_discovery() = [agent_discovery_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_disco"></marker>
+ <c><![CDATA[agent_discovery() = [agent_discovery_opt()] <optional>]]></c></tag>
<item>
<p><c>agent_discovery_opt() =
{terminating, agent_terminating_discovery_opts()} |
@@ -155,8 +156,8 @@
<p>For defaults see the options in <c>agent_discovery_opt()</c>.</p>
</item>
- <marker id="agent_term_disco_opts"></marker>
- <tag><c><![CDATA[agent_terminating_discovery_opts() = [agent_terminating_discovery_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_term_disco_opts"></marker>
+ <c><![CDATA[agent_terminating_discovery_opts() = [agent_terminating_discovery_opt()] <optional>]]></c></tag>
<item>
<p><c>agent_terminating_discovery_opt() =
{enable, boolean()} |
@@ -173,8 +174,8 @@
</list>
</item>
- <marker id="agent_orig_disco_opts"></marker>
- <tag><c><![CDATA[agent_originating_discovery_opts() = [agent_originating_discovery_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_orig_disco_opts"></marker>
+ <c><![CDATA[agent_originating_discovery_opts() = [agent_originating_discovery_opt()] <optional>]]></c></tag>
<item>
<p><c>agent_originating_discovery_opt() =
{enable, boolean()}</c></p>
@@ -187,38 +188,39 @@
</list>
</item>
- <marker id="agent_mt"></marker>
- <tag><c><![CDATA[multi_threaded() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_mt"></marker>
+ <c><![CDATA[multi_threaded() = bool() <optional>]]></c></tag>
<item>
<p>If <c>true</c>, the agent is multi-threaded, with one
thread for each get request. </p>
<p>Default is <c>false</c>.</p>
</item>
- <marker id="agent_data_dir"></marker>
- <tag><c><![CDATA[db_dir() = string() <mandatory>]]></c></tag>
+ <tag><marker id="agent_data_dir"></marker>
+ <c><![CDATA[db_dir() = string() <mandatory>]]></c></tag>
<item>
<p>Defines where the SNMP agent internal db files are stored.</p>
</item>
- <marker id="agent_gb_max_vbs"></marker>
- <tag><c><![CDATA[gb_max_vbs() = pos_integer() | infinity <optional>]]></c></tag>
+
+ <tag><marker id="agent_gb_max_vbs"></marker>
+ <c><![CDATA[gb_max_vbs() = pos_integer() | infinity <optional>]]></c></tag>
<item>
<p>Defines the maximum number of varbinds allowed
in a Get-BULK response.</p>
<p>Default is <c>1000</c>.</p>
</item>
- <marker id="agent_local_db"></marker>
- <tag><c><![CDATA[local_db() = [local_db_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_local_db"></marker>
+ <c><![CDATA[local_db() = [local_db_opt()] <optional>]]></c></tag>
<item>
<p><c>local_db_opt() = {repair, agent_repair()} | {auto_save, agent_auto_save()} | {verbosity, verbosity()}</c></p>
<p>Defines options specific for the SNMP agent local database.</p>
<p>For defaults see the options in <c>local_db_opt()</c>.</p>
</item>
- <marker id="agent_ldb_repair"></marker>
- <tag><c><![CDATA[agent_repair() = false | true | force <optional>]]></c></tag>
+ <tag><marker id="agent_ldb_repair"></marker>
+ <c><![CDATA[agent_repair() = false | true | force <optional>]]></c></tag>
<item>
<p>When starting snmpa_local_db it always tries to open an
existing database. If <c>false</c>, and some errors occur, a new
@@ -228,16 +230,16 @@
<p>Default is <c>true</c>.</p>
</item>
- <marker id="agent_ldb_auto_save"></marker>
- <tag><c><![CDATA[agent_auto_save() = integer() | infinity <optional>]]></c></tag>
+ <tag><marker id="agent_ldb_auto_save"></marker>
+ <c><![CDATA[agent_auto_save() = integer() | infinity <optional>]]></c></tag>
<item>
<p>The auto save interval. The table is flushed to disk
whenever not accessed for this amount of time.</p>
<p>Default is <c>5000</c>.</p>
</item>
- <marker id="agent_net_if"></marker>
- <tag><c><![CDATA[agent_net_if() = [agent_net_if_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_net_if"></marker>
+ <c><![CDATA[agent_net_if() = [agent_net_if_opt()] <optional>]]></c></tag>
<item>
<p><c>agent_net_if_opt() = {module, agent_net_if_module()} | {verbosity, verbosity()} | {options, agent_net_if_options()}</c></p>
<p>Defines options specific for the SNMP agent network interface
@@ -245,8 +247,8 @@
<p>For defaults see the options in <c>agent_net_if_opt()</c>.</p>
</item>
- <marker id="agent_ni_module"></marker>
- <tag><c><![CDATA[agent_net_if_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="agent_ni_module"></marker>
+ <c><![CDATA[agent_net_if_module() = atom() <optional>]]></c></tag>
<item>
<p>Module which handles the network interface part for the
SNMP agent. Must implement the
@@ -254,8 +256,8 @@
<p>Default is <c>snmpa_net_if</c>.</p>
</item>
- <marker id="agent_ni_opts"></marker>
- <tag><c><![CDATA[agent_net_if_options() = [agent_net_if_option()] <optional>]]></c></tag>
+ <tag><marker id="agent_ni_opts"></marker>
+ <c><![CDATA[agent_net_if_options() = [agent_net_if_option()] <optional>]]></c></tag>
<item>
<p><c>agent_net_if_option() = {bind_to, bind_to()} |
{sndbuf, sndbuf()} |
@@ -269,15 +271,15 @@
<p>For defaults see the options in <c>agent_net_if_option()</c>.</p>
</item>
- <marker id="agent_ni_req_limit"></marker>
- <tag><c><![CDATA[req_limit() = integer() | infinity <optional>]]></c></tag>
+ <tag><marker id="agent_ni_req_limit"></marker>
+ <c><![CDATA[req_limit() = integer() | infinity <optional>]]></c></tag>
<item>
<p>Max number of simultaneous requests handled by the agent.</p>
<p>Default is <c>infinity</c>.</p>
</item>
- <marker id="agent_ni_filter_opts"></marker>
- <tag><c><![CDATA[agent_net_if_filter_options() = [agent_net_if_filter_option()] <optional>]]></c></tag>
+ <tag><marker id="agent_ni_filter_opts"></marker>
+ <c><![CDATA[agent_net_if_filter_options() = [agent_net_if_filter_option()] <optional>]]></c></tag>
<item>
<p><c>agent_net_if_filter_option() = {module, agent_net_if_filter_module()}</c></p>
<p>These options are actually specific to the used module.
@@ -287,8 +289,8 @@
<c>agent_net_if_filter_option()</c>.</p>
</item>
- <marker id="agent_ni_filter_module"></marker>
- <tag><c><![CDATA[agent_net_if_filter_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="agent_ni_filter_module"></marker>
+ <c><![CDATA[agent_net_if_filter_module() = atom() <optional>]]></c></tag>
<item>
<p>Module which handles the network interface filter part for the
SNMP agent. Must implement the
@@ -296,8 +298,8 @@
<p>Default is <c>snmpa_net_if_filter</c>.</p>
</item>
- <marker id="agent_mibs"></marker>
- <tag><c><![CDATA[agent_mibs() = [string()] <optional>]]></c></tag>
+ <tag><marker id="agent_mibs"></marker>
+ <c><![CDATA[agent_mibs() = [string()] <optional>]]></c></tag>
<item>
<p>Specifies a list of MIBs (including path) that defines which MIBs
are initially loaded into the SNMP master agent. </p>
@@ -311,42 +313,131 @@
<p>Default is <c>[]</c>.</p>
</item>
- <marker id="agent_mib_storage"></marker>
- <tag><c><![CDATA[mib_storage() = ets | {ets, Dir} | {ets, Dir, Action} | dets | {dets, Dir} | {dets, Dir, Action} | mnesia | {mnesia, Nodes} | {mnesia, Nodes, Action} <optional>]]></c></tag>
- <item>
- <p>Specifies how info retrieved from the mibs will be stored.</p>
- <p>If <c>mib_storage</c> is <c>{ets, Dir}</c>, the table will also be
- stored on file. If <c>Dir</c> is <c>default</c>, then <c>db_dir</c>
- will be used.</p>
- <p>If <c>mib_storage</c> is <c>dets</c> or if <c>Dir</c> is
- <c>default</c>, then <c>db_dir</c> will be used for <c>Dir</c>.</p>
- <p>If <c>mib_storage</c> is <c>mnesia</c> then <c>erlang:nodes()</c>
- will be used for <c>Nodes</c>.</p>
- <p>Default is <c>ets</c>. </p>
- <p><c>Dir = default | string()</c>. Dir is the directory where the
- files will be stored. If <c>default</c>, then <c>db_dir</c> will be
- used.</p>
- <p><c>Nodes = visible | connected | [node()]</c>.
- <c>Nodes = visible</c> is translated to
- <c>erlang:nodes(visible)</c>.
- <c>Nodes = connected</c> is translated to
- <c>erlang:nodes(connected)</c>.
- If <c>Nodes = []</c> then the own node is assumed.</p>
- <p><c>Action = clear | keep</c>. Default is <c>keep</c>.
- <c>Action</c> is used to specify what shall be done if the
- mnesia/dets table already exist.</p>
- </item>
-
- <marker id="agent_mib_server"></marker>
- <tag><c><![CDATA[mib_server() = [mib_server_opt()] <optional>]]></c></tag>
- <item>
- <p><c>mib_server_opt() = {mibentry_override, mibentry_override()} | {trapentry_override, trapentry_override()} | {verbosity, verbosity()} | {cache, mibs_cache()}</c></p>
+ <tag><marker id="agent_mib_storage"></marker>
+ <c><![CDATA[mib_storage() = [mib_storage_opt()] <optional>]]></c></tag>
+ <item>
+ <p><c>mib_storage_opt() = {module, mib_storage_module()} | {options, mib_storage_options()}</c></p>
+ <p>This option specifies how basic mib data is stored.
+ This option is used by two parts of the snmp agent:
+ The mib-server and the symbolic-store. </p>
+ <p>Default is <c>[{module, snmpa_mib_storage_ets}]</c>. </p>
+ </item>
+
+ <tag><marker id="agent_mst_module"></marker>
+ <c><![CDATA[mib_storage_module() = snmpa_mib_data_ets | snmpa_mib_data_dets | snmpa_mib_data_mnesia | module()]]></c></tag>
+ <item>
+ <p>Defines the mib storage module of the SNMP agent as defined by the
+ <seealso marker="snmpa_mib_storage">snmpa_mib_storage</seealso>
+ behaviour. </p>
+ <p>Several entities (<c>mib-server</c> via the its data module and
+ the <c>symbolic-store</c>) of the snmp agent uses this for storage
+ of miscelaneous mib related data retrieved while loading a mib. </p>
+ <p>There are several implementations provided with the agent:
+ <c>snmpa_mib_storage_ets</c>, <c>snmpa_mib_storage_dets</c> and
+ <c>snmpa_mib_storage_mnesia</c>. </p>
+ <p>Default module is <c>snmpa_mib_storage_ets</c>. </p>
+ </item>
+
+ <tag><marker id="agent_mst_options"></marker>
+ <c><![CDATA[mib_storage_options() = list() <optional>]]></c></tag>
+ <item>
+ <p>This is implementattion depended. That is, it depends on the
+ module. For each module a specific set of options are valid.
+ For the module provided with the app, these options are supported: </p>
+ <list type="bulleted">
+ <item>
+ <p><c>snmpa_mib_storage_ets</c>: <c>{dir, filename()} | {action, keep | clear}, {checksum, boolean()}</c></p>
+ <list>
+ <item>
+ <p><c>dir</c> - If present, points to a directory where a file
+ to which all data in the ets table is "synced". </p>
+ <p>Also, when a table is opened this file is read,
+ if it exists. </p>
+ <p>By default, this will <em>not</em> be used. </p>
+ </item>
+ <item>
+ <p><c>action</c> - Specifies the behaviour when a non-empty
+ file is found: Keep its content or clear it out. </p>
+ <p>Default is <c>keep</c>. </p>
+ </item>
+ <item>
+ <p><c>checksum</c> - Defines if the file is checksummed
+ or not. </p>
+ <p>Default is <c>false</c>. </p>
+ </item>
+ </list>
+ </item>
+ <item>
+ <p><c>snmpa_mib_storage_dets</c>: <c>{dir, filename()} | {action, keep | clear}, {auto_save, default | pos_integer()} | {repair, force | boolean()}</c></p>
+ <list>
+ <item>
+ <p><c>dir</c> - This <em>mandatory</em> option points to a
+ directory where to place the file of a dets table. </p>
+ </item>
+ <item>
+ <p><c>action</c> - Specifies the behaviour when a non-empty
+ file is found: Keep its content or clear it out. </p>
+ <p>Default is <c>keep</c>. </p>
+ </item>
+ <item>
+ <p><c>auto_save</c> - Defines the dets auto-save frequency. </p>
+ <p>Default is <c>default</c>. </p>
+ </item>
+ <item>
+ <p><c>repair</c> - Defines the dets repair behaviour. </p>
+ <p>Default is <c>false</c>. </p>
+ </item>
+ </list>
+ </item>
+ <item>
+ <p><c>snmpa_mib_storage_mnesia</c>: <c>{action, keep | clear}, {nodes, [node()]}</c></p>
+ <list>
+ <item>
+ <p><c>action</c> - Specifies the behaviour when a non-empty,
+ already existing, table: Keep its content or clear it out. </p>
+ <p>Default is <c>keep</c>. </p>
+ </item>
+ <item>
+ <p><c>nodes</c> - A list of node names (or an atom
+ describing a list of nodes) defining where to open the table.
+ Its up to the user to ensure that mnesia is actually running
+ on the specified nodes. </p>
+ <p>The following distinct values are recognised: </p>
+ <list>
+ <item>
+ <p><c>[]</c> - Translated into a list of the own node: <c>[node()]</c></p>
+ </item>
+ <item>
+ <p><c>all</c> - <c>erlang:nodes()</c></p>
+ </item>
+ <item>
+ <p><c>visible</c> - <c>erlang:nodes(visible)</c></p>
+ </item>
+ <item>
+ <p><c>connected</c> - <c>erlang:nodes(connected)</c></p>
+ </item>
+ <item>
+ <p><c>db_nodes</c> - <c>mnesia:system_info(db_nodes)</c></p>
+ </item>
+ </list>
+
+ <p>Default is the result of the call: <c>erlang:nodes()</c>. </p>
+ </item>
+ </list>
+ </item>
+ </list>
+ </item>
+
+ <tag><marker id="agent_mib_server"></marker>
+ <c><![CDATA[mib_server() = [mib_server_opt()] <optional>]]></c></tag>
+ <item>
+ <p><c>mib_server_opt() = {mibentry_override, mibentry_override()} | {trapentry_override, trapentry_override()} | {verbosity, verbosity()} | {cache, mibs_cache()} | {data_module, mib_server_data_module()}</c></p>
<p>Defines options specific for the SNMP agent mib server. </p>
<p>For defaults see the options in <c>mib_server_opt()</c>.</p>
</item>
- <marker id="agent_ms_meo"></marker>
- <tag><c><![CDATA[mibentry_override() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_ms_meo"></marker>
+ <c><![CDATA[mibentry_override() = bool() <optional>]]></c></tag>
<item>
<p>If this value is false, then when loading a mib each mib-
entry is checked prior to installation of the mib.
@@ -355,8 +446,8 @@
<p>Default is <c>false</c>.</p>
</item>
- <marker id="agent_ms_teo"></marker>
- <tag><c><![CDATA[trapentry_override() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_ms_teo"></marker>
+ <c><![CDATA[trapentry_override() = bool() <optional>]]></c></tag>
<item>
<p>If this value is false, then when loading a mib each trap
is checked prior to installation of the mib.
@@ -365,54 +456,76 @@
<p>Default is <c>false</c>.</p>
</item>
- <marker id="agent_ms_cache"></marker>
- <tag><c><![CDATA[mibs_cache() = bool() | mibs_cache_opts() <optional>]]></c></tag>
+<!--
+ <tag><marker id="agent_ms_data_module"></marker>
+ <c><![CDATA[mib_server_data_module() = snmpa_mib_data_tttn | snmpa_mib_data_ttln | module() <optional>]]></c></tag>
+-->
+ <tag><marker id="agent_ms_data_module"></marker>
+ <c><![CDATA[mib_server_data_module() = snmpa_mib_data_tttn | module() <optional>]]></c></tag>
+ <item>
+ <p>Defines the backend data module of the SNMP agent mib-server as
+ defined by the
+ <seealso marker="snmpa_mib_data">snmpa_mib_data</seealso>
+ behaviour. </p>
+ <p>At present only the default module is provided with the agent,
+ <c>snmpa_mib_data_tttn</c>. </p>
+<!--
+ <p>Two modules is provided with the agent
+ <c>snmpa_mib_data_tttn</c> (this is the old implementation) and
+ <c>snmpa_mib_data_ttln</c> (for a mib tree with many holes,
+ this algorithm can be more price efficient). </p>
+-->
+ <p>Default module is <c>snmpa_mib_data_tttn</c>. </p>
+ </item>
+
+ <tag><marker id="agent_ms_cache"></marker>
+ <c><![CDATA[mibs_cache() = bool() | mibs_cache_opts() <optional>]]></c></tag>
<item>
<p>Shall the agent utilize the mib server lookup cache or not.</p>
<p>Default is <c>true</c> (in which case the <c>mibs_cache_opts()</c>
default values apply).</p>
</item>
- <marker id="agent_ms_cache_opts"></marker>
- <tag><c><![CDATA[mibs_cache_opts() = [mibs_cache_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_ms_cache_opts"></marker>
+ <c><![CDATA[mibs_cache_opts() = [mibs_cache_opt()] <optional>]]></c></tag>
<item>
<p><c>mibs_cache_opt() = {autogc, mibs_cache_autogc()} | {gclimit, mibs_cache_gclimit()} | {age, mibs_cache_age()}</c></p>
<p>Defines options specific for the SNMP agent mib server cache. </p>
<p>For defaults see the options in <c>mibs_cache_opt()</c>.</p>
</item>
- <marker id="agent_ms_cache_autogc"></marker>
- <tag><c><![CDATA[mibs_cache_autogc() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_ms_cache_autogc"></marker>
+ <c><![CDATA[mibs_cache_autogc() = bool() <optional>]]></c></tag>
<item>
<p>Defines if the mib server shall perform cache gc automatically or
- leave it to the user (see
- <seealso marker="snmpa#gc_mibs_cache">gc_mibs_cache/0,1,2,3</seealso>). </p>
+ leave it to the user (see
+ <seealso marker="snmpa#gc_mibs_cache">gc_mibs_cache/0,1,2,3</seealso>). </p>
<p>Default is <c>true</c>.</p>
</item>
- <marker id="agent_ms_cache_age"></marker>
- <tag><c><![CDATA[mibs_cache_age() = integer() > 0 <optional>]]></c></tag>
+ <tag><marker id="agent_ms_cache_age"></marker>
+ <c><![CDATA[mibs_cache_age() = integer() > 0 <optional>]]></c></tag>
<item>
- <p>Defines how old the entries in the cache will be allowed before
- they are GC'ed (assuming GC is performed). Each entry in the
- cache is "touched" whenever it is accessed. </p>
- <p>The age is defined in milliseconds. </p>
- <p>Default is <c>10 timutes</c>.</p>
+ <p>Defines how old the entries in the cache will be allowed
+ to become before they are GC'ed (assuming GC is performed).
+ Each entry in the cache is "touched" whenever it is accessed. </p>
+ <p>The age is defined in milliseconds. </p>
+ <p>Default is <c>10 timutes</c>.</p>
</item>
- <marker id="agent_ms_cache_gclimit"></marker>
- <tag><c><![CDATA[mibs_cache_gclimit() = integer() > 0 | infinity <optional>]]></c></tag>
+ <tag><marker id="agent_ms_cache_gclimit"></marker>
+ <c><![CDATA[mibs_cache_gclimit() = integer() > 0 | infinity <optional>]]></c></tag>
<item>
<p>When performing a GC, this is the max number of cache entries
- that will be deleted from the cache. </p>
+ that will be deleted from the cache. </p>
<p>The reason for having this limit is that if the cache is
- large, the GC can potentially take a long time, during which
- the agent is locked. </p>
- <p>Default is <c>100</c>.</p>
+ large, the GC can potentially take a long time, during which
+ the agent is locked. </p>
+ <p>Default is <c>100</c>.</p>
</item>
- <marker id="agent_error_report_mod"></marker>
- <tag><c><![CDATA[error_report_mod() = atom() <optional>]]></c></tag>
+ <tag><marker id="agent_error_report_mod"></marker>
+ <c><![CDATA[error_report_mod() = atom() <optional>]]></c></tag>
<item>
<p>Defines an error report module, implementing the
<seealso marker="snmpa_error_report">snmpa_error_report</seealso>
@@ -421,38 +534,38 @@
<p>Default is <c>snmpa_error_logger</c>.</p>
</item>
- <marker id="agent_symbolic_store"></marker>
- <tag><c>symbolic_store() = [symbolic_store_opt()]</c></tag>
+ <tag><marker id="agent_symbolic_store"></marker>
+ <c>symbolic_store() = [symbolic_store_opt()]</c></tag>
<item>
<p><c>symbolic_store_opt() = {verbosity, verbosity()}</c></p>
<p>Defines options specific for the SNMP agent symbolic store. </p>
<p>For defaults see the options in <c>symbolic_store_opt()</c>.</p>
</item>
- <marker id="agent_target_cache"></marker>
- <tag><c>target_cache() = [target_cache_opt()]</c></tag>
+ <tag><marker id="agent_target_cache"></marker>
+ <c>target_cache() = [target_cache_opt()]</c></tag>
<item>
<p><c>target_cache_opt() = {verbosity, verbosity()}</c></p>
<p>Defines options specific for the SNMP agent target cache. </p>
<p>For defaults see the options in <c>target_cache_opt()</c>.</p>
</item>
- <marker id="agent_config"></marker>
- <tag><c><![CDATA[agent_config() = [agent_config_opt()] <mandatory>]]></c></tag>
+ <tag><marker id="agent_config"></marker>
+ <c><![CDATA[agent_config() = [agent_config_opt()] <mandatory>]]></c></tag>
<item>
<p><c>agent_config_opt() = {dir, agent_config_dir()} | {force_load, force_load()} | {verbosity, verbosity()}</c></p>
<p>Defines specific config related options for the SNMP agent. </p>
<p>For defaults see the options in <c>agent_config_opt()</c>.</p>
</item>
- <marker id="agent_config_dir"></marker>
- <tag><c><![CDATA[agent_config_dir = dir() <mandatory>]]></c></tag>
+ <tag><marker id="agent_config_dir"></marker>
+ <c><![CDATA[agent_config_dir = dir() <mandatory>]]></c></tag>
<item>
<p>Defines where the SNMP agent configuration files are stored.</p>
</item>
- <marker id="agent_force_load"></marker>
- <tag><c><![CDATA[force_load() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_force_load"></marker>
+ <c><![CDATA[force_load() = bool() <optional>]]></c></tag>
<item>
<p>If <c>true</c> the configuration files are re-read
during start-up, and the contents of the configuration
@@ -466,18 +579,18 @@
<marker id="manager_opts_and_types"></marker>
<p>Manager specific config options and types:</p>
<taglist>
- <marker id="manager_server"></marker>
- <tag><c><![CDATA[server() = [server_opt()] <optional>]]></c></tag>
+ <tag><marker id="manager_server"></marker>
+ <c><![CDATA[server() = [server_opt()] <optional>]]></c></tag>
<item>
<p><c>server_opt() = {timeout, server_timeout()} | {verbosity, verbosity()}</c></p>
<p>Specifies the options for the manager server process.</p>
<p>Default is <c>silence</c>.</p>
</item>
- <marker id="manager_server_timeout"></marker>
- <tag><c><![CDATA[server_timeout() = integer() <optional>]]></c></tag>
+ <tag><marker id="manager_server_timeout"></marker>
+ <c><![CDATA[server_timeout() = integer() <optional>]]></c></tag>
<item>
- <p>Asynchroneous request cleanup time. For every requests,
+ <p>Asynchronous request cleanup time. For every requests,
some info is stored internally, in order to be able to
deliver the reply (when it arrives) to the proper destination.
If the reply arrives, this info will be deleted. But if
@@ -495,44 +608,44 @@
<p>Default is <c>30000</c>.</p>
</item>
- <marker id="manager_config"></marker>
- <tag><c><![CDATA[manager_config() = [manager_config_opt()] <mandatory>]]></c></tag>
+ <tag><marker id="manager_config"></marker>
+ <c><![CDATA[manager_config() = [manager_config_opt()] <mandatory>]]></c></tag>
<item>
<p><c>manager_config_opt() = {dir, manager_config_dir()} | {db_dir, manager_db_dir()} | {db_init_error, db_init_error()} | {repair, manager_repair()} | {auto_save, manager_auto_save()} | {verbosity, verbosity()}</c></p>
<p>Defines specific config related options for the SNMP manager. </p>
<p>For defaults see the options in <c>manager_config_opt()</c>.</p>
</item>
- <marker id="manager_config_dir"></marker>
- <tag><c><![CDATA[manager_config_dir = dir() <mandatory>]]></c></tag>
+ <tag><marker id="manager_config_dir"></marker>
+ <c><![CDATA[manager_config_dir = dir() <mandatory>]]></c></tag>
<item>
<p>Defines where the SNMP manager configuration files are stored.</p>
</item>
- <marker id="manager_config_db_dir"></marker>
- <tag><c><![CDATA[manager_db_dir = dir() <mandatory>]]></c></tag>
+ <tag><marker id="manager_config_db_dir"></marker>
+ <c><![CDATA[manager_db_dir = dir() <mandatory>]]></c></tag>
<item>
<p>Defines where the SNMP manager store persistent data.</p>
</item>
- <marker id="manager_config_repair"></marker>
- <tag><c><![CDATA[manager_repair() = false | true | force <optional>]]></c></tag>
+ <tag><marker id="manager_config_repair"></marker>
+ <c><![CDATA[manager_repair() = false | true | force <optional>]]></c></tag>
<item>
<p>Defines the repair option for the persistent database (if
and how the table is repaired when opened). </p>
<p>Default is <c>true</c>.</p>
</item>
- <marker id="manager_config_auto_save"></marker>
- <tag><c><![CDATA[manager_auto_save() = integer() | infinity <optional>]]></c></tag>
+ <tag><marker id="manager_config_auto_save"></marker>
+ <c><![CDATA[manager_auto_save() = integer() | infinity <optional>]]></c></tag>
<item>
<p>The auto save interval. The table is flushed to disk
whenever not accessed for this amount of time.</p>
<p>Default is <c>5000</c>.</p>
</item>
- <marker id="manager_irb"></marker>
- <tag><c><![CDATA[manager_irb() = auto | user | {user, integer()} <optional>]]></c></tag>
+ <tag><marker id="manager_irb"></marker>
+ <c><![CDATA[manager_irb() = auto | user | {user, integer()} <optional>]]></c></tag>
<item>
<p>This option defines how the manager will handle the sending of
response (acknowledgment) to received inform-requests. </p>
@@ -561,16 +674,16 @@
<p>Default is <c>auto</c>.</p>
</item>
- <marker id="manager_mibs"></marker>
- <tag><c><![CDATA[manager_mibs() = [string()] <optional>]]></c></tag>
+ <tag><marker id="manager_mibs"></marker>
+ <c><![CDATA[manager_mibs() = [string()] <optional>]]></c></tag>
<item>
<p>Specifies a list of MIBs (including path) and defines which MIBs
are initially loaded into the SNMP manager. </p>
<p>Default is <c>[]</c>.</p>
</item>
- <marker id="manager_net_if"></marker>
- <tag><c><![CDATA[manager_net_if() = [manager_net_if_opt()] <optional>]]></c></tag>
+ <tag><marker id="manager_net_if"></marker>
+ <c><![CDATA[manager_net_if() = [manager_net_if_opt()] <optional>]]></c></tag>
<item>
<p><c>manager_net_if_opt() = {module, manager_net_if_module()} |
{verbosity, verbosity()} |
@@ -580,8 +693,8 @@
<p>For defaults see the options in <c>manager_net_if_opt()</c>.</p>
</item>
- <marker id="manager_ni_opts"></marker>
- <tag><c><![CDATA[manager_net_if_options() = [manager_net_if_option()] <optional>]]></c></tag>
+ <tag><marker id="manager_ni_opts"></marker>
+ <c><![CDATA[manager_net_if_options() = [manager_net_if_option()] <optional>]]></c></tag>
<item>
<p><c>manager_net_if_option() = {bind_to, bind_to()} |
{sndbuf, sndbuf()} |
@@ -594,8 +707,8 @@
<p>For defaults see the options in <c>manager_net_if_option()</c>.</p>
</item>
- <marker id="manager_ni_module"></marker>
- <tag><c><![CDATA[manager_net_if_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="manager_ni_module"></marker>
+ <c><![CDATA[manager_net_if_module() = atom() <optional>]]></c></tag>
<item>
<p>The module which handles the network interface part for the
SNMP manager. It must implement the
@@ -603,8 +716,8 @@
<p>Default is <c>snmpm_net_if</c>.</p>
</item>
- <marker id="manager_ni_filter_opts"></marker>
- <tag><c><![CDATA[manager_net_if_filter_options() = [manager_net_if_filter_option()] <optional>]]></c></tag>
+ <tag><marker id="manager_ni_filter_opts"></marker>
+ <c><![CDATA[manager_net_if_filter_options() = [manager_net_if_filter_option()] <optional>]]></c></tag>
<item>
<p><c>manager_net_if_filter_option() = {module, manager_net_if_filter_module()}</c></p>
<p>These options are actually specific to the used module.
@@ -614,8 +727,8 @@
<c>manager_net_if_filter_option()</c>.</p>
</item>
- <marker id="manager_ni_filter_module"></marker>
- <tag><c><![CDATA[manager_net_if_filter_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="manager_ni_filter_module"></marker>
+ <c><![CDATA[manager_net_if_filter_module() = atom() <optional>]]></c></tag>
<item>
<p>Module which handles the network interface filter part for the
SNMP manager. Must implement the
@@ -623,16 +736,16 @@
<p>Default is <c>snmpm_net_if_filter</c>.</p>
</item>
- <marker id="manager_def_user_module"></marker>
- <tag><c><![CDATA[def_user_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="manager_def_user_module"></marker>
+ <c><![CDATA[def_user_module() = atom() <optional>]]></c></tag>
<item>
<p>The module implementing the default user. See the
<seealso marker="snmpm_user">snmpm_user</seealso> behaviour.</p>
<p>Default is <c>snmpm_user_default</c>.</p>
</item>
- <marker id="manager_def_user_data"></marker>
- <tag><c><![CDATA[def_user_data() = term() <optional>]]></c></tag>
+ <tag><marker id="manager_def_user_data"></marker>
+ <c><![CDATA[def_user_data() = term() <optional>]]></c></tag>
<item>
<p>Data for the default user. Passed to the user module when
calling the callback functions.</p>
@@ -643,8 +756,8 @@
<marker id="common_types"></marker>
<p>Common config types:</p>
<taglist>
- <marker id="restart_type"></marker>
- <tag><c>restart_type() = permanent | transient | temporary</c></tag>
+ <tag><marker id="restart_type"></marker>
+ <c>restart_type() = permanent | transient | temporary</c></tag>
<item>
<p>See <seealso marker="stdlib:supervisor#child_spec">supervisor</seealso>
documentation for more info.</p>
@@ -652,41 +765,44 @@
for the manager.</p>
</item>
- <marker id="db_init_error"></marker>
- <tag><c>db_init_error() = terminate | create</c></tag>
+ <tag><marker id="db_init_error"></marker>
+ <c>db_init_error() = terminate | create | create_db_and_dir</c></tag>
<item>
<p>Defines what to do if the agent or manager is unable to open an
existing database file. <c>terminate</c> means that the
agent/manager will terminate and <c>create</c> means that the
- agent/manager will remove the faulty file(s) and create new ones.</p>
+ agent/manager will remove the faulty file(s) and create new ones,
+ and <c>create_db_and_dir</c> means that the agent/manager will
+ create the database file along with any missing parent directories
+ for the database file.</p>
<p>Default is <c>terminate</c>.</p>
</item>
- <marker id="prio"></marker>
- <tag><c><![CDATA[priority() = atom() <optional>]]></c></tag>
+ <tag><marker id="prio"></marker>
+ <c><![CDATA[priority() = atom() <optional>]]></c></tag>
<item>
<p>Defines the Erlang priority for all SNMP processes.</p>
<p>Default is <c>normal</c>.</p>
</item>
- <marker id="versions"></marker>
- <tag><c><![CDATA[versions() = [version()] <optional>]]></c></tag>
+ <tag><marker id="versions"></marker>
+ <c><![CDATA[versions() = [version()] <optional>]]></c></tag>
<item>
<p><c>version() = v1 | v2 | v3</c></p>
<p>Which SNMP versions shall be accepted/used.</p>
<p>Default is <c>[v1,v2,v3]</c>.</p>
</item>
- <marker id="verbosity"></marker>
- <tag><c><![CDATA[verbosity() = silence | info | log | debug | trace <optional>]]></c></tag>
+ <tag><marker id="verbosity"></marker>
+ <c><![CDATA[verbosity() = silence | info | log | debug | trace <optional>]]></c></tag>
<item>
<p>Verbosity for a SNMP process. This specifies now much debug info
is printed.</p>
<p>Default is <c>silence</c>.</p>
</item>
- <marker id="bind_to"></marker>
- <tag><c><![CDATA[bind_to() = bool() <optional>]]></c></tag>
+ <tag><marker id="bind_to"></marker>
+ <c><![CDATA[bind_to() = bool() <optional>]]></c></tag>
<item>
<p>If <c>true</c>, net_if binds to the IP address.
If <c>false</c>, net_if listens on any IP address on the host
@@ -694,8 +810,8 @@
<p>Default is <c>false</c>.</p>
</item>
- <marker id="no_reuse"></marker>
- <tag><c><![CDATA[no_reuse() = bool() <optional>]]></c></tag>
+ <tag><marker id="no_reuse"></marker>
+ <c><![CDATA[no_reuse() = bool() <optional>]]></c></tag>
<item>
<p>If <c>true</c>, net_if does not specify that the IP
and port address should be reusable. If <c>false</c>,
@@ -703,30 +819,30 @@
<p>Default is <c>false</c>.</p>
</item>
- <marker id="recbuf"></marker>
- <tag><c><![CDATA[recbuf() = integer() <optional>]]></c></tag>
+ <tag><marker id="recbuf"></marker>
+ <c><![CDATA[recbuf() = integer() <optional>]]></c></tag>
<item>
<p>Receive buffer size. </p>
<p>Default value is defined by <c>gen_udp</c>.</p>
</item>
- <marker id="sndbuf"></marker>
- <tag><c><![CDATA[sndbuf() = integer() <optional>]]></c></tag>
+ <tag><marker id="sndbuf"></marker>
+ <c><![CDATA[sndbuf() = integer() <optional>]]></c></tag>
<item>
<p>Send buffer size. </p>
<p>Default value is defined by <c>gen_udp</c>.</p>
</item>
- <marker id="note_store"></marker>
- <tag><c><![CDATA[note_store() = [note_store_opt()] <optional>]]></c></tag>
+ <tag><marker id="note_store"></marker>
+ <c><![CDATA[note_store() = [note_store_opt()] <optional>]]></c></tag>
<item>
<p><c>note_store_opt() = {timeout, note_store_timeout()} | {verbosity, verbosity()}</c></p>
<p>Specifies the start-up verbosity for the SNMP note store.</p>
<p>For defaults see the options in <c>note_store_opt()</c>.</p>
</item>
- <marker id="ns_timeout"></marker>
- <tag><c><![CDATA[note_store_timeout() = integer() <optional>]]></c></tag>
+ <tag><marker id="ns_timeout"></marker>
+ <c><![CDATA[note_store_timeout() = integer() <optional>]]></c></tag>
<item>
<p>Note cleanup time. When storing a note in the note store,
each note is given lifetime. Every <c>timeout</c> the note_store
@@ -736,8 +852,8 @@
</item>
- <marker id="audit_trail_log"></marker>
- <tag><c><![CDATA[audit_trail_log() = [audit_trail_log_opt()] <optional>]]></c></tag>
+ <tag><marker id="audit_trail_log"></marker>
+ <c><![CDATA[audit_trail_log() = [audit_trail_log_opt()] <optional>]]></c></tag>
<item>
<p><c>audit_trail_log_opt() = {type, atl_type()} | {dir, atl_dir()} | {size, atl_size()} | {repair, atl_repair()} | {seqno, atl_seqno()}</c></p>
<p>If present, this option specifies the options for the
@@ -747,8 +863,8 @@
<p>If not present, audit trail logging is not used.</p>
</item>
- <marker id="atl_type"></marker>
- <tag><c><![CDATA[atl_type() = read | write | read_write <optional>]]></c></tag>
+ <tag><marker id="atl_type"></marker>
+ <c><![CDATA[atl_type() = read | write | read_write <optional>]]></c></tag>
<item>
<p>Specifies what type of an audit trail log should be used.
The effect of the type is actually different for the the agent
@@ -769,16 +885,16 @@
<p>Default is <c>read_write</c>.</p>
</item>
- <marker id="atl_dir"></marker>
- <tag><c><![CDATA[atl_dir = dir() <mandatory>]]></c></tag>
+ <tag><marker id="atl_dir"></marker>
+ <c><![CDATA[atl_dir = dir() <mandatory>]]></c></tag>
<item>
<p>Specifies where the audit trail log should be stored.</p>
<p>If <c>audit_trail_log</c> specifies that logging should take
place, this parameter <em>must</em> be defined.</p>
</item>
- <marker id="atl_size"></marker>
- <tag><c><![CDATA[atl_size() = {integer(), integer()} <mandatory>]]></c></tag>
+ <tag><marker id="atl_size"></marker>
+ <c><![CDATA[atl_size() = {integer(), integer()} <mandatory>]]></c></tag>
<item>
<p>Specifies the size of the audit
trail log. This parameter is sent to <c>disk_log</c>. </p>
@@ -786,8 +902,8 @@
take place, this parameter <em>must</em> be defined.</p>
</item>
- <marker id="atl_repair"></marker>
- <tag><c><![CDATA[atl_repair() = true | false | truncate | snmp_repair <optional>]]></c></tag>
+ <tag><marker id="atl_repair"></marker>
+ <c><![CDATA[atl_repair() = true | false | truncate | snmp_repair <optional>]]></c></tag>
<item>
<p>Specifies if and how the audit trail log shall be repaired
when opened. Unless this parameter has the value <c>snmp_repair</c>
@@ -799,8 +915,8 @@
<p>Default is <c>true</c>.</p>
</item>
- <marker id="atl_seqno"></marker>
- <tag><c><![CDATA[atl_seqno() = true | false <optional>]]></c></tag>
+ <tag><marker id="atl_seqno"></marker>
+ <c><![CDATA[atl_seqno() = true | false <optional>]]></c></tag>
<item>
<p>Specifies if the audit trail log entries will be (sequence)
numbered or not. The range of the sequence numbers are according
diff --git a/lib/snmp/doc/src/snmp_app_a.xml b/lib/snmp/doc/src/snmp_app_a.xml
index 5192279a45..c6d7ae2f53 100644
--- a/lib/snmp/doc/src/snmp_app_a.xml
+++ b/lib/snmp/doc/src/snmp_app_a.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_app_b.xml b/lib/snmp/doc/src/snmp_app_b.xml
index 536a4b5c6f..2ef94f0fde 100644
--- a/lib/snmp/doc/src/snmp_app_b.xml
+++ b/lib/snmp/doc/src/snmp_app_b.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_audit_trail_log.xml b/lib/snmp/doc/src/snmp_audit_trail_log.xml
index 9a49a0175b..4fcdceb321 100644
--- a/lib/snmp/doc/src/snmp_audit_trail_log.xml
+++ b/lib/snmp/doc/src/snmp_audit_trail_log.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_community_mib.xml b/lib/snmp/doc/src/snmp_community_mib.xml
index 5e7bca3e27..61dea05950 100644
--- a/lib/snmp/doc/src/snmp_community_mib.xml
+++ b/lib/snmp/doc/src/snmp_community_mib.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1999</year><year>2011</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml
index eec53162a1..6d4129dd06 100644
--- a/lib/snmp/doc/src/snmp_config.xml
+++ b/lib/snmp/doc/src/snmp_config.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2012</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -129,16 +130,16 @@
<marker id="agent_opts_and_types"></marker>
<p>Agent specific config options and types:</p>
<taglist>
- <marker id="agent_type"></marker>
- <tag><c><![CDATA[agent_type() = master | sub <optional>]]></c></tag>
+ <tag><marker id="agent_type"></marker>
+ <c><![CDATA[agent_type() = master | sub <optional>]]></c></tag>
<item>
<p>If <c>master</c>, one master agent is
started. Otherwise, no agents are started. </p>
<p>Default is <c>master</c>.</p>
</item>
- <marker id="agent_disco"></marker>
- <tag><c><![CDATA[agent_discovery() = [agent_discovery_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_disco"></marker>
+ <c><![CDATA[agent_discovery() = [agent_discovery_opt()] <optional>]]></c></tag>
<item>
<p><c>agent_discovery_opt() =
{terminating, agent_terminating_discovery_opts()} |
@@ -150,8 +151,8 @@
<p>For defaults see the options in <c>agent_discovery_opt()</c>.</p>
</item>
- <marker id="agent_term_disco_opts"></marker>
- <tag><c><![CDATA[agent_terminating_discovery_opts() = [agent_terminating_discovery_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_term_disco_opts"></marker>
+ <c><![CDATA[agent_terminating_discovery_opts() = [agent_terminating_discovery_opt()] <optional>]]></c></tag>
<item>
<p><c>agent_terminating_discovery_opt() =
{enable, boolean()} |
@@ -168,8 +169,8 @@
</list>
</item>
- <marker id="agent_orig_disco_opts"></marker>
- <tag><c><![CDATA[agent_originating_discovery_opts() = [agent_originating_discovery_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_orig_disco_opts"></marker>
+ <c><![CDATA[agent_originating_discovery_opts() = [agent_originating_discovery_opt()] <optional>]]></c></tag>
<item>
<p><c>agent_originating_discovery_opt() =
{enable, boolean()}</c></p>
@@ -182,38 +183,38 @@
</list>
</item>
- <marker id="agent_mt"></marker>
- <tag><c><![CDATA[multi_threaded() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_mt"></marker>
+ <c><![CDATA[multi_threaded() = bool() <optional>]]></c></tag>
<item>
<p>If <c>true</c>, the agent is multi-threaded, with one
thread for each get request. </p>
<p>Default is <c>false</c>.</p>
</item>
- <marker id="agent_data_dir"></marker>
- <tag><c><![CDATA[db_dir() = string() <mandatory>]]></c></tag>
+ <tag><marker id="agent_data_dir"></marker>
+ <c><![CDATA[db_dir() = string() <mandatory>]]></c></tag>
<item>
<p>Defines where the SNMP agent internal db files are stored.</p>
</item>
- <marker id="agent_gb_max_vbs"></marker>
- <tag><c><![CDATA[gb_max_vbs() = pos_integer() | infinity <optional>]]></c></tag>
+ <tag><marker id="agent_gb_max_vbs"></marker>
+ <c><![CDATA[gb_max_vbs() = pos_integer() | infinity <optional>]]></c></tag>
<item>
<p>Defines the maximum number of varbinds allowed
in a Get-BULK response.</p>
<p>Default is <c>1000</c>.</p>
</item>
- <marker id="agent_local_db"></marker>
- <tag><c><![CDATA[local_db() = [local_db_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_local_db"></marker>
+ <c><![CDATA[local_db() = [local_db_opt()] <optional>]]></c></tag>
<item>
<p><c>local_db_opt() = {repair, agent_repair()} | {auto_save, agent_auto_save()} | {verbosity, verbosity()}</c></p>
<p>Defines options specific for the SNMP agent local database.</p>
<p>For defaults see the options in <c>local_db_opt()</c>.</p>
</item>
- <marker id="agent_ldb_repair"></marker>
- <tag><c><![CDATA[agent_repair() = false | true | force <optional>]]></c></tag>
+ <tag><marker id="agent_ldb_repair"></marker>
+ <c><![CDATA[agent_repair() = false | true | force <optional>]]></c></tag>
<item>
<p>When starting snmpa_local_db it always tries to open an
existing database. If <c>false</c>, and some errors occur, a new
@@ -223,16 +224,16 @@
<p>Default is <c>true</c>.</p>
</item>
- <marker id="agent_ldb_auto_save"></marker>
- <tag><c><![CDATA[agent_auto_save() = integer() | infinity <optional>]]></c></tag>
+ <tag><marker id="agent_ldb_auto_save"></marker>
+ <c><![CDATA[agent_auto_save() = integer() | infinity <optional>]]></c></tag>
<item>
<p>The auto save interval. The table is flushed to disk
whenever not accessed for this amount of time.</p>
<p>Default is <c>5000</c>.</p>
</item>
- <marker id="agent_net_if"></marker>
- <tag><c><![CDATA[agent_net_if() = [agent_net_if_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_net_if"></marker>
+ <c><![CDATA[agent_net_if() = [agent_net_if_opt()] <optional>]]></c></tag>
<item>
<p><c>agent_net_if_option() = {module, agent_net_if_module()} |
{verbosity, verbosity()} |
@@ -242,8 +243,8 @@
<p>For defaults see the options in <c>agent_net_if_opt()</c>.</p>
</item>
- <marker id="agent_ni_module"></marker>
- <tag><c><![CDATA[agent_net_if_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="agent_ni_module"></marker>
+ <c><![CDATA[agent_net_if_module() = atom() <optional>]]></c></tag>
<item>
<p>Module which handles the network interface part for the
SNMP agent. Must implement the
@@ -251,8 +252,8 @@
<p>Default is <c>snmpa_net_if</c>.</p>
</item>
- <marker id="agent_ni_opts"></marker>
- <tag><c><![CDATA[agent_net_if_options() = [agent_net_if_option()] <optional>]]></c></tag>
+ <tag><marker id="agent_ni_opts"></marker>
+ <c><![CDATA[agent_net_if_options() = [agent_net_if_option()] <optional>]]></c></tag>
<item>
<p><c>agent_net_if_option() = {bind_to, bind_to()} |
{sndbuf, sndbuf()} |
@@ -266,15 +267,15 @@
<p>For defaults see the options in <c>agent_net_if_option()</c>.</p>
</item>
- <marker id="agent_ni_req_limit"></marker>
- <tag><c><![CDATA[req_limit() = integer() | infinity <optional>]]></c></tag>
+ <tag><marker id="agent_ni_req_limit"></marker>
+ <c><![CDATA[req_limit() = integer() | infinity <optional>]]></c></tag>
<item>
<p>Max number of simultaneous requests handled by the agent.</p>
<p>Default is <c>infinity</c>.</p>
</item>
- <marker id="agent_ni_filter_opts"></marker>
- <tag><c><![CDATA[agent_net_if_filter_options() = [agent_net_if_filter_option()] <optional>]]></c></tag>
+ <tag><marker id="agent_ni_filter_opts"></marker>
+ <c><![CDATA[agent_net_if_filter_options() = [agent_net_if_filter_option()] <optional>]]></c></tag>
<item>
<p><c><![CDATA[agent_net_if_filter_option() = {module, agent_net_if_filter_module()}]]></c></p>
<p>These options are actually specific to the used module.
@@ -283,8 +284,8 @@
<p>For defaults see the options in <c>agent_net_if_filter_option()</c>.</p>
</item>
- <marker id="agent_ni_filter_module"></marker>
- <tag><c><![CDATA[agent_net_if_filter_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="agent_ni_filter_module"></marker>
+ <c><![CDATA[agent_net_if_filter_module() = atom() <optional>]]></c></tag>
<item>
<p>Module which handles the network interface filter part for the
SNMP agent. Must implement the
@@ -293,8 +294,8 @@
<p>Default is <c>snmpa_net_if_filter</c>.</p>
</item>
- <marker id="agent_mibs"></marker>
- <tag><c><![CDATA[agent_mibs() = [string()] <optional>]]></c></tag>
+ <tag><marker id="agent_mibs"></marker>
+ <c><![CDATA[agent_mibs() = [string()] <optional>]]></c></tag>
<item>
<p>Specifies a list of MIBs (including path) that defines which MIBs
are initially loaded into the SNMP master agent. </p>
@@ -308,8 +309,128 @@
<p>Default is <c>[]</c>.</p>
</item>
- <marker id="agent_mib_storage"></marker>
- <tag><c><![CDATA[mib_storage() = ets | {ets, Dir} | {ets, Dir, Action} | dets | {dets, Dir} | {dets, Dir, Action} | mnesia | {mnesia, Nodes} | {mnesia, Nodes, Action} <optional>]]></c></tag>
+ <tag><marker id="agent_mib_storage"></marker>
+ <c><![CDATA[mib_storage() = [mib_storage_opt()] <optional>]]></c></tag>
+ <item>
+ <p><c>mib_storage_opt() = {module, mib_storage_module()} | {options, mib_storage_options()}</c></p>
+ <p>This option specifies how basic mib data is stored.
+ This option is used by two parts of the snmp agent:
+ The mib-server and the symbolic-store. </p>
+ <p>Default is <c>[{module, snmpa_mib_storage_ets}]</c>. </p>
+ </item>
+
+ <tag><marker id="agent_mst_module"></marker>
+ <c><![CDATA[mib_storage_module() = snmpa_mib_data_ets | snmpa_mib_data_dets | snmpa_mib_data_mnesia | module()]]></c></tag>
+ <item>
+ <p>Defines the mib storage module of the SNMP agent as defined by the
+ <seealso marker="snmpa_mib_storage">snmpa_mib_storage</seealso>
+ behaviour. </p>
+ <p>Several entities (<c>mib-server</c> via the its data module and
+ the <c>symbolic-store</c>) of the snmp agent uses this for storage
+ of miscelaneous mib related data dataretrieved while loading a mib. </p>
+ <p>There are several implementations provided with the agent:
+ <c>snmpa_mib_storage_ets</c>, <c>snmpa_mib_storage_dets</c> and
+ <c>snmpa_mib_storage_mnesia</c>. </p>
+ <p>Default module is <c>snmpa_mib_storage_ets</c>. </p>
+ </item>
+
+ <tag><marker id="agent_mst_options"></marker>
+ <c><![CDATA[mib_storage_options() = list() <optional>]]></c></tag>
+ <item>
+ <p>This is implementattion depended. That is, it depends on the
+ module. For each module a specific set of options are valid.
+ For the module provided with the app, these options are supported: </p>
+ <list type="bulleted">
+ <item>
+ <p><c>snmpa_mib_storage_ets</c>: <c>{dir, filename()} | {action, keep | clear}, {checksum, boolean()}</c></p>
+ <list>
+ <item>
+ <p><c>dir</c> - If present, points to a directory where a file
+ to which all data in the ets table is "synced". </p>
+ <p>Also, when a table is opened this file is read,
+ if it exists. </p>
+ <p>By default, this will <em>not</em> be used. </p>
+ </item>
+ <item>
+ <p><c>action</c> - Specifies the behaviour when a non-empty
+ file is found: Keep its content or clear it out. </p>
+ <p>Default is <c>keep</c>. </p>
+ </item>
+ <item>
+ <p><c>checksum</c> - Defines if the file is checksummed
+ or not. </p>
+ <p>Default is <c>false</c>. </p>
+ </item>
+ </list>
+ </item>
+ <item>
+ <p><c>snmpa_mib_storage_dets</c>: <c>{dir, filename()} | {action, keep | clear}, {auto_save, default | pos_integer()} | {repair, force | boolean()}</c></p>
+ <list>
+ <item>
+ <p><c>dir</c> - This <em>mandatory</em> option points to a
+ directory where to place the file of a dets table. </p>
+ </item>
+ <item>
+ <p><c>action</c> - Specifies the behaviour when a non-empty
+ file is found: Keep its content or clear it out. </p>
+ <p>Default is <c>keep</c>. </p>
+ </item>
+ <item>
+ <p><c>auto_save</c> - Defines the dets auto-save frequency. </p>
+ <p>Default is <c>default</c>. </p>
+ </item>
+ <item>
+ <p><c>repair</c> - Defines the dets repair behaviour. </p>
+ <p>Default is <c>false</c>. </p>
+ </item>
+ </list>
+ </item>
+ <item>
+ <p><c>snmpa_mib_storage_mnesia</c>: <c>{action, keep | clear}, {nodes, [node()]}</c></p>
+ <list>
+ <item>
+ <p><c>action</c> - Specifies the behaviour when a non-empty,
+ already existing, table: Keep its content or clear it out. </p>
+ <p>Default is <c>keep</c>. </p>
+ </item>
+ <item>
+ <p><c>nodes</c> - A list of node names (or an atom
+ describing a list of nodes) defining where to open the table.
+ Its up to the user to ensure that mnesia is actually running
+ on the specified nodes. </p>
+ <p>The following distinct values are recognised: </p>
+ <list>
+ <item>
+ <p><c>[]</c> - Translated into a list of the own node: <c>[node()]</c></p>
+ </item>
+ <item>
+ <p><c>all</c> - <c>erlang:nodes()</c></p>
+ </item>
+ <item>
+ <p><c>visible</c> - <c>erlang:nodes(visible)</c></p>
+ </item>
+ <item>
+ <p><c>connected</c> - <c>erlang:nodes(connected)</c></p>
+ </item>
+ <item>
+ <p><c>db_nodes</c> - <c>mnesia:system_info(db_nodes)</c></p>
+ </item>
+ </list>
+
+ <p>Default is the result of the call: <c>erlang:nodes()</c>. </p>
+ </item>
+ </list>
+ </item>
+ </list>
+ </item>
+
+<!--
+
+This is the old format which is "supported", but not documented,
+in so far as it will be converted to the new format if found.
+
+ <tag><marker id="agent_mib_storage"></marker>
+ <c><![CDATA[mib_storage() = ets | {ets, Dir} | {ets, Dir, Action} | dets | {dets, Dir} | {dets, Dir, Action} | mnesia | {mnesia, Nodes} | {mnesia, Nodes, Action} <optional>]]></c></tag>
<item>
<p>Specifies how info retrieved from the mibs will be stored.</p>
<p>If <c>mib_storage</c> is <c>{ets, Dir}</c>, the table will also be
@@ -333,17 +454,18 @@
<c>Action</c> is used to specify what shall be done if the
mnesia/dets table already exist.</p>
</item>
+-->
- <marker id="agent_mib_server"></marker>
- <tag><c><![CDATA[mib_server() = [mib_server_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_mib_server"></marker>
+ <c><![CDATA[mib_server() = [mib_server_opt()] <optional>]]></c></tag>
<item>
- <p><c>mib_server_opt() = {mibentry_override, mibentry_override()} | {trapentry_override, trapentry_override()} | {verbosity, verbosity()} | {cache, mibs_cache()}</c></p>
+ <p><c>mib_server_opt() = {mibentry_override, mibentry_override()} | {trapentry_override, trapentry_override()} | {verbosity, verbosity()} | {cache, mibs_cache()} | {data_module, mib_server_data_module()}</c></p>
<p>Defines options specific for the SNMP agent mib server. </p>
<p>For defaults see the options in <c>mib_server_opt()</c>.</p>
</item>
- <marker id="agent_ms_meo"></marker>
- <tag><c><![CDATA[mibentry_override() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_ms_meo"></marker>
+ <c><![CDATA[mibentry_override() = bool() <optional>]]></c></tag>
<item>
<p>If this value is false, then when loading a mib each mib-
entry is checked prior to installation of the mib.
@@ -352,8 +474,8 @@
<p>Default is <c>false</c>.</p>
</item>
- <marker id="agent_ms_teo"></marker>
- <tag><c><![CDATA[trapentry_override() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_ms_teo"></marker>
+ <c><![CDATA[trapentry_override() = bool() <optional>]]></c></tag>
<item>
<p>If this value is false, then when loading a mib each trap
is checked prior to installation of the mib.
@@ -362,54 +484,77 @@
<p>Default is <c>false</c>.</p>
</item>
- <marker id="agent_ms_cache"></marker>
- <tag><c><![CDATA[mibs_cache() = bool() | mibs_cache_opts() <optional>]]></c></tag>
+
+<!--
+ <tag><marker id="agent_ms_data_module"></marker>
+ <c><![CDATA[mib_server_data_module() = snmpa_mib_data_tttn | snmpa_mib_data_ttln | module() <optional>]]></c></tag>
+-->
+ <tag><marker id="agent_ms_data_module"></marker>
+ <c><![CDATA[mib_server_data_module() = snmpa_mib_data_tttn | module() <optional>]]></c></tag>
+ <item>
+ <p>Defines the backend data module of the SNMP agent mib-server as
+ defined by the
+ <seealso marker="snmpa_mib_data">snmpa_mib_data</seealso>
+ behaviour. </p>
+ <p>At present only the default module is provided with the agent,
+ <c>snmpa_mib_data_tttn</c>. </p>
+<!--
+ <p>Two modules is provided with the agent
+ <c>snmpa_mib_data_tttn</c> (this is the old implementation) and
+ <c>snmpa_mib_data_ttln</c> (for a mib tree with many holes,
+ this algorithm can be more price efficient). </p>
+-->
+ <p>Default module is <c>snmpa_mib_data_tttn</c>. </p>
+ </item>
+
+ <tag><marker id="agent_ms_cache"></marker>
+ <c><![CDATA[mibs_cache() = bool() | mibs_cache_opts() <optional>]]></c></tag>
<item>
<p>Shall the agent utilize the mib server lookup cache or not.</p>
<p>Default is <c>true</c> (in which case the <c>mibs_cache_opts()</c>
default values apply).</p>
</item>
- <marker id="agent_ms_cache_opts"></marker>
- <tag><c><![CDATA[mibs_cache_opts() = [mibs_cache_opt()] <optional>]]></c></tag>
+ <tag><marker id="agent_ms_cache_opts"></marker>
+ <c><![CDATA[mibs_cache_opts() = [mibs_cache_opt()] <optional>]]></c></tag>
<item>
<p><c>mibs_cache_opt() = {autogc, mibs_cache_autogc()} | {gclimit, mibs_cache_gclimit()} | {age, mibs_cache_age()}</c></p>
<p>Defines options specific for the SNMP agent mib server cache. </p>
<p>For defaults see the options in <c>mibs_cache_opt()</c>.</p>
</item>
- <marker id="agent_ms_cache_autogc"></marker>
- <tag><c><![CDATA[mibs_cache_autogc() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_ms_cache_autogc"></marker>
+ <c><![CDATA[mibs_cache_autogc() = bool() <optional>]]></c></tag>
<item>
<p>Defines if the mib server shall perform cache gc automatically or
- leave it to the user (see
- <seealso marker="snmpa#gc_mibs_cache">gc_mibs_cache/0,1,2,3</seealso>). </p>
- <p>Default is <c>true</c>.</p>
+ leave it to the user (see
+ <seealso marker="snmpa#gc_mibs_cache">gc_mibs_cache/0,1,2,3</seealso>). </p>
+ <p>Default is <c>true</c>.</p>
</item>
- <marker id="agent_ms_cache_age"></marker>
- <tag><c><![CDATA[mibs_cache_age() = integer() > 0 <optional>]]></c></tag>
+ <tag><marker id="agent_ms_cache_age"></marker>
+ <c><![CDATA[mibs_cache_age() = integer() > 0 <optional>]]></c></tag>
<item>
- <p>Defines how old the entries in the cache will be allowed before
- they are GC'ed (assuming GC is performed). Each entry in the
- cache is "touched" whenever it is accessed. </p>
- <p>The age is defined in milliseconds. </p>
+ <p>Defines how old the entries in the cache will be allowed
+ to become before they are GC'ed (assuming GC is performed).
+ Each entry in the cache is "touched" whenever it is accessed. </p>
+ <p>The age is defined in milliseconds. </p>
<p>Default is <c>10 timutes</c>.</p>
</item>
- <marker id="agent_ms_cache_gclimit"></marker>
- <tag><c><![CDATA[mibs_cache_gclimit() = integer() > 0 | infinity <optional>]]></c></tag>
+ <tag><marker id="agent_ms_cache_gclimit"></marker>
+ <c><![CDATA[mibs_cache_gclimit() = integer() > 0 | infinity <optional>]]></c></tag>
<item>
<p>When performing a GC, this is the max number of cache entries
- that will be deleted from the cache. </p>
- <p>The reason for having this limit is that if the cache is
- large, the GC can potentially take a long time, during which
- the agent is locked. </p>
- <p>Default is <c>100</c>.</p>
+ that will be deleted from the cache. </p>
+ <p>The reason for having this limit is that if the cache is
+ large, the GC can potentially take a long time, during which
+ the agent is locked. </p>
+ <p>Default is <c>100</c>.</p>
</item>
- <marker id="agent_error_report_mod"></marker>
- <tag><c><![CDATA[error_report_mod() = atom() <optional>]]></c></tag>
+ <tag><marker id="agent_error_report_mod"></marker>
+ <c><![CDATA[error_report_mod() = atom() <optional>]]></c></tag>
<item>
<p>Defines an error report module, implementing the
<seealso marker="snmpa_error_report">snmpa_error_report</seealso>
@@ -418,38 +563,38 @@
<p>Default is <c>snmpa_error_logger</c>.</p>
</item>
- <marker id="agent_symbolic_store"></marker>
- <tag><c>symbolic_store() = [symbolic_store_opt()]</c></tag>
+ <tag><marker id="agent_symbolic_store"></marker>
+ <c>symbolic_store() = [symbolic_store_opt()]</c></tag>
<item>
<p><c>symbolic_store_opt() = {verbosity, verbosity()}</c></p>
<p>Defines options specific for the SNMP agent symbolic store. </p>
<p>For defaults see the options in <c>symbolic_store_opt()</c>.</p>
</item>
- <marker id="agent_target_cache"></marker>
- <tag><c>target_cache() = [target_cache_opt()]</c></tag>
+ <tag><marker id="agent_target_cache"></marker>
+ <c>target_cache() = [target_cache_opt()]</c></tag>
<item>
<p><c>target_cache_opt() = {verbosity, verbosity()}</c></p>
<p>Defines options specific for the SNMP agent target cache. </p>
<p>For defaults see the options in <c>target_cache_opt()</c>.</p>
</item>
- <marker id="agent_config"></marker>
- <tag><c><![CDATA[agent_config() = [agent_config_opt()] <mandatory>]]></c></tag>
+ <tag><marker id="agent_config"></marker>
+ <c><![CDATA[agent_config() = [agent_config_opt()] <mandatory>]]></c></tag>
<item>
<p><c>agent_config_opt() = {dir, agent_config_dir()} | {force_load, force_load()} | {verbosity, verbosity()}</c></p>
<p>Defines specific config related options for the SNMP agent. </p>
<p>For defaults see the options in <c>agent_config_opt()</c>.</p>
</item>
- <marker id="agent_config_dir"></marker>
- <tag><c><![CDATA[agent_config_dir = dir() <mandatory>]]></c></tag>
+ <tag><marker id="agent_config_dir"></marker>
+ <c><![CDATA[agent_config_dir = dir() <mandatory>]]></c></tag>
<item>
<p>Defines where the SNMP agent configuration files are stored.</p>
</item>
- <marker id="agent_force_load"></marker>
- <tag><c><![CDATA[force_load() = bool() <optional>]]></c></tag>
+ <tag><marker id="agent_force_load"></marker>
+ <c><![CDATA[force_load() = bool() <optional>]]></c></tag>
<item>
<p>If <c>true</c> the configuration files are re-read
during start-up, and the contents of the configuration
@@ -463,18 +608,18 @@
<marker id="manager_opts_and_types"></marker>
<p>Manager specific config options and types:</p>
<taglist>
- <marker id="manager_server"></marker>
- <tag><c><![CDATA[server() = [server_opt()] <optional>]]></c></tag>
+ <tag><marker id="manager_server"></marker>
+ <c><![CDATA[server() = [server_opt()] <optional>]]></c></tag>
<item>
<p><c>server_opt() = {timeout, server_timeout()} | {verbosity, verbosity()}</c></p>
<p>Specifies the options for the manager server process.</p>
<p>Default is <c>silence</c>.</p>
</item>
- <marker id="manager_server_timeout"></marker>
- <tag><c><![CDATA[server_timeout() = integer() <optional>]]></c></tag>
+ <tag><marker id="manager_server_timeout"></marker>
+ <c><![CDATA[server_timeout() = integer() <optional>]]></c></tag>
<item>
- <p>Asynchroneous request cleanup time. For every requests,
+ <p>Asynchronous request cleanup time. For every requests,
some info is stored internally, in order to be able to
deliver the reply (when it arrives) to the proper destination.
If the reply arrives, this info will be deleted. But if
@@ -492,44 +637,44 @@
<p>Default is <c>30000</c>.</p>
</item>
- <marker id="manager_config"></marker>
- <tag><c><![CDATA[manager_config() = [manager_config_opt()] <mandatory>]]></c></tag>
+ <tag><marker id="manager_config"></marker>
+ <c><![CDATA[manager_config() = [manager_config_opt()] <mandatory>]]></c></tag>
<item>
<p><c>manager_config_opt() = {dir, manager_config_dir()} | {db_dir, manager_db_dir()} | {db_init_error, db_init_error()} | {repair, manager_repair()} | {auto_save, manager_auto_save()} | {verbosity, verbosity()}</c></p>
<p>Defines specific config related options for the SNMP manager. </p>
<p>For defaults see the options in <c>manager_config_opt()</c>.</p>
</item>
- <marker id="manager_config_dir"></marker>
- <tag><c><![CDATA[manager_config_dir = dir() <mandatory>]]></c></tag>
+ <tag><marker id="manager_config_dir"></marker>
+ <c><![CDATA[manager_config_dir = dir() <mandatory>]]></c></tag>
<item>
<p>Defines where the SNMP manager configuration files are stored.</p>
</item>
- <marker id="manager_config_db_dir"></marker>
- <tag><c><![CDATA[manager_db_dir = dir() <mandatory>]]></c></tag>
+ <tag><marker id="manager_config_db_dir"></marker>
+ <c><![CDATA[manager_db_dir = dir() <mandatory>]]></c></tag>
<item>
<p>Defines where the SNMP manager store persistent data.</p>
</item>
- <marker id="manager_config_repair"></marker>
- <tag><c><![CDATA[manager_repair() = false | true | force <optional>]]></c></tag>
+ <tag><marker id="manager_config_repair"></marker>
+ <c><![CDATA[manager_repair() = false | true | force <optional>]]></c></tag>
<item>
<p>Defines the repair option for the persistent database (if
and how the table is repaired when opened). </p>
<p>Default is <c>true</c>.</p>
</item>
- <marker id="manager_config_auto_save"></marker>
- <tag><c><![CDATA[manager_auto_save() = integer() | infinity <optional>]]></c></tag>
+ <tag><marker id="manager_config_auto_save"></marker>
+ <c><![CDATA[manager_auto_save() = integer() | infinity <optional>]]></c></tag>
<item>
<p>The auto save interval. The table is flushed to disk
whenever not accessed for this amount of time.</p>
<p>Default is <c>5000</c>.</p>
</item>
- <marker id="manager_irb"></marker>
- <tag><c><![CDATA[manager_irb() = auto | user | {user, integer()} <optional>]]></c></tag>
+ <tag><marker id="manager_irb"></marker>
+ <c><![CDATA[manager_irb() = auto | user | {user, integer()} <optional>]]></c></tag>
<item>
<p>This option defines how the manager will handle the sending of
response (acknowledgment) to received inform-requests. </p>
@@ -558,16 +703,16 @@
<p>Default is <c>auto</c>.</p>
</item>
- <marker id="manager_mibs"></marker>
- <tag><c><![CDATA[manager_mibs() = [string()] <optional>]]></c></tag>
+ <tag><marker id="manager_mibs"></marker>
+ <c><![CDATA[manager_mibs() = [string()] <optional>]]></c></tag>
<item>
<p>Specifies a list of MIBs (including path) and defines which MIBs
are initially loaded into the SNMP manager. </p>
<p>Default is <c>[]</c>.</p>
</item>
- <marker id="manager_net_if"></marker>
- <tag><c><![CDATA[manager_net_if() = [manager_net_if_opt()] <optional>]]></c></tag>
+ <tag><marker id="manager_net_if"></marker>
+ <c><![CDATA[manager_net_if() = [manager_net_if_opt()] <optional>]]></c></tag>
<item>
<p><c>manager_net_if_opt() = {module, manager_net_if_module()} |
{verbosity, verbosity()} |
@@ -577,8 +722,8 @@
<p>For defaults see the options in <c>manager_net_if_opt()</c>.</p>
</item>
- <marker id="manager_ni_opts"></marker>
- <tag><c><![CDATA[manager_net_if_options() = [manager_net_if_option()] <optional>]]></c></tag>
+ <tag><marker id="manager_ni_opts"></marker>
+ <c><![CDATA[manager_net_if_options() = [manager_net_if_option()] <optional>]]></c></tag>
<item>
<p><c>manager_net_if_option() = {bind_to, bind_to()} |
{sndbuf, sndbuf()} |
@@ -591,8 +736,8 @@
<p>For defaults see the options in <c>manager_net_if_option()</c>.</p>
</item>
- <marker id="manager_ni_module"></marker>
- <tag><c><![CDATA[manager_net_if_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="manager_ni_module"></marker>
+ <c><![CDATA[manager_net_if_module() = atom() <optional>]]></c></tag>
<item>
<p>The module which handles the network interface part for the
SNMP manager. It must implement the
@@ -600,8 +745,8 @@
<p>Default is <c>snmpm_net_if</c>. </p>
</item>
- <marker id="manager_ni_filter_opts"></marker>
- <tag><c><![CDATA[manager_net_if_filter_options() = [manager_net_if_filter_option()] <optional>]]></c></tag>
+ <tag><marker id="manager_ni_filter_opts"></marker>
+ <c><![CDATA[manager_net_if_filter_options() = [manager_net_if_filter_option()] <optional>]]></c></tag>
<item>
<p><c>manager_net_if_filter_option() = {module, manager_net_if_filter_module()}</c></p>
<p>These options are actually specific to the used module.
@@ -611,8 +756,8 @@
<c>manager_net_if_filter_option()</c>.</p>
</item>
- <marker id="manager_ni_filter_module"></marker>
- <tag><c><![CDATA[manager_net_if_filter_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="manager_ni_filter_module"></marker>
+ <c><![CDATA[manager_net_if_filter_module() = atom() <optional>]]></c></tag>
<item>
<p>Module which handles the network interface filter part for the
SNMP manager. Must implement the
@@ -620,16 +765,16 @@
<p>Default is <c>snmpm_net_if_filter</c>.</p>
</item>
- <marker id="manager_def_user_module"></marker>
- <tag><c><![CDATA[def_user_module() = atom() <optional>]]></c></tag>
+ <tag><marker id="manager_def_user_module"></marker>
+ <c><![CDATA[def_user_module() = atom() <optional>]]></c></tag>
<item>
<p>The module implementing the default user. See the
<seealso marker="snmpm_user">snmpm_user</seealso> behaviour.</p>
<p>Default is <c>snmpm_user_default</c>.</p>
</item>
- <marker id="manager_def_user_data"></marker>
- <tag><c><![CDATA[def_user_data() = term() <optional>]]></c></tag>
+ <tag><marker id="manager_def_user_data"></marker>
+ <c><![CDATA[def_user_data() = term() <optional>]]></c></tag>
<item>
<p>Data for the default user. Passed to the user when calling
the callback functions.</p>
@@ -640,8 +785,8 @@
<marker id="common_types"></marker>
<p>Common config types:</p>
<taglist>
- <marker id="restart_type"></marker>
- <tag><c>restart_type() = permanent | transient | temporary</c></tag>
+ <tag><marker id="restart_type"></marker>
+ <c>restart_type() = permanent | transient | temporary</c></tag>
<item>
<p>See <seealso marker="stdlib:supervisor#child_spec">supervisor</seealso>
documentation for more info.</p>
@@ -649,41 +794,44 @@
for the manager.</p>
</item>
- <marker id="db_init_error"></marker>
- <tag><c>db_init_error() = terminate | create</c></tag>
+ <tag><marker id="db_init_error"></marker>
+ <c>db_init_error() = terminate | create | create_db_and_dir</c></tag>
<item>
<p>Defines what to do if the agent is unable to open an
existing database file. <c>terminate</c> means that the
- agent/manager will terminate and <c>create</c> means that the
- agent/manager will remove the faulty file(s) and create new ones.</p>
+ agent/manager will terminate, <c>create</c> means that the
+ agent/manager will remove the faulty file(s) and create new ones,
+ and <c>create_db_and_dir</c> means that the agent/manager will
+ create the database file along with any missing parent directories
+ for the database file.</p>
<p>Default is <c>terminate</c>.</p>
</item>
- <marker id="prio"></marker>
- <tag><c><![CDATA[priority() = atom() <optional>]]></c></tag>
+ <tag><marker id="prio"></marker>
+ <c><![CDATA[priority() = atom() <optional>]]></c></tag>
<item>
<p>Defines the Erlang priority for all SNMP processes.</p>
<p>Default is <c>normal</c>.</p>
</item>
- <marker id="versions"></marker>
- <tag><c><![CDATA[versions() = [version()] <optional>]]></c></tag>
+ <tag><marker id="versions"></marker>
+ <c><![CDATA[versions() = [version()] <optional>]]></c></tag>
<item>
<p><c>version() = v1 | v2 | v3</c></p>
<p>Which SNMP versions shall be accepted/used.</p>
<p>Default is <c>[v1,v2,v3]</c>.</p>
</item>
- <marker id="verbosity"></marker>
- <tag><c><![CDATA[verbosity() = silence | info | log | debug | trace <optional>]]></c></tag>
+ <tag><marker id="verbosity"></marker>
+ <c><![CDATA[verbosity() = silence | info | log | debug | trace <optional>]]></c></tag>
<item>
<p>Verbosity for a SNMP process. This specifies now much debug info
is printed.</p>
<p>Default is <c>silence</c>.</p>
</item>
- <marker id="bind_to"></marker>
- <tag><c><![CDATA[bind_to() = bool() <optional>]]></c></tag>
+ <tag><marker id="bind_to"></marker>
+ <c><![CDATA[bind_to() = bool() <optional>]]></c></tag>
<item>
<p>If <c>true</c>, net_if binds to the IP address.
If <c>false</c>, net_if listens on any IP address on the host
@@ -691,8 +839,8 @@
<p>Default is <c>false</c>.</p>
</item>
- <marker id="no_reuse"></marker>
- <tag><c><![CDATA[no_reuse() = bool() <optional>]]></c></tag>
+ <tag><marker id="no_reuse"></marker>
+ <c><![CDATA[no_reuse() = bool() <optional>]]></c></tag>
<item>
<p>If <c>true</c>, net_if does not specify that the IP
and port address should be reusable. If <c>false</c>,
@@ -700,30 +848,30 @@
<p>Default is <c>false</c>.</p>
</item>
- <marker id="recbuf"></marker>
- <tag><c><![CDATA[recbuf() = integer() <optional>]]></c></tag>
+ <tag><marker id="recbuf"></marker>
+ <c><![CDATA[recbuf() = integer() <optional>]]></c></tag>
<item>
<p>Receive buffer size. </p>
<p>Default value is defined by <c>gen_udp</c>.</p>
</item>
- <marker id="sndbuf"></marker>
- <tag><c><![CDATA[sndbuf() = integer() <optional>]]></c></tag>
+ <tag><marker id="sndbuf"></marker>
+ <c><![CDATA[sndbuf() = integer() <optional>]]></c></tag>
<item>
<p>Send buffer size. </p>
<p>Default value is defined by <c>gen_udp</c>.</p>
</item>
- <marker id="note_store"></marker>
- <tag><c><![CDATA[note_store() = [note_store_opt()] <optional>]]></c></tag>
+ <tag><marker id="note_store"></marker>
+ <c><![CDATA[note_store() = [note_store_opt()] <optional>]]></c></tag>
<item>
<p><c>note_store_opt() = {timeout, note_store_timeout()} | {verbosity, verbosity()}</c></p>
<p>Specifies the options for the SNMP note store.</p>
<p>For defaults see the options in <c>note_store_opt()</c>.</p>
</item>
- <marker id="ns_timeout"></marker>
- <tag><c><![CDATA[note_store_timeout() = integer() <optional>]]></c></tag>
+ <tag><marker id="ns_timeout"></marker>
+ <c><![CDATA[note_store_timeout() = integer() <optional>]]></c></tag>
<item>
<p>Note cleanup time. When storing a note in the note store,
each note is given lifetime. Every <c>timeout</c> the note_store
@@ -732,8 +880,8 @@
<p>Default is <c>30000</c>.</p>
</item>
- <marker id="audit_trail_log"></marker>
- <tag><c><![CDATA[audit_trail_log() [audit_trail_log_opt()] <optional>]]></c></tag>
+ <tag><marker id="audit_trail_log"></marker>
+ <c><![CDATA[audit_trail_log() [audit_trail_log_opt()] <optional>]]></c></tag>
<item>
<p><c>audit_trail_log_opt() = {type, atl_type()} | {dir, atl_dir()} | {size, atl_size()} | {repair, atl_repair()} | {seqno, atl_seqno()}</c></p>
<p>If present, this option specifies the options for the
@@ -743,8 +891,8 @@
<p>If not present, audit trail logging is not used.</p>
</item>
- <marker id="atl_type"></marker>
- <tag><c><![CDATA[atl_type() = read | write | read_write <optional>]]></c></tag>
+ <tag><marker id="atl_type"></marker>
+ <c><![CDATA[atl_type() = read | write | read_write <optional>]]></c></tag>
<item>
<p>Specifies what type of an audit trail log should be used.
The effect of the type is actually different for the the agent
@@ -765,16 +913,16 @@
<p>Default is <c>read_write</c>.</p>
</item>
- <marker id="atl_dir"></marker>
- <tag><c><![CDATA[atl_dir = dir() <mandatory>]]></c></tag>
+ <tag><marker id="atl_dir"></marker>
+ <c><![CDATA[atl_dir = dir() <mandatory>]]></c></tag>
<item>
<p>Specifies where the audit trail log should be stored.</p>
<p>If <c>audit_trail_log</c> specifies that logging should take
place, this parameter <em>must</em> be defined.</p>
</item>
- <marker id="atl_size"></marker>
- <tag><c><![CDATA[atl_size() = {integer(), integer()} <mandatory>]]></c></tag>
+ <tag><marker id="atl_size"></marker>
+ <c><![CDATA[atl_size() = {integer(), integer()} <mandatory>]]></c></tag>
<item>
<p>Specifies the size of the audit
trail log. This parameter is sent to <c>disk_log</c>. </p>
@@ -782,8 +930,8 @@
take place, this parameter <em>must</em> be defined.</p>
</item>
- <marker id="atl_repair"></marker>
- <tag><c><![CDATA[atl_repair() = true | false | truncate | snmp_repair <optional>]]></c></tag>
+ <tag><marker id="atl_repair"></marker>
+ <c><![CDATA[atl_repair() = true | false | truncate | snmp_repair <optional>]]></c></tag>
<item>
<p>Specifies if and how the audit trail log shall be repaired
when opened. Unless this parameter has the value <c>snmp_repair</c>
@@ -795,8 +943,8 @@
<p>Default is <c>true</c>.</p>
</item>
- <marker id="atl_seqno"></marker>
- <tag><c><![CDATA[atl_seqno() = true | false <optional>]]></c></tag>
+ <tag><marker id="atl_seqno"></marker>
+ <c><![CDATA[atl_seqno() = true | false <optional>]]></c></tag>
<item>
<p>Specifies if the audit trail log entries will be (sequence)
numbered or not. The range of the sequence numbers are according
diff --git a/lib/snmp/doc/src/snmp_def_instr_functions.xml b/lib/snmp/doc/src/snmp_def_instr_functions.xml
index f88469aeae..3445648de2 100644
--- a/lib/snmp/doc/src/snmp_def_instr_functions.xml
+++ b/lib/snmp/doc/src/snmp_def_instr_functions.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_framework_mib.xml b/lib/snmp/doc/src/snmp_framework_mib.xml
index 38fb531d3e..64e5df6ff5 100644
--- a/lib/snmp/doc/src/snmp_framework_mib.xml
+++ b/lib/snmp/doc/src/snmp_framework_mib.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1999</year><year>2009</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_generic.xml b/lib/snmp/doc/src/snmp_generic.xml
index 79a22323d9..44762dec59 100644
--- a/lib/snmp/doc/src/snmp_generic.xml
+++ b/lib/snmp/doc/src/snmp_generic.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1996</year><year>2012</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_impl_example_agent.xml b/lib/snmp/doc/src/snmp_impl_example_agent.xml
index 3bba6467ed..a86006a0a7 100644
--- a/lib/snmp/doc/src/snmp_impl_example_agent.xml
+++ b/lib/snmp/doc/src/snmp_impl_example_agent.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_impl_example_manager.xml b/lib/snmp/doc/src/snmp_impl_example_manager.xml
index edc1f3998e..aca8d43c95 100644
--- a/lib/snmp/doc/src/snmp_impl_example_manager.xml
+++ b/lib/snmp/doc/src/snmp_impl_example_manager.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2006</year><year>2009</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_index.xml b/lib/snmp/doc/src/snmp_index.xml
index cd241820e8..646e9661a3 100644
--- a/lib/snmp/doc/src/snmp_index.xml
+++ b/lib/snmp/doc/src/snmp_index.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_instr_functions.xml b/lib/snmp/doc/src/snmp_instr_functions.xml
index 32a1844554..38512b72d0 100644
--- a/lib/snmp/doc/src/snmp_instr_functions.xml
+++ b/lib/snmp/doc/src/snmp_instr_functions.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_intro.xml b/lib/snmp/doc/src/snmp_intro.xml
index b01bfdd88f..ec3f2af956 100644
--- a/lib/snmp/doc/src/snmp_intro.xml
+++ b/lib/snmp/doc/src/snmp_intro.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_manager_config_files.xml b/lib/snmp/doc/src/snmp_manager_config_files.xml
index c2ef3cd2c7..c7c423f5eb 100644
--- a/lib/snmp/doc/src/snmp_manager_config_files.xml
+++ b/lib/snmp/doc/src/snmp_manager_config_files.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -64,13 +65,42 @@
<item>
<p><c>Variable</c> is one of the following:</p>
<list type="bulleted">
- <item>
- <p><c>address</c> - which defines the IP address of the
- manager. Default is local host.</p>
- </item>
+ <item>
+ <p><c>transports</c> - which defines the transport domains
+ and their addresses for the manager. <em>Mandatory</em>
+ </p>
+ <p><c>Value</c> is a list of <c>{Domain, Addr}</c> tuples
+ or <c>Domain</c> atoms.
+ </p>
+ <list type="bulleted">
+ <item>
+ <p><c>Domain</c> is one of <c>transportDomainUdpIpv4</c>
+ or <c>transportDomainUdpIpv6</c>.</p>
+ </item>
+ <item>
+ <p><c>Addr</c> is for the currently supported domains
+ either an <c>IpAddr</c> or an <c>{IpAddr, IpPort}</c>
+ tuple.<c>IpAddr</c> is either a regular Erlang/OTP
+ <seealso marker="kernel:inet#type-ip_address">
+ <c>ip_address()</c></seealso> or a traditional SNMP integer list
+ and <c>IpPort</c> is an integer.
+ </p>
+ <p>When <c>Addr</c> does not contain a port number,
+ the value of <c>port</c> is used.
+ </p>
+ <p>When a <c>Addr</c> is not specified i.e by
+ using only a <c>Domain</c> atom, the host's name
+ is resolved to find the IP address, and the value of
+ <c>port</c> is used.
+ </p>
+ </item>
+ </list>
+ </item>
<item>
<p><c>port</c> - which defines which UDP port the manager uses
- for communicating with agents. <em>Mandatory</em>.</p>
+ for communicating with agents.
+ <em>Mandatory</em> if <c>transports</c> does not define
+ a port number for every transport.</p>
</item>
<item>
<p><c>engine_id</c> - The <c>SnmpEngineID</c> as defined in
@@ -87,11 +117,13 @@
</p>
</item>
</list>
+ <p>The legacy and intermediate variables <c>address</c> and <c>domain</c>
+ are still supported so old configurations will work.</p>
<p>The following example shows a <c>manager.conf</c> file:
</p>
<pre>
-{address, [141,213,11,24]}.
-{port, 5000}.
+{transports, [{transportDomainUdpIpv4, {{141,213,11,24}, 5000}},
+ {transportDomainUdpIpv6, {{0,0,0,0,0,0,0,1}, 5000}}]}.
{engine_id, "mgrEngine"}.
{max_message_size, 484}.
</pre>
@@ -146,7 +178,7 @@
</p>
<p>Each entry is a tuple:
</p>
- <p><c>{UserId, TargetName, Comm, Ip, Port, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel}.</c></p>
+ <p><c>{UserId, TargetName, Comm, Domain, Addr, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel}.</c></p>
<list type="bulleted">
<item>
<p><c>UserId</c> is the identity of the <em>manager user</em>
@@ -160,10 +192,17 @@
<p><c>Comm</c> is the community string (string).</p>
</item>
<item>
- <p><c>Ip</c> is the ip address of the agent (a list of four integers).</p>
+ <p><c>Domain</c> is the transport domain, either
+ <c>transportDomainUdpIpv4</c> or <c>transportDomainUdpIpv6</c>.</p>
</item>
<item>
- <p><c>Port</c> is the port number of the agent (integer).</p>
+ <p><c>Addr</c> is the address in the transport domain,
+ either an <c>{IpAddr, IpPort}</c> tuple or a traditional SNMP
+ integer list containing port number. <c>IpAddr</c> is either
+ a regular Erlang/OTP
+ <seealso marker="kernel:inet#type-ip_address"><c>ip_address()</c></seealso>
+ or a traditional SNMP integer list not containing port number,
+ and <c>IpPort</c> is an integer.</p>
</item>
<item>
<p><c>EngineID</c> is the engine-id of the agent (string).</p>
@@ -190,6 +229,9 @@
authPriv).</p>
</item>
</list>
+ <p>Legacy configurations using tuples without <c>Domain</c> element,
+ as well as with all <c>TDomain</c>, <c>Ip</c> and <c>Port</c> elements
+ still work.</p>
</section>
<section>
diff --git a/lib/snmp/doc/src/snmp_manager_funct_descr.xml b/lib/snmp/doc/src/snmp_manager_funct_descr.xml
index db4ab9bf15..b2da01ae32 100644
--- a/lib/snmp/doc/src/snmp_manager_funct_descr.xml
+++ b/lib/snmp/doc/src/snmp_manager_funct_descr.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_manager_netif.xml b/lib/snmp/doc/src/snmp_manager_netif.xml
index 169e20d10b..0dcf2a0255 100644
--- a/lib/snmp/doc/src/snmp_manager_netif.xml
+++ b/lib/snmp/doc/src/snmp_manager_netif.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2004</year><year>2012</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -50,13 +51,14 @@
<p>The snmp application provides two different modules,
<c>snmpm_net_if</c> (the default) and <c>snmpm_net_if_mt</c>,
- both uses the UDP as the transport protocol. The difference
- between the two modules is that the latter is "multi-threaded",
- i.e. for each message/request a new process is created that
- process the message/request and then exits. </p>
+ both uses UDP as the transport protocol i.e the transport domains
+ <c>transportDomainUdpIpv4</c> and/or <c>transportDomainUdpIpv6</c>.
+ The difference between the two modules is that the latter is
+ "multi-threaded", i.e. for each message/request a new process
+ is created that processes the message/request and then exits. </p>
- <p>It is also possible to write your own Net if process,
- this section describes how to write a Net if processdo that.</p>
+ <p>It is also possible to write your own Net if process and
+ this section describes how to do that.</p>
<section>
<marker id="mandatory_functions"></marker>
@@ -70,11 +72,16 @@
<p>The section <em>Messages</em> describes mandatory messages, which
Net if must send to the manager server process.
</p>
+ <p>In this section a <c>Domain</c> field is the transport domain i.e
+ one of <c>transportDomainUdpIpv4</c> or <c>transportDomainUdpIpv6</c>,
+ and an <c>Addr</c> field is an
+ <c>{</c><seealso marker="kernel:inet#type-ip_address"><c>IpAddr</c></seealso><c>,IpPort}</c> tuple.</p>
+
<p>Net if must send the following message when it receives an
SNMP PDU from the network that is aimed for the MasterAgent:
</p>
<pre>
-Server ! {snmp_pdu, Pdu, Addr, Port}
+Server ! {snmp_pdu, Pdu, Domain, Addr}
</pre>
<list type="bulleted">
<item>
@@ -82,14 +89,14 @@ Server ! {snmp_pdu, Pdu, Addr, Port}
<c>snmp_types.hrl</c>, with the SNMP request.</p>
</item>
<item>
- <p><c>Addr</c> is the source address. </p>
+ <p><c>Domain</c> is the source transport domain. </p>
</item>
<item>
- <p><c>Port</c> is port number of the sender.</p>
+ <p><c>Addr</c> is the source address. </p>
</item>
</list>
<pre>
-Server ! {snmp_trap, Trap, Addr, Port}
+Server ! {snmp_trap, Trap, Domain, Addr}
</pre>
<list type="bulleted">
<item>
@@ -97,14 +104,14 @@ Server ! {snmp_trap, Trap, Addr, Port}
as defined in <c>snmp_types.hrl</c>, with the SNMP request.</p>
</item>
<item>
- <p><c>Addr</c> is the source address. </p>
+ <p><c>Domain</c> is the source transport domain. </p>
</item>
<item>
- <p><c>Port</c> is port number of the sender.</p>
+ <p><c>Addr</c> is the source address. </p>
</item>
</list>
<pre>
-Server ! {snmp_inform, Ref, Pdu, PduMS, Addr, Port}
+Server ! {snmp_inform, Ref, Pdu, PduMS, Domain, Addr}
</pre>
<list type="bulleted">
<item>
@@ -123,14 +130,14 @@ Server ! {snmp_inform, Ref, Pdu, PduMS, Addr, Port}
<c>snmp_types.hrl</c>, with the SNMP request.</p>
</item>
<item>
- <p><c>Addr</c> is the source address. </p>
+ <p><c>Domain</c> is the source transport domain. </p>
</item>
<item>
- <p><c>Port</c> is port number of the sender.</p>
+ <p><c>Addr</c> is the source address. </p>
</item>
</list>
<pre>
-Server ! {snmp_report, Data, Addr, Port}
+Server ! {snmp_report, Data, Domain, Addr}
</pre>
<list type="bulleted">
<item>
@@ -152,10 +159,10 @@ Server ! {snmp_report, Data, Addr, Port}
<p><c>ReasonInfo</c> is a term().</p>
</item>
<item>
- <p><c>Addr</c> is the source address. </p>
+ <p><c>Domain</c> is the source transport domain. </p>
</item>
<item>
- <p><c>Port</c> is port number of the sender.</p>
+ <p><c>Addr</c> is the source address. </p>
</item>
</list>
diff --git a/lib/snmp/doc/src/snmp_manager_netif_1.ps b/lib/snmp/doc/src/snmp_manager_netif_1.ps
deleted file mode 100644
index 913997d0bd..0000000000
--- a/lib/snmp/doc/src/snmp_manager_netif_1.ps
+++ /dev/null
@@ -1,305 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: GIMP PostScript file plugin V 1.16 by Peter Kirchgessner
-%%Title: /usr/local/ccase/vws/bmk/bmk_app_dev_snap/clearcase/otp/libraries/snmp/doc/src/snmp_manager_netif_1.ps
-%%CreationDate: Mon Jul 19 16:24:48 2004
-%%DocumentData: Clean7Bit
-%%LanguageLevel: 2
-%%Pages: 1
-%%BoundingBox: 14 14 453 74
-%%EndComments
-%%BeginProlog
-% Use own dictionary to avoid conflicts
-10 dict begin
-%%EndProlog
-%%Page: 1 1
-% Translate for offset
-14.173228346456694 14.173228346456694 translate
-% Translate to begin of first scanline
-0 59 translate
-438 -59 scale
-% Image geometry
-438 59 8
-% Transformation matrix
-[ 438 0 0 59 0 0 ]
-% Strings to hold RGB-samples per scanline
-/rstr 438 string def
-/gstr 438 string def
-/bstr 438 string def
-{currentfile /ASCII85Decode filter /RunLengthDecode filter rstr readstring pop}
-{currentfile /ASCII85Decode filter /RunLengthDecode filter gstr readstring pop}
-{currentfile /ASCII85Decode filter /RunLengthDecode filter bstr readstring pop}
-true 3
-%%BeginData: 13832 ASCII Bytes
-colorimage
-Jc:6"Jc>WIoDm\GJ,~>
-Jc:6"Jc>WIoDm\GJ,~>
-Jc:6"Jc>WIoDm\GJ,~>
-Jc:6"L&UlJo`"XdjSjZ~>
-Jc:6"L&UlJo`"XdjSjZ~>
-Jc:6"L&UlJo`"XdjSjZ~>
-Jc<Iap],mEdf04GjSo,YkPfu~>
-Jc<Iap],mEdf04GjSo,YkPfu~>
-Jc<Iap],mEdf04GjSo,YkPfu~>
-Jc<[gqZ-EjquD<Ig&D!OhZ!NTl2H2~>
-Jc<[gqZ-EjquD<Ig&D!OhZ!NTl2H2~>
-Jc<[gqZ-EjquD<Ig&D!OhZ!NTl2H2~>
-Jc<airrDHcrr@WLhZ!KSgA_'Om/DM~>
-Jc<airrDHcrr@WLhZ!KSgA_'Om/DM~>
-Jc<airrDHcrr@WLhZ!KSgA_'Om/DM~>
-mf*1cJc=U,rrD<_rr@WLir8rXeGfIJmf%_~>
-mf*1cJc=U,rrD<_rr@WLir8rXeGfIJmf%_~>
-mf*1cJc=U,rrD<_rr@WLir8rXeGfIJmf%_~>
-nc&Lfrr2lsJc=d1rrD0[rr@WLjo,5[d/O%FnG[q~>
-nc&Lfrr2lsJc=d1rrD0[rr@WLjo,5[d/O%FnG[q~>
-nc&Lfrr2lsJc=d1rrD0[rr@WLjo,5[d/O%FnG[q~>
-o)8Uhq#:9nJc=p5rrD$Wrr@WLl2L\_c2I\Cnc"%~>
-o)8Uhq#:9nJc=p5rrD$Wrr@WLl2L\_c2I\Cnc"%~>
-o)8Uhq#:9nJc=p5rrD$Wrr@WLl2L\_c2I\Cnc"%~>
-oDS^ip&=skJc>$8!!(jSrr@WLm/?tbb5VD@oDX7~>
-oDS^ip&=skJc>$8!!(jSrr@WLm/?tbb5VD@oDX7~>
-oDS^ip&=skJc>$8!!(jSrr@WLm/?tbb5VD@oDX7~>
-o_ngjo)8UhnG`=cK`1rOgAV'PJc>*:!!((=!!)ZjJ,~>
-o_ngjo)8UhnG`=cK`1rOgAV'PJc>*:!!((=!!)ZjJ,~>
-o_ngjo)8UhnG`=cK`1rOgAV'PJc>*:!!((=!!)ZjJ,~>
-o_ngjnbrLgoD\air;Q]rM#RDSf_tjNJc>3=rrC%;rrDclJ,~>
-o_ngjnbrLgoD\air;Q]rM#RDSf_tjNJc>3=rrC%;rrDclJ,~>
-o_ngjnbrLgoD\air;Q]rM#RDSf_tjNJc>3=rrC%;rrDclJ,~>
-p&4pkn,<:ep&4pkq#:9nMuE\Vec,RKJc><@!!'k7!!)cmJ,~>
-p&4pkn,<:ep&4pkq#:9nMuE\Vec,RKJc><@!!'k7!!)cmJ,~>
-p&4pkn,<:ep&4pkq#:9nMuE\Vec,RKJc><@!!'k7!!)cmJ,~>
-p&4pkmf!1dpAP$lpAP$lNW&nXdf'4HJc>BB!!'e5!!)fnJ,~>
-p&4pkmf!1dpAP$lpAP$lNW&nXdf'4HJc>BB!!'e5!!)fnJ,~>
-p&4pkmf!1dpAP$lpAP$lNW&nXdf'4HJc>BB!!'e5!!)fnJ,~>
-pAP$lm/?tbq#16no_ngjO8]+Zd/F"FJc>EC!!'b4!!)ioJ,~>
-pAP$lm/?tbq#16no_ngjO8]+Zd/F"FJc>EC!!'b4!!)ioJ,~>
-pAP$lm/?tbq#16no_ngjO8]+Zd/F"FJc>EC!!'b4!!)ioJ,~>
-pAP$lli$kaqYgHpo)8UhOT#4[d/F"FJc>HD!!'_3!!)ioJ,~>
-pAP$lli$kaqYgHpo)8UhOT#4[d/F"FJc>HD!!'_3!!)ioJ,~>
-pAP$lli$kaqYgHpo)8UhOT#4[d/F"FJc>HD!!'_3!!)ioJ,~>
-rVlcrrVccslM^b`rVlfsnGWCfP5YF]cMdeDJc>NF!!'Y1!!)lpJ,~>
-rVlcrrVccslM^b`rVlfsnGWCfP5YF]cMdeDJc>NF!!'Y1!!)lpJ,~>
-rVlcrrVccslM^b`rVlfsnGWCfP5YF]cMdeDJc>NF!!'Y1!!)lpJ,~>
-s8N#urr2cplMg_^mJ[(cq>UBoh>RZ=>6&GS>;DuLrW2"He,B=IcMdeDJc>QG!!'S/!!)oqJ,~>
-s8N#urr2cplMg_^mJ[(cq>UBoh>RZ=>6&GS>;DuLrW2"He,B=IcMdeDJc>QG!!'S/!!)oqJ,~>
-s8N#urr2cplMg_^mJ[(cq>UBoh>RZ=>6&GS>;DuLrW2"He,B=IcMdeDJc>QG!!'S/!!)oqJ,~>
-s8DuuqYpKpd/Nh@s8N#uhYmQ)!<2ruUC?tt!TFO;rVurBrVur\rW-4'rG)Boqu-V#'BK,t10[sW
-!*`Y_bPhJA\GcI.r;M3~>
-s8DuuqYpKpd/Nh@s8N#uhYmQ)!<2ruUC?tt!TFO;rVurBrVur\rW-4'rG)Boqu-V#'BK,t10[sW
-!*`Y_bPhJA\GcI.r;M3~>
-s8DuuqYpKpd/Nh@s8N#uhYmQ)!<2ruUC?tt!TFO;rVurBrVur\rW-4'rG)Boqu-V#'BK,t10[sW
-!*`Y_bPhJA\GcI.r;M3~>
-s8Duu]D_d1hu3Z*!<2s9N%=lX)h\,o1<`r&COQ3A>AJ"Qir6enFA6l;rVurBrVur\rW1IJrVce4
-qu-WU'BK,t;uZdF!<2srbl.SB\,H@-r;M3~>
-s8Duu]D_d1hu3Z*!<2s9N%=lX)h\,o1<`r&COQ3A>AJ"Qir6enFA6l;rVurBrVur\rW1IJrVce4
-qu-WU'BK,t;uZdF!<2srbl.SB\,H@-r;M3~>
-s8Duu]D_d1hu3Z*!<2s9N%=lX)h\,o1<`r&COQ3A>AJ"Qir6enFA6l;rVurBrVur\rW1IJrVce4
-qu-WU'BK,t;uZdF!<2srbl.SB\,H@-r;M3~>
-!WE)0rVurVrXdNYCNMs"lMeX#lMcaZrnS7erX16grr/?Ir]7[jr^>iH!!(1@!!)3]!Rh&JrWuO&
-r]1^O3\02'rr*XbFDF:Frr+qlN'nnkrr0M[@WVTcN;EMSdfB@G)rb(;CK'4R'9"t&r]1^O6mK'k
-6mK)<_GbPNFR&i*!4De+!<)nI~>
-!WE)0rVurVrXdNYCNMs"lMeX#lMcaZrnS7erX16grr/?Ir]7[jr^>iH!!(1@!!)3]!Rh&JrWuO&
-r]1^O3\02'rr*XbFDF:Frr+qlN'nnkrr0M[@WVTcN;EMSdfB@G)rb(;CK'4R'9"t&r]1^O6mK'k
-6mK)<_GbPNFR&i*!4De+!<)nI~>
-!WE)0rVurVrXdNYCNMs"lMeX#lMcaZrnS7erX16grr/?Ir]7[jr^>iH!!(1@!!)3]!Rh&JrWuO&
-r]1^O3\02'rr*XbFDF:Frr+qlN'nnkrr0M[@WVTcN;EMSdfB@G)rb(;CK'4R'9"t&r]1^O6mK'k
-6mK)<_GbPNFR&i*!4De+!<)nI~>
-!WE)/rVurWrW1IJrr*dN3r]+HKDngKrnS"^rmLj_CNO#HrerUrbiA[&!6Y9@!9a=kdf<<N;_n@O
-iW.4%:#Zi`rXd:(rr1mW_Z$nerr*S<rhC/%rW1IJrVd`d]Dheu3oU.`r_<CO!5e`B%)W"N/,hTA
-rr,=NrVur+rVursrdX~>
-!WE)/rVurWrW1IJrr*dN3r]+HKDngKrnS"^rmLj_CNO#HrerUrbiA[&!6Y9@!9a=kdf<<N;_n@O
-iW.4%:#Zi`rXd:(rr1mW_Z$nerr*S<rhC/%rW1IJrVd`d]Dheu3oU.`r_<CO!5e`B%)W"N/,hTA
-rr,=NrVur+rVursrdX~>
-!WE)/rVurWrW1IJrr*dN3r]+HKDngKrnS"^rmLj_CNO#HrerUrbiA[&!6Y9@!9a=kdf<<N;_n@O
-iW.4%:#Zi`rXd:(rr1mW_Z$nerr*S<rhC/%rW1IJrVd`d]Dheu3oU.`r_<CO!5e`B%)W"N/,hTA
-rr,=NrVur+rVursrdX~>
-!WE)/rVurWrW1IJrr*J@!;$3,)o@7,ro+@crmLl4qu-]WRQ=C.rVur?rVur^rW1IJrr*%Qrr1mc
-rr)rX'E7tE]3A`K'E8!j%0$7^'E6G\oD[2Iq#1<C!<2s'df=0!FCI;j%/p/8iXGhch$j;^h%TdH
-/!J3ArVur+rVursrdX~>
-!WE)/rVurWrW1IJrr*J@!;$3,)o@7,ro+@crmLl4qu-]WRQ=C.rVur?rVur^rW1IJrr*%Qrr1mc
-rr)rX'E7tE]3A`K'E8!j%0$7^'E6G\oD[2Iq#1<C!<2s'df=0!FCI;j%/p/8iXGhch$j;^h%TdH
-/!J3ArVur+rVursrdX~>
-!WE)/rVurWrW1IJrr*J@!;$3,)o@7,ro+@crmLl4qu-]WRQ=C.rVur?rVur^rW1IJrr*%Qrr1mc
-rr)rX'E7tE]3A`K'E8!j%0$7^'E6G\oD[2Iq#1<C!<2s'df=0!FCI;j%/p/8iXGhch$j;^h%TdH
-/!J3ArVur+rVursrdX~>
-!WE).rVurdrVurlrW1IJrr)qW)ufgO3[<Y`rospk3rUXurr1A@r^?bbdi8#[rrDWh!!(+>!!)6^
-!Rh&GrW2!lrr*bo'E8!r!7Ur,'E8!j'E8!e%0"]UlMfTJq#1<C!<2s!dfA\3rW2!lrVd>e'E8!e%
-0$7^%0$7cUH2?>rVur)rVurtrdX~>
-!WE).rVurdrVurlrW1IJrr)qW)ufgO3[<Y`rospk3rUXurr1A@r^?bbdi8#[rrDWh!!(+>!!)6^
-!Rh&GrW2!lrr*bo'E8!r!7Ur,'E8!j'E8!e%0"]UlMfTJq#1<C!<2s!dfA\3rW2!lrVd>e'E8!e%
-0$7^%0$7cUH2?>rVur)rVurtrdX~>
-!WE).rVurdrVurlrW1IJrr)qW)ufgO3[<Y`rospk3rUXurr1A@r^?bbdi8#[rrDWh!!(+>!!)6^
-!Rh&GrW2!lrr*bo'E8!r!7Ur,'E8!j'E8!e%0"]UlMfTJq#1<C!<2s!dfA\3rW2!lrVd>e'E8!e%
-0$7^%0$7cUH2?>rVur)rVurtrdX~>
-!WE).rVurfrr)olrWhFe!,H@S7*PZ0!P;;/rXV_4N;hg8@WYi>rcCkM9rn!erW)Qh!!)]k!c&Hb
-rr)t7)f,9K!THNErW1J/rr*"8@WZ)QrVurdrVurrrW1IJrVcn7ro+UjrYXW.rr1mWir6e.rr1mj
-rr1mcrr*SCrhBnsrW1IJrVd$PRf<<8:#ZibrX\!%rr1mcrr1^er_<CkbT$KZrrDWh!!'A)!!*#t
-J,~>
-!WE).rVurfrr)olrWhFe!,H@S7*PZ0!P;;/rXV_4N;hg8@WYi>rcCkM9rn!erW)Qh!!)]k!c&Hb
-rr)t7)f,9K!THNErW1J/rr*"8@WZ)QrVurdrVurrrW1IJrVcn7ro+UjrYXW.rr1mWir6e.rr1mj
-rr1mcrr*SCrhBnsrW1IJrVd$PRf<<8:#ZibrX\!%rr1mcrr1^er_<CkbT$KZrrDWh!!'A)!!*#t
-J,~>
-!WE).rVurfrr)olrWhFe!,H@S7*PZ0!P;;/rXV_4N;hg8@WYi>rcCkM9rn!erW)Qh!!)]k!c&Hb
-rr)t7)f,9K!THNErW1J/rr*"8@WZ)QrVurdrVurrrW1IJrVcn7ro+UjrYXW.rr1mWir6e.rr1mj
-rr1mcrr*SCrhBnsrW1IJrVd$PRf<<8:#ZibrX\!%rr1mcrr1^er_<CkbT$KZrrDWh!!'A)!!*#t
-J,~>
-!WE).rVurgrqui`rW/4iir8iUp&4pko_nnQ%&<h$!)<7f!TFOarWM'Vrosp`rVurfrr)oqrW,pt
-rG*K9raH:Oh>UjlC\.OX12C>-IK![aFT,JQFT/m&@Y5?irW?q?!6kHA)rae*FBe$>!,LEiraH:X
-r`]eQraH:OFA6OFX8Mtr!;$0i!;6<mCD0,6rW7]PCWcVV!<2tJ~>
-!WE).rVurgrqui`rW/4iir8iUp&4pko_nnQ%&<h$!)<7f!TFOarWM'Vrosp`rVurfrr)oqrW,pt
-rG*K9raH:Oh>UjlC\.OX12C>-IK![aFT,JQFT/m&@Y5?irW?q?!6kHA)rae*FBe$>!,LEiraH:X
-r`]eQraH:OFA6OFX8Mtr!;$0i!;6<mCD0,6rW7]PCWcVV!<2tJ~>
-!WE).rVurgrqui`rW/4iir8iUp&4pko_nnQ%&<h$!)<7f!TFOarWM'Vrosp`rVurfrr)oqrW,pt
-rG*K9raH:Oh>UjlC\.OX12C>-IK![aFT,JQFT/m&@Y5?irW?q?!6kHA)rae*FBe$>!,LEiraH:X
-r`]eQraH:OFA6OFX8Mtr!;$0i!;6<mCD0,6rW7]PCWcVV!<2tJ~>
-!WE)nrW6jKC]=;7CE%'brW2"HkPbKd'Cbu$!;$3e!:Kgf.q2uHrqc]hrVurjrY&#5%*\_M7/m2F
->AJ"Qiq$@SCOQ0\#@\AGraH:ON:d)L!:p-f!8RPWl2^,K]2R,VquHEh!!)Zj!]gb,rr)ua1'#Gq
-!!*#tJ,~>
-!WE)nrW6jKC]=;7CE%'brW2"HkPbKd'Cbu$!;$3e!:Kgf.q2uHrqc]hrVurjrY&#5%*\_M7/m2F
->AJ"Qiq$@SCOQ0\#@\AGraH:ON:d)L!:p-f!8RPWl2^,K]2R,VquHEh!!)Zj!]gb,rr)ua1'#Gq
-!!*#tJ,~>
-!WE)nrW6jKC]=;7CE%'brW2"HkPbKd'Cbu$!;$3e!:Kgf.q2uHrqc]hrVurjrY&#5%*\_M7/m2F
->AJ"Qiq$@SCOQ0\#@\AGraH:ON:d)L!:p-f!8RPWl2^,K]2R,VquHEh!!)Zj!]gb,rr)ua1'#Gq
-!!*#tJ,~>
-!WE)mrW5+hU]15m:&+\giXG#L!TFd^rVurjrqZW<rqQQirVurirXi*.K-T[\:&b,B]Dheu3r\+P
-qu-cY)ufir'Cu,&!;-9f!8IMQ3WaD=lI#V.!;HHm!;$0k7"$iirX`kG!<2tMFDF:Fr]1^O6mJc3
-rY^?1CIG6&rjs[iF9$*8ro.-tCK'4R'9"t&oDSdkrr.E~>
-!WE)mrW5+hU]15m:&+\giXG#L!TFd^rVurjrqZW<rqQQirVurirXi*.K-T[\:&b,B]Dheu3r\+P
-qu-cY)ufir'Cu,&!;-9f!8IMQ3WaD=lI#V.!;HHm!;$0k7"$iirX`kG!<2tMFDF:Fr]1^O6mJc3
-rY^?1CIG6&rjs[iF9$*8ro.-tCK'4R'9"t&oDSdkrr.E~>
-!WE)mrW5+hU]15m:&+\giXG#L!TFd^rVurjrqZW<rqQQirVurirXi*.K-T[\:&b,B]Dheu3r\+P
-qu-cY)ufir'Cu,&!;-9f!8IMQ3WaD=lI#V.!;HHm!;$0k7"$iirX`kG!<2tMFDF:Fr]1^O6mJc3
-rY^?1CIG6&rjs[iF9$*8ro.-tCK'4R'9"t&oDSdkrr.E~>
-!WE)mr\@3T%*\_M7/m2F>AJ"Qiq$@SCOK+pN;fS-ro-=?rr1nUCMRDN3YRH5/,nNArr,;@PP+nT
-!;?E&!;cZp!;$0r:&b,j:&[Q[dfBA_"CaFkh$j2["mQd#ro+U^rVurkrqZVlrqQQirVurirWl6`
-'=@bfCXW:]rWp^uro*pprj3pIrWp^urr*S<rhC/+rX(0frr/?IiW.4%:%S>c!<2tJ~>
-!WE)mr\@3T%*\_M7/m2F>AJ"Qiq$@SCOK+pN;fS-ro-=?rr1nUCMRDN3YRH5/,nNArr,;@PP+nT
-!;?E&!;cZp!;$0r:&b,j:&[Q[dfBA_"CaFkh$j2["mQd#ro+U^rVurkrqZVlrqQQirVurirWl6`
-'=@bfCXW:]rWp^uro*pprj3pIrWp^urr*S<rhC/+rX(0frr/?IiW.4%:%S>c!<2tJ~>
-!WE)mr\@3T%*\_M7/m2F>AJ"Qiq$@SCOK+pN;fS-ro-=?rr1nUCMRDN3YRH5/,nNArr,;@PP+nT
-!;?E&!;cZp!;$0r:&b,j:&[Q[dfBA_"CaFkh$j2["mQd#ro+U^rVurkrqZVlrqQQirVurirWl6`
-'=@bfCXW:]rWp^uro*pprj3pIrWp^urr*S<rhC/+rX(0frr/?IiW.4%:%S>c!<2tJ~>
-!!)]k0N7t',O58&rr+F[rr/?Iro+UjrppQXr`]f[raPKur[Y&KrdA#1!6kF:ro+UjX((]"!!)Zj
-q>e_<q#L6i!!)Wi$<-s'o.,5WrmLl4r;H`V%/^#-iZ%mriY1n^!!)cmPQ:RZ!!)Wi(.A.S/,ic<
-dfBCH]3A`K'E6u"rr1^err*\F>@LeMrmLl=rmM;TrmLj_CNO#HiXG>U!W`6!J,~>
-!!)]k0N7t',O58&rr+F[rr/?Iro+UjrppQXr`]f[raPKur[Y&KrdA#1!6kF:ro+UjX((]"!!)Zj
-q>e_<q#L6i!!)Wi$<-s'o.,5WrmLl4r;H`V%/^#-iZ%mriY1n^!!)cmPQ:RZ!!)Wi(.A.S/,ic<
-dfBCH]3A`K'E6u"rr1^err*\F>@LeMrmLl=rmM;TrmLj_CNO#HiXG>U!W`6!J,~>
-!!)]k0N7t',O58&rr+F[rr/?Iro+UjrppQXr`]f[raPKur[Y&KrdA#1!6kF:ro+UjX((]"!!)Zj
-q>e_<q#L6i!!)Wi$<-s'o.,5WrmLl4r;H`V%/^#-iZ%mriY1n^!!)cmPQ:RZ!!)Wi(.A.S/,ic<
-dfBCH]3A`K'E6u"rr1^err*\F>@LeMrmLl=rmM;TrmLj_CNO#HiXG>U!W`6!J,~>
-!!)]k#u1Eu;bd6ZrmLlHCBS*-rnS"^rXr.nl>'=Ho4%^udfA\4rk]*'%/p/.iY-_?iq*-L!;$3e
-!6bB=!;?Bl!;-6j:&b,&h%M=<r[XH:rmOU@l4!YQrVcuc'E8!j'Cu,&!;6?f!2fbk!;ZTo!;$1>
-:&a_t@X\7)!<26`e,J>?ro+UjrnS"^rosL4ro+UjdfA\4h$j;^dfA\3rW2!lnGWIhrr.E~>
-!!)]k#u1Eu;bd6ZrmLlHCBS*-rnS"^rXr.nl>'=Ho4%^udfA\4rk]*'%/p/.iY-_?iq*-L!;$3e
-!6bB=!;?Bl!;-6j:&b,&h%M=<r[XH:rmOU@l4!YQrVcuc'E8!j'Cu,&!;6?f!2fbk!;ZTo!;$1>
-:&a_t@X\7)!<26`e,J>?ro+UjrnS"^rosL4ro+UjdfA\4h$j;^dfA\3rW2!lnGWIhrr.E~>
-!!)]k#u1Eu;bd6ZrmLlHCBS*-rnS"^rXr.nl>'=Ho4%^udfA\4rk]*'%/p/.iY-_?iq*-L!;$3e
-!6bB=!;?Bl!;-6j:&b,&h%M=<r[XH:rmOU@l4!YQrVcuc'E8!j'Cu,&!;6?f!2fbk!;ZTo!;$1>
-:&a_t@X\7)!<26`e,J>?ro+UjrnS"^rosL4ro+UjdfA\4h$j;^dfA\3rW2!lnGWIhrr.E~>
-!!)]k$<-s'o.,5WrmLl4r;H`V%0$5=X#cHVX!=[Grr1@HlMge"%,qs!rWM3\_G`5^rVurfrqui?
-rqlchrVurkrW6j[C]=;C]-I=Si_s<.>O)4e9k'([rWcm@C\)!8CVocD!!)WiqZ*MmqZ-Bi!!)Wi
-,t.b3N#VBfdfBC,!94!p'E6u)rr1mcrr1mWir6e.rr*SCrhBo$rWasBrr1A@iY1h\!W`6!J,~>
-!!)]k$<-s'o.,5WrmLl4r;H`V%0$5=X#cHVX!=[Grr1@HlMge"%,qs!rWM3\_G`5^rVurfrqui?
-rqlchrVurkrW6j[C]=;C]-I=Si_s<.>O)4e9k'([rWcm@C\)!8CVocD!!)WiqZ*MmqZ-Bi!!)Wi
-,t.b3N#VBfdfBC,!94!p'E6u)rr1mcrr1mWir6e.rr*SCrhBo$rWasBrr1A@iY1h\!W`6!J,~>
-!!)]k$<-s'o.,5WrmLl4r;H`V%0$5=X#cHVX!=[Grr1@HlMge"%,qs!rWM3\_G`5^rVurfrqui?
-rqlchrVurkrW6j[C]=;C]-I=Si_s<.>O)4e9k'([rWcm@C\)!8CVocD!!)WiqZ*MmqZ-Bi!!)Wi
-,t.b3N#VBfdfBC,!94!p'E6u)rr1mcrr1mWir6e.rr*SCrhBo$rWasBrr1A@iY1h\!W`6!J,~>
-!!)]k!)<Il(u5iUrr+F:rr1A@rospk3r\^Z7/lck1@tME#:lkSrdA#1'E.n6iY2=_13E3g!!)Ke
-rW(.@rW)Qh!!(+>!!)Qgr;`_oquHEh!!)]k!c&a'rVdnU>6&I<K/.4O!/"JaFT,JQFT28l12C>-
-IK$i/@Y5?nrX%R_@WYi>@K:3"oDS^irr.E~>
-!!)]k!)<Il(u5iUrr+F:rr1A@rospk3r\^Z7/lck1@tME#:lkSrdA#1'E.n6iY2=_13E3g!!)Ke
-rW(.@rW)Qh!!(+>!!)Qgr;`_oquHEh!!)]k!c&a'rVdnU>6&I<K/.4O!/"JaFT,JQFT28l12C>-
-IK$i/@Y5?nrX%R_@WYi>@K:3"oDS^irr.E~>
-!!)]k!)<Il(u5iUrr+F:rr1A@rospk3r\^Z7/lck1@tME#:lkSrdA#1'E.n6iY2=_13E3g!!)Ke
-rW(.@rW)Qh!!(+>!!)Qgr;`_oquHEh!!)]k!c&a'rVdnU>6&I<K/.4O!/"JaFT,JQFT28l12C>-
-IK$i/@Y5?nrX%R_@WYi>@K:3"oDS^irr.E~>
-!!)`l!c'#rrr*\F,Q@]%;dsiQlMgcW@Z:<c;euC3@T37)'AZT&CLZm>$u=\uraH:Xr_if+oCr4a
-!:Bac!6bBA!:p*h!6G->!:^!e!2fbp!;$0i!7^uOl2^,K]2Rkk!!*#tJ,~>
-!!)`l!c'#rrr*\F,Q@]%;dsiQlMgcW@Z:<c;euC3@T37)'AZT&CLZm>$u=\uraH:Xr_if+oCr4a
-!:Bac!6bBA!:p*h!6G->!:^!e!2fbp!;$0i!7^uOl2^,K]2Rkk!!*#tJ,~>
-!!)`l!c'#rrr*\F,Q@]%;dsiQlMgcW@Z:<c;euC3@T37)'AZT&CLZm>$u=\uraH:Xr_if+oCr4a
-!:Bac!6bBA!:p*h!6G->!:^!e!2fbp!;$0i!7^uOl2^,K]2Rkk!!*#tJ,~>
-!!'M-!!&ho!!(.?!!)Hd!!&nqrrDWh!!(LIs#L4'@d<+T!!*#tJ,~>
-!!'M-!!&ho!!(.?!!)Hd!!&nqrrDWh!!(LIs#L4'@d<+T!!*#tJ,~>
-!!'M-!!&ho!!(.?!!)Hd!!&nqrrDWh!!(LIs#L4'@d<+T!!*#tJ,~>
-!WE)/rVuqorVur@rVuqLrW2uuZi0q)rr.E~>
-!WE)/rVuqorVur@rVuqLrW2uuZi0q)rr.E~>
-!WE)/rVuqorVur@rVuqLrW2uuZi0q)rr.E~>
-s8Duu\c)R/V#C>ob5MA@Jc>]K!!'G+!!)usJ,~>
-s8Duu\c)R/V#C>ob5MA@Jc>]K!!'G+!!)usJ,~>
-s8Duu\c)R/V#C>ob5MA@Jc>]K!!'G+!!)usJ,~>
-rr2ot]D_d1U](5nbl.SBJc>ZJ!!'G+!!)usJ,~>
-rr2ot]D_d1U](5nbl.SBJc>ZJ!!'G+!!)usJ,~>
-rr2ot]D_d1U](5nbl.SBJc>ZJ!!'G+!!)usJ,~>
-r;QZq^]"35UAb,mbl.SBJc>ZJ!!'G+!!)usJ,~>
-r;QZq^]"35UAb,mbl.SBJc>ZJ!!'G+!!)usJ,~>
-r;QZq^]"35UAb,mbl.SBJc>ZJ!!'G+!!)usJ,~>
-q>L?o_#=<6U&G#lcMdeDJc>TH!!'M-!!)rrJ,~>
-q>L?o_#=<6U&G#lcMdeDJc>TH!!'M-!!)rrJ,~>
-q>L?o_#=<6U&G#lcMdeDJc>TH!!'M-!!)rrJ,~>
-q>L?o_>XE7T`+okcMdeDJc>QG!!'P.!!)rrJ,~>
-q>L?o_>XE7T`+okcMdeDJc>QG!!'P.!!)rrJ,~>
-q>L?o_>XE7T`+okcMdeDJc>QG!!'P.!!)rrJ,~>
-q#16n`;]c:T)J]id/F"FJc>NF!!'S/!!)oqJ,~>
-q#16n`;]c:T)J]id/F"FJc>NF!!'S/!!)oqJ,~>
-q#16n`;]c:T)J]id/F"FJc>NF!!'S/!!)oqJ,~>
-q#16nbPq><SGiKgd/F"FJc>KE!!'Y1!!)lpJ,~>
-q#16nbPq><SGiKgd/F"FJc>KE!!'Y1!!)lpJ,~>
-q#16nbPq><SGiKgd/F"FJc>KE!!'Y1!!)lpJ,~>
-p\k-mc2I\CPl:X_df'4HJc>EC!!'_3!!)ioJ,~>
-p\k-mc2I\CPl:X_df'4HJc>EC!!'_3!!)ioJ,~>
-p\k-mc2I\CPl:X_df'4HJc>EC!!'_3!!)ioJ,~>
-p\k-mc2I\CPPtO^ec,RKJc>?A!!'b4!!)ioJ,~>
-p\k-mc2I\CPPtO^ec,RKJc>?A!!'b4!!)ioJ,~>
-p\k-mc2I\CPPtO^ec,RKJc>?A!!'b4!!)ioJ,~>
-p\k-mcMdeDOo>=\fDYaMJc>9?!!'e5!!)fnJ,~>
-p\k-mcMdeDOo>=\fDYaMJc>9?!!'e5!!)fnJ,~>
-p\k-mcMdeDOo>=\fDYaMJc>9?!!'e5!!)fnJ,~>
-pAP$ld/F"FO8f.ZgAV'PJc>3=!!'k7!!)cmJ,~>
-pAP$ld/F"FO8f.ZgAV'PJc>3=!!'k7!!)cmJ,~>
-pAP$ld/F"FO8f.ZgAV'PJc>3=!!'k7!!)cmJ,~>
-pAP$ld/F"FNW&nXh>[ESJc>-;!!'t:rrDclJ,~>
-pAP$ld/F"FNW&nXh>[ESJc>-;!!'t:rrDclJ,~>
-pAP$ld/F"FNW&nXh>[ESJc>-;!!'t:rrDclJ,~>
-pAP$lkl1;Vo_ngjMuN_Vi;N]VJc>$8rrC+=!!)ZjJ,~>
-pAP$lkl1;Vo_ngjMuN_Vi;N]VJc>$8rrC+=!!)ZjJ,~>
-pAP$lkl1;Vo_ngjMuN_Vi;N]VJc>$8rrC+=!!)ZjJ,~>
-p&4pkli-nap\t!hrVlfsM#RDSjSo/ZJc=p5!!(1@rrDZiJ,~>
-p&4pkli-nap\t!hrVlfsM#RDSjSo/ZJc=p5!!(1@rrDZiJ,~>
-p&4pkli-nap\t!hrVlfsM#RDSjSo/ZJc=p5!!(1@rrDZiJ,~>
-o_ngjmf*4dmf*.bK`:uOkl1S^Jc=g2!!(7B!!)QgJ,~>
-o_ngjmf*4dmf*.bK`:uOkl1S^Jc=g2!!(7B!!)QgJ,~>
-o_ngjmf*4dmf*.bK`:uOkl1S^Jc=g2!!(7B!!)QgJ,~>
-oD\ainbrLgJc=p5rrDEbrr@WLj8T&Yd/O%FnG[q~>
-oD\ainbrLgJc=p5rrDEbrr@WLj8T&Yd/O%FnG[q~>
-oD\ainbrLgJc=p5rrDEbrr@WLj8T&Yd/O%FnG[q~>
-nc&IepAP$lJc=g2qZ-EjqZ)3Hhu<WUeGfIJmf%_~>
-nc&IepAP$lJc=g2qZ-EjqZ)3Hhu<WUeGfIJmf%_~>
-nc&IepAP$lJc=g2qZ-EjqZ)3Hhu<WUeGfIJmf%_~>
-mJd%ar;Q]rJc=R+p],mEfDbaLgA_'Om/DM~>
-mJd%ar;Q]rJc=R+p],mEfDbaLgA_'Om/DM~>
-mJd%ar;Q]rJc=R+p],mEfDbaLgA_'Om/DM~>
-l2LS\Jc:6"VuH\rhZ!NTl2H2~>
-l2LS\Jc:6"VuH\rhZ!NTl2H2~>
-l2LS\Jc:6"VuH\rhZ!NTl2H2~>
-Jc:6"M#RARjSo,YkPfu~>
-Jc:6"M#RARjSo,YkPfu~>
-Jc:6"M#RARjSo,YkPfu~>
-Jc:6"L&UlJo`"XdjSjZ~>
-Jc:6"L&UlJo`"XdjSjZ~>
-Jc:6"L&UlJo`"XdjSjZ~>
-Jc:6"Jc>WIoDm\GJ,~>
-Jc:6"Jc>WIoDm\GJ,~>
-Jc:6"Jc>WIoDm\GJ,~>
-Jc:6"Jc<jlJ,~>
-Jc:6"Jc<jlJ,~>
-Jc:6"Jc<jlJ,~>
-Jc:6"Jc<jlJ,~>
-Jc:6"Jc<jlJ,~>
-Jc:6"Jc<jlJ,~>
-%%EndData
-showpage
-%%Trailer
-end
-%%EOF
diff --git a/lib/snmp/doc/src/snmp_mib_compiler.xml b/lib/snmp/doc/src/snmp_mib_compiler.xml
index 63af19f479..285d11fce9 100644
--- a/lib/snmp/doc/src/snmp_mib_compiler.xml
+++ b/lib/snmp/doc/src/snmp_mib_compiler.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_notification_mib.xml b/lib/snmp/doc/src/snmp_notification_mib.xml
index d1d83570d1..d2e288ec15 100644
--- a/lib/snmp/doc/src/snmp_notification_mib.xml
+++ b/lib/snmp/doc/src/snmp_notification_mib.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1998</year><year>2009</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_pdus.xml b/lib/snmp/doc/src/snmp_pdus.xml
index 6c323c3ad9..1d086e6f48 100644
--- a/lib/snmp/doc/src/snmp_pdus.xml
+++ b/lib/snmp/doc/src/snmp_pdus.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_standard_mib.xml b/lib/snmp/doc/src/snmp_standard_mib.xml
index e8dea46f32..35efbba483 100644
--- a/lib/snmp/doc/src/snmp_standard_mib.xml
+++ b/lib/snmp/doc/src/snmp_standard_mib.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_target_mib.xml b/lib/snmp/doc/src/snmp_target_mib.xml
index d5151d41de..c3bcd3b4e3 100644
--- a/lib/snmp/doc/src/snmp_target_mib.xml
+++ b/lib/snmp/doc/src/snmp_target_mib.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1998</year><year>2011</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -38,18 +39,18 @@
functions for the SNMP-TARGET-MIB,
and functions for configuring the database. </p>
<p>The configuration files are described in the SNMP User's Manual.</p>
+ <p>Legacy API functions <c>add_addr/10</c> that does not specify
+ transport domain, and <c>add_addr/11</c> that has got separate
+ <c>IpAddr</c> and <c>PortNumber</c> arguments still work as before
+ for backwards compatibility reasons.</p>
<marker id="types"></marker>
</description>
<section>
<title>DATA TYPES</title>
- <code type="none"><![CDATA[
-transportDomain() = transportDomainUdpIpv4 | transportDomainUdpIpv6
-transportAddressIPv4() = [integer()], length 4
-transportAddressIPv6() = [integer()], length 8
-transportAddressMask() = [integer()], length 0 (default), 6 (IPv4) or 10 (IPv6)
- ]]></code>
+ <p>See the <seealso marker="snmpa_conf#types">
+ data types in <c>snmpa_conf</c></seealso>.</p>
<marker id="configure"></marker>
</section>
@@ -129,20 +130,18 @@ transportAddressMask() = [integer()], length 0 (default), 6 (IPv4) or 10 (IPv6)
</func>
<func>
- <name>add_addr(Name, Ip, Port, Timeout, Retry, TagList, Params, EngineId, TMask, MMS) -> Ret</name>
- <name>add_addr(Name, Domain, Ip, Port, Timeout, Retry, TagList, Params, EngineId, TMask, MMS) -> Ret</name>
+ <name>add_addr(Name, Domain, Addr, Timeout, Retry, TagList, Params, EngineId, TMask, MMS) -> Ret</name>
<fsummary>Add one target address definition</fsummary>
<type>
<v>Name = string()</v>
<v>Domain = transportDomain()</v>
- <v>Ip = transportAddressIPv4() | transportAddressIPv6() (depends on the value of Domain)</v>
- <v>Port = integer()</v>
+ <v>Addr = transportAddress() % Default port is 162</v>
<v>Timeout = integer()</v>
<v>Retry = integer()</v>
<v>TagList = string()</v>
<v>ParamsName = string()</v>
<v>EngineId = string()</v>
- <v>TMask = transportAddressMask() (depends on Domain)</v>
+ <v>TMask = transportAddressMask() % Depends on Domain</v>
<v>MMS = integer()</v>
<v>Ret = {ok, Key} | {error, Reason}</v>
<v>Key = term()</v>
diff --git a/lib/snmp/doc/src/snmp_user_based_sm_mib.xml b/lib/snmp/doc/src/snmp_user_based_sm_mib.xml
index 7485e5af57..cc376ac118 100644
--- a/lib/snmp/doc/src/snmp_user_based_sm_mib.xml
+++ b/lib/snmp/doc/src/snmp_user_based_sm_mib.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1999</year><year>2009</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmp_view_based_acm_mib.xml b/lib/snmp/doc/src/snmp_view_based_acm_mib.xml
index d595f6b93b..fdad735e71 100644
--- a/lib/snmp/doc/src/snmp_view_based_acm_mib.xml
+++ b/lib/snmp/doc/src/snmp_view_based_acm_mib.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1999</year><year>2010</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml
index 86fde03205..d756ff7a65 100644
--- a/lib/snmp/doc/src/snmpa.xml
+++ b/lib/snmp/doc/src/snmpa.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2012</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -245,29 +246,75 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}
This function is used to convert to the old (pre-4.4) info
format. </p>
+ <marker id="load_mib"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>load_mib(Mib) -> ok | {error, Reason}</name>
+ <name>load_mib(Agent, Mib) -> ok | {error, Reason}</name>
+ <fsummary>Load single MIB into the agent</fsummary>
+ <type>
+ <v>Agent = pid() | atom()</v>
+ <v>MibName = string()</v>
+ <v>Reason = already_loaded | term()</v>
+ </type>
+ <desc>
+ <p>Load a single <c>Mib</c> into an agent. The <c>MibName</c>
+ is the name of the Mib, including the path to where the compiled
+ mib is found. For example: </p>
+ <code type="none">
+ Dir = code:priv_dir(my_app) ++ "/mibs/",
+ snmpa:load_mib(snmp_master_agent, Dir ++ "MY-MIB").
+ </code>
+
<marker id="load_mibs"></marker>
</desc>
</func>
<func>
<name>load_mibs(Mibs) -> ok | {error, Reason}</name>
- <name>load_mibs(Agent,Mibs) -> ok | {error, Reason}</name>
+ <name>load_mibs(Mibs, Force) -> ok | {error, Reason}</name>
+ <name>load_mibs(Agent, Mibs) -> ok | {error, Reason}</name>
+ <name>load_mibs(Agent, Mibs, Force) -> ok | {error, Reason}</name>
<fsummary>Load MIBs into the agent</fsummary>
<type>
<v>Agent = pid() | atom()</v>
<v>Mibs = [MibName]</v>
+ <v>Force = boolean()</v>
<v>MibName = string()</v>
- <v>Reason = term()</v>
+ <v>Reason = {'load aborted at', MibName, InternalReason}</v>
+ <v>InternalReason = already_loaded | term()</v>
</type>
<desc>
- <p>Loads <c>Mibs</c> into an agent. If the agent cannot load
- all MIBs, it will indicate where loading was aborted. The
- <c>MibName</c> is the name of the Mib, including the path to
- where the compiled mib is found. For example,</p>
- <code type="none">
+ <p>Load <c>Mibs</c> into an agent. If the agent cannot load all
+ MIBs (the default value of the <c>Force</c> argument is <c>false</c>),
+ it will indicate where loading was aborted. The <c>MibName</c>
+ is the name of the Mib, including the path to where the compiled
+ mib is found. For example,</p>
+ <code type="none">
Dir = code:priv_dir(my_app) ++ "/mibs/",
snmpa:load_mibs(snmp_master_agent, [Dir ++ "MY-MIB"]).
</code>
+ <p>If <c>Force = true</c> then the agent will continue attempting
+ to load each mib even after failing to load a previous mib. Use with
+ care. </p>
+
+ <marker id="unload_mib"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>unload_mib(Mib) -> ok | {error, Reason}</name>
+ <name>unload_mib(Agent, Mib) -> ok | {error, Reason}</name>
+ <fsummary>Unload single MIB from the agent</fsummary>
+ <type>
+ <v>Agent = pid() | atom()</v>
+ <v>MibName = string()</v>
+ <v>Reason = not_loaded | term()</v>
+ </type>
+ <desc>
+ <p>Unload a single <c>Mib</c> from an agent. </p>
<marker id="unload_mibs"></marker>
</desc>
@@ -275,16 +322,25 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}
<func>
<name>unload_mibs(Mibs) -> ok | {error, Reason}</name>
- <name>unload_mibs(Agent,Mibs) -> ok | {error, Reason}</name>
+ <name>unload_mibs(Mibs, Force) -> ok | {error, Reason}</name>
+ <name>unload_mibs(Agent, Mibs) -> ok | {error, Reason}</name>
+ <name>unload_mibs(Agent, Mibs, Force) -> ok | {error, Reason}</name>
<fsummary>Unload MIBs from the agent</fsummary>
<type>
<v>Agent = pid() | atom()</v>
<v>Mibs = [MibName]</v>
+ <v>Force = boolean()</v>
<v>MibName = string()</v>
+ <v>Reason = {'unload aborted at', MibName, InternalReason}</v>
+ <v>InternalReason = not_loaded | term()</v>
</type>
<desc>
- <p>Unloads MIBs into an agent. If it cannot unload all MIBs,
- it will indicate where unloading was aborted. </p>
+ <p>Unload <c>Mibs</c> from an agent. If it cannot unload all MIBs
+ (the default value of the <c>Force</c> argument is <c>false</c>),
+ it will indicate where unloading was aborted. </p>
+ <p>If <c>Force = true</c> then the agent will continue attempting
+ to unload each mib even after failing to unload a previous mib.
+ Use with care. </p>
<marker id="which_mibs"></marker>
</desc>
@@ -502,32 +558,39 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}
<func>
<name>log_to_txt(LogDir)</name>
- <name>log_to_txt(LogDir, Mibs)</name>
- <name>log_to_txt(LogDir, Mibs, OutFile) -> ok | {error, Reason}</name>
- <name>log_to_txt(LogDir, Mibs, OutFile, LogName) -> ok | {error, Reason}</name>
- <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) -> ok | {error, Reason}</name>
- <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Block | Mibs)</name>
+ <name>log_to_txt(LogDir, Mibs, Block | OutFile) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, Block | LogName) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, Block | LogFile) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block | Start) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start) -> ok | {error, Reason}</name>
<name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop) -> ok | {error, Reason}</name>
<fsummary>Convert an Audit Trail Log to text format</fsummary>
<type>
<v>LogDir = string()</v>
<v>Mibs = [MibName]</v>
<v>MibName = string()</v>
+ <v>Block = boolean()</v>
<v>OutFile = string()</v>
<v>LogName = string()</v>
<v>LogFile = string()</v>
- <v>Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} </v>
+ <v>Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} </v>
<v>Reason = disk_log_open_error() | file_open_error() | term()</v>
<v>disk_log_open_error() = {LogName, term()}</v>
<v>file_open_error() = {OutFile, term()}</v>
</type>
<desc>
<p>Converts an Audit Trail Log to a readable text file.
- <c>OutFile</c> defaults to "./snmpa_log.txt".
- <c>LogName</c> defaults to "snmpa_log".
- <c>LogFile</c> defaults to "snmpa.log".
- See <seealso marker="snmp#log_to_txt">snmp:log_to_txt</seealso>
- for more info.</p>
+ <c>OutFile</c> defaults to "./snmpa_log.txt".
+ <c>LogName</c> defaults to "snmpa_log".
+ <c>LogFile</c> defaults to "snmpa.log". </p>
+ <p>The <c>Block</c> option indicates if the log should be blocked
+ during conversion. This could be usefull when converting large
+ logs (when otherwise the log could wrap during conversion).
+ Defaults to <c>true</c>. </p>
+ <p>See <seealso marker="snmp#log_to_txt">snmp:log_to_txt</seealso>
+ for more info.</p>
<marker id="log_to_io"></marker>
</desc>
@@ -535,19 +598,22 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}
<func>
<name>log_to_io(LogDir) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs, LogName) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Block | Mibs) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, Block | LogName) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, Block | LogFile) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Block | Start) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start) -> ok | {error, Reason}</name>
<name>log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop) -> ok | {error, Reason}</name>
<fsummary>Convert an Audit Trail Log to text format</fsummary>
<type>
<v>LogDir = string()</v>
<v>Mibs = [MibName]</v>
<v>MibName = string()</v>
+ <v>Block = boolean()</v>
<v>LogName = string()</v>
<v>LogFile = string()</v>
- <v>Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} </v>
+ <v>Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} </v>
<v>Reason = disk_log_open_error() | file_open_error() | term()</v>
<v>disk_log_open_error() = {LogName, term()}</v>
<v>file_open_error() = {OutFile, term()}</v>
@@ -556,8 +622,12 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}
<p>Converts an Audit Trail Log to a readable format and
prints it on stdio.
<c>LogName</c> defaults to "snmpa_log".
- <c>LogFile</c> defaults to "snmpa.log".
- See <seealso marker="snmp#log_to_io">snmp:log_to_io</seealso>
+ <c>LogFile</c> defaults to "snmpa.log".</p>
+ <p>The <c>Block</c> option indicates if the log should be blocked
+ during conversion. This could be usefull when converting large
+ logs (when otherwise the log could wrap during conversion).
+ Defaults to <c>true</c>. </p>
+ <p>See <seealso marker="snmp#log_to_io">snmp:log_to_io</seealso>
for more info.</p>
<marker id="change_log_size"></marker>
diff --git a/lib/snmp/doc/src/snmpa_conf.xml b/lib/snmp/doc/src/snmpa_conf.xml
index a533c179ee..503e44a6a2 100644
--- a/lib/snmp/doc/src/snmpa_conf.xml
+++ b/lib/snmp/doc/src/snmpa_conf.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2006</year><year>2011</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -45,20 +46,56 @@
<title>DATA TYPES</title>
<code type="none"><![CDATA[
transportDomain() = transportDomainUdpIpv4 | transportDomainUdpIpv6
-transportAddressIPv4() = [integer()], length 4
-transportAddressIPv6() = [integer()], length 8
-transportAddressMask() = [integer()], length 0 (default), 6 (IPv4) or 10 (IPv6)
+
+transportAddress() =
+ transportAddressIPv4() | transportAddressIPv6()
+
+transportAddressWithPort() =
+ transportAddressIPv4WithPort() | transportAddressIPv6WithPort()
+
+transportAddressWithoutPort() =
+ transportAddressIPv4WithoutPort() | transportAddressIPv6WithoutPort()
+
+transportAddressIPv4() =
+ transportAddressIPv4WithPort() | transportAddressIPv4WithoutPort()
+transportAddressIPv4WithPort =
+ {transportAddressIPv4WithoutPort(), inet:port_number()} |
+ [byte() x 4, byte() x 2]
+transportAddressIPv4WithoutPort =
+ inet:ip4_address() | [byte() x 4]
+
+transportAddressIPv6() =
+ transportAddressIPv6WithPort() | transportAddressIPv6WithoutPort()
+transportAddressIPv6WithPort =
+ {transportAddressIPv6WithoutPort(), inet:port_number()} |
+ [word() x 8, inet:port_number()] |
+ [word() x 8, byte() x 2] |
+ {byte() x 16, byte() x 2]
+transportAddressIPv6WithoutPort =
+ inet:ip6_address() | [word() x 8] | [byte() x 16]
+
+transportAddressMask() =
+ [] | transportAddressWithPort()
+
+byte() = 0..255
+word() = 0..65535
]]></code>
+ <p>For <c>inet:ip4_address()</c>, <c>inet:ip6_address()</c>
+ and <c>inet:port_number()</c>, see also
+ <seealso marker="kernel:inet#type-ip_address">
+ <c>inet:ip_address()</c></seealso></p>
<marker id="agent_entry"></marker>
</section>
+
+
<funcs>
<func>
<name>agent_entry(Tag, Val) -> agent_entry()</name>
<fsummary>Create an agent entry</fsummary>
<type>
- <v>Tag = intAgentIpAddress | intAgentUDPPort | intAgentMaxPacketSize | snmpEngineMaxMessageSize | snmpEngineID</v>
+ <v>Tag = intAgentTransports | intAgentUDPPort | intAgentMaxPacketSize | snmpEngineMaxMessageSize | snmpEngineID</v>
<v>Val = term()</v>
<v>agent_entry() = term()</v>
</type>
@@ -390,17 +427,15 @@ transportAddressMask() = [integer()], length 0 (default), 6 (IPv4) or 10 (IPv6)
</func>
<func>
- <name>target_addr_entry(Name, Ip, TagList, ParamsName, EngineId) -> target_addr_entry()</name>
- <name>target_addr_entry(Name, Ip, TagList, ParamsName, EngineId, TMask) -> target_addr_entry()</name>
- <name>target_addr_entry(Name, Ip, Udp, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry()</name>
- <name>target_addr_entry(Name, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry()</name>
- <name>target_addr_entry(Name, Domain, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry()</name>
+ <name>target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId) -> target_addr_entry()</name>
+ <name>target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask) -> target_addr_entry()</name>
+ <name>target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry()</name>
+ <name>target_addr_entry(Name, Domain, Addr, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry()</name>
<fsummary>Create an target_addr entry</fsummary>
<type>
<v>Name = string()</v>
<v>Domain = transportDomain()</v>
- <v>Ip = transportAddressIPv4() | transportAddressIPv6() (depends on Domain)</v>
- <v>Udp = integer()</v>
+ <v>Ip = transportAddress() (depends on Domain)</v>
<v>Timeout = integer()</v>
<v>RetryCount = integer()</v>
<v>TagList = string()</v>
@@ -414,12 +449,12 @@ transportAddressMask() = [integer()], length 0 (default), 6 (IPv4) or 10 (IPv6)
<p>Create an entry for the agent target_addr config file,
<c>target_addr.conf</c>. </p>
<p><c>Name</c> must be a <em>non-empty</em> string. </p>
- <p><c>target_addr_entry/5</c> translates to the following call:
- <c>target_addr_entry(Name, Ip, TagList, ParamsName, EngineId)</c>. </p>
<p><c>target_addr_entry/6</c> translates to the following call:
- <c>target_addr_entry(Name, Ip, 162, TagList, ParamsName, EngineId, TMask, 2048)</c>. </p>
+ <c>target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, [])</c>. </p>
+ <p><c>target_addr_entry/7</c> translates to the following call:
+ <c>target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask, 2048)</c>. </p>
<p><c>target_addr_entry/8</c> translates to the following call:
- <c>target_addr_entry(Name, Ip, Udp, 1500, 3, TagList, ParamsName, EngineId, TMask, MaxMessageSize)</c>. </p>
+ <c>target_addr_entry(Name, Domain, Addr, 1500, 3, TagList, ParamsName, EngineId, TMask, MaxMessageSize)</c>. </p>
<p>See
<seealso marker="snmp_agent_config_files#target_addr">Target Address Definitions</seealso>
for more info. </p>
diff --git a/lib/snmp/doc/src/snmpa_discovery_handler.xml b/lib/snmp/doc/src/snmpa_discovery_handler.xml
index 47814221aa..0ea72a880c 100644
--- a/lib/snmp/doc/src/snmpa_discovery_handler.xml
+++ b/lib/snmp/doc/src/snmpa_discovery_handler.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_error.xml b/lib/snmp/doc/src/snmpa_error.xml
index 4dbafdfbb7..7cc4a3513d 100644
--- a/lib/snmp/doc/src/snmpa_error.xml
+++ b/lib/snmp/doc/src/snmpa_error.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2002</year><year>2010</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_error_io.xml b/lib/snmp/doc/src/snmpa_error_io.xml
index 33fbfac20c..bcb2688646 100644
--- a/lib/snmp/doc/src/snmpa_error_io.xml
+++ b/lib/snmp/doc/src/snmpa_error_io.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2002</year><year>2009</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_error_logger.xml b/lib/snmp/doc/src/snmpa_error_logger.xml
index 06382a6057..4feb2e7f32 100644
--- a/lib/snmp/doc/src/snmpa_error_logger.xml
+++ b/lib/snmp/doc/src/snmpa_error_logger.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_error_report.xml b/lib/snmp/doc/src/snmpa_error_report.xml
index 421202bade..282d9b4e59 100644
--- a/lib/snmp/doc/src/snmpa_error_report.xml
+++ b/lib/snmp/doc/src/snmpa_error_report.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_local_db.xml b/lib/snmp/doc/src/snmpa_local_db.xml
index c077bc96d8..ac8d466ab3 100644
--- a/lib/snmp/doc/src/snmpa_local_db.xml
+++ b/lib/snmp/doc/src/snmpa_local_db.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_mib_data.xml b/lib/snmp/doc/src/snmpa_mib_data.xml
new file mode 100644
index 0000000000..1a73c9b634
--- /dev/null
+++ b/lib/snmp/doc/src/snmpa_mib_data.xml
@@ -0,0 +1,393 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2013</year><year>2016</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>snmpa_mib_data</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ <file>snmpa_mib_data.xml</file>
+ </header>
+
+ <module>snmpa_mib_data</module>
+ <modulesummary>Behaviour module for the SNMP agent mib-server
+ data module.</modulesummary>
+ <description>
+ <p>This module defines the behaviour of the SNMP agent mib-server
+ data module. A <c>snmpa_mib_data</c> compliant module
+ must export the following functions: </p>
+ <list type="bulleted">
+ <item>
+ <seealso marker="#new">new/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#close">close/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#sync">sync/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#load_mib">load_mib/4</seealso>
+ </item>
+ <item>
+ <seealso marker="#unload_mib">unload_mib/4</seealso>
+ </item>
+ <item>
+ <seealso marker="#lookup">lookup/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#next">next/3</seealso>
+ </item>
+ <item>
+ <seealso marker="#register_subagent">register_subagent/3</seealso>
+ </item>
+ <item>
+ <seealso marker="#unregister_subagent">unregister_subagent/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#which_mib">which_mib/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#which_mibs">which_mibs/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#whereis_mib">whereis_mib/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#dump">dump/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#info">info/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#backup">backup/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#code_change">code_change/4</seealso>
+ </item>
+ </list>
+
+ <p>The semantics of them and their exact signatures are
+ explained below. </p>
+
+ <p>Note that the data extracted from the imported (loaded)
+ mibs are stored partly by the mib-server and partly by the
+ symbolic-store server. See the default mib-server data
+ module, <c>snmpa_mib_data_tttn</c> for details. </p>
+
+ </description>
+
+ <section>
+ <title>CALLBACK FUNCTIONS</title>
+ <p>The following functions must be exported from a
+ <c>mib-server</c> data callback module: </p>
+
+ <marker id="new"></marker>
+ </section>
+
+ <funcs>
+ <func>
+ <name>Module:new(Storage) -> State</name>
+ <fsummary>Create new (mib-server) data instance</fsummary>
+ <type>
+ <v>Storage = mib_storage()</v>
+ <v>State = term()</v>
+ </type>
+ <desc>
+ <p>Create a new mib-server data instance. </p>
+
+ <marker id="close"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:close(State) -> void()</name>
+ <fsummary>Close the mib-server data instance</fsummary>
+ <type>
+ <v>State = term()</v>
+ </type>
+ <desc>
+ <p>Close the mib-storage.</p>
+
+ <marker id="sync"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:sync(State) -> void()</name>
+ <fsummary>Synchronize to disc</fsummary>
+ <type>
+ <v>State = term()</v>
+ </type>
+ <desc>
+ <p>Synchronize (write to disc, if possible) the mib-server data.
+ This depends on the <c>mib_storage</c> option, and will only have
+ an effect if the mib-storage option has an actual disc component
+ (such as dets, or ets with a file). </p>
+
+ <marker id="load_mib"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:load_mib(State, Filename, MeOverride, TeOverride) -> {ok, NewState} | {error, Reason}</name>
+ <fsummary>Load a mib into the mib-server</fsummary>
+ <type>
+ <v>State = NewState = term()</v>
+ <v>Filename = filename()</v>
+ <v>MeOverride = boolean()</v>
+ <v>TeOverride = boolean()</v>
+ <v>Reason = already_loaded | term()</v>
+ </type>
+ <desc>
+ <p>Load the mib specified by the <c>Filename</c> argument
+ into the mib-server.
+ The <c>MeOverride</c> and <c>TeOverride</c> arguments
+ specifies how the mib-server shall handle duplicate mib- and trap-
+ entries. </p>
+
+ <marker id="unload_mib"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:unload_mib(State, Filename) -> {ok, NewState} | {error, Reason}</name>
+ <fsummary>Unload mib from the mib-server</fsummary>
+ <type>
+ <v>State = NewState = term()</v>
+ <v>Filename = filename()</v>
+ <v>Reason = not_loaded | term()</v>
+ </type>
+ <desc>
+ <p>Unload the mib specified by the <c>Filename</c> argument
+ from the mib-server. </p>
+
+ <marker id="lookup"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:lookup(State, Oid) -> Reply</name>
+ <fsummary>Find the mib-entry corresponding to the Oid</fsummary>
+ <type>
+ <v>State = term()</v>
+ <v>Reply = {variable, ME} | {table_column, ME, TEOid} | {subagent, SAPid, SAOid} | {false, Reason}</v>
+ <v>Oid = TEOid = SAOid = oid()</v>
+ <v>SAPid = pid()</v>
+ <v>ME = me()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Find the mib-entry corresponding to the <c>Oid</c>.
+ If it is a variable, the <c>Oid</c> must be
+ &lt;Oid for var&gt;.0
+ and if it is a table, <c>Oid</c> must be
+ &lt;table&gt;.&lt;entry&gt;.&lt;col&gt;.&lt;any&gt;.</p>
+
+ <marker id="next"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:next(State, Oid, MibView) -> Reply</name>
+ <fsummary>Finds the lexicographically next oid</fsummary>
+ <type>
+ <v>State = term()</v>
+ <v>Reply = false | endOfTable | {subagent, SAPid, SAOid} | {variable, ME, VarOid} | {table, TableOid, TableRestOid, ME}</v>
+ <v>Oid = SAOid = VarOid = TableOid = TableRestOid = oid()</v>
+ <v>SAPid = pid()</v>
+ <v>ME = me()</v>
+ </type>
+ <desc>
+ <p>Finds the lexicographically next oid. </p>
+
+ <marker id="register_subagent"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:register_subagent(State, Oid, Pid) -> Reply</name>
+ <fsummary>Register the subagent</fsummary>
+ <type>
+ <v>State = NewState = term()</v>
+ <v>Reply = {ok, NewState} | {error, Reason}</v>
+ <v>Oid = oid()</v>
+ <v>Pid = pid()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Register the subagent, process,
+ handling part of the mib-tree. </p>
+
+ <marker id="unregister_subagent"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:unregister_subagent(State, PidOrOid) -> Reply</name>
+ <fsummary>Unregister the subagent</fsummary>
+ <type>
+ <v>State = NewState = term()</v>
+ <v>Reply = {ok, NewState} | {ok, NewState, Pid} | {error, Reason}</v>
+ <v>PidOrOid = pid() | oid()</v>
+ <v>Pid = pid()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Unregister the subagent, handling part of the mib-tree,
+ as specified by the <c>oid()</c> or <c>pid()</c>
+ (<c>PidOrOid</c>). </p>
+ <p>When unregister the subagent using an <c>oid()</c>, the <c>pid()</c>
+ of the process handling the sub-tree is also returned. </p>
+
+ <marker id="dump"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:dump(State, Destination) -> Reply</name>
+ <fsummary>Unregister the subagent</fsummary>
+ <type>
+ <v>State = term()</v>
+ <v>Reply = ok | {error, Reason}</v>
+ <v>Destination = io | filename()</v>
+ <v>Pid = pid()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Dump the mib-server data to <c>stdio</c> (Destination = <c>io</c>) or
+ the specified file. </p>
+
+ <marker id="which_mib"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:which_mib(State, Oid) -> Reply</name>
+ <fsummary>Retrieve the mib file for an oid()</fsummary>
+ <type>
+ <v>State = term()</v>
+ <v>Reply = {ok, MibFile} | {error, Reason}</v>
+ <v>Oid = oid()</v>
+ <v>MibFile = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Retrieve the mib-file to which an given <c>oid()</c> belongs. </p>
+
+ <marker id="which_mibs"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:which_mibs(State) -> Reply</name>
+ <fsummary>Retrieve all loaded mib files</fsummary>
+ <type>
+ <v>State = term()</v>
+ <v>Reply = [{MibName, Filename}]</v>
+ <v>MibName = atom()</v>
+ <v>Filename = string()</v>
+ </type>
+ <desc>
+ <p>Retrieve all loaded mib-files. </p>
+
+ <marker id="whereis_mib"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:whereis_mib(State, MibName) -> Reply</name>
+ <fsummary>Retrieve the mib file for the mib</fsummary>
+ <type>
+ <v>State = term()</v>
+ <v>MibName = atom()</v>
+ <v>Reply = {ok, Filename} | {error, Reason}</v>
+ <v>Filename = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Retrieve the mib file for the mib. </p>
+
+ <marker id="info"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:info(State) -> Reply</name>
+ <fsummary>Retrieve misc info for the mib data</fsummary>
+ <type>
+ <v>State = term()</v>
+ <v>Reply = {ok, Filename} | {error, Reason}</v>
+ <v>Filename = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Retrieve misc info for the mib data. </p>
+ <p>This is a utility function used to inspect, for instance,
+ memory usage, in a simple way. </p>
+
+ <marker id="backup"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:backup(State, BackupDir) -> Reply</name>
+ <fsummary>Perform a backup of the mib-server data</fsummary>
+ <type>
+ <v>State = term()</v>
+ <v>Reply = ok | {error, Reason}</v>
+ <v>BackupDir = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Perform a backup of the mib-server data. </p>
+ <p>Note that its implementation dependant (and also
+ dependent on mib-storage is used) if a backup is possible. </p>
+
+ <marker id="code_change"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:code_change(Destination, Vsn, Extra, State) -> NewState</name>
+ <fsummary>Perform a code-change</fsummary>
+ <type>
+ <v>Destination = up | down</v>
+ <v>Vsn = term()</v>
+ <v>Extra = term()</v>
+ <v>State = NewState = term()</v>
+ </type>
+ <desc>
+ <p>Perform a code-change (upgrade or downgrade). </p>
+ <p>See
+ <seealso marker="stdlib:gen_server">gen_server</seealso>
+ for more info regarding the <c>Vsn</c> and <c>Extra</c> arguments. </p>
+
+ </desc>
+ </func>
+
+ </funcs>
+
+</erlref>
+
diff --git a/lib/snmp/doc/src/snmpa_mib_storage.xml b/lib/snmp/doc/src/snmpa_mib_storage.xml
new file mode 100644
index 0000000000..58ce2167ec
--- /dev/null
+++ b/lib/snmp/doc/src/snmpa_mib_storage.xml
@@ -0,0 +1,293 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2013</year><year>2016</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>snmpa_mib_storage</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ <file>snmpa_mib_storage.xml</file>
+ </header>
+
+ <module>snmpa_mib_storage</module>
+ <modulesummary>
+ Behaviour module for the SNMP agent mib storage.
+ </modulesummary>
+ <description>
+ <p>This module defines the behaviour of the SNMP agent mib storage. </p>
+ <p>The mib storage is used by the agent to store internal mib-
+ related information. The mib storage module is used by several entities,
+ not just the mib-server. </p>
+
+ <p>A <c>snmpa_mib_storage</c> compliant module
+ must export the following functions: </p>
+ <list type="bulleted">
+ <item>
+ <seealso marker="#open">open/5</seealso>
+ </item>
+ <item>
+ <seealso marker="#close">close/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#read">read/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#write">write/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#delete1">delete/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#delete2">delete/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#match_object">match_object/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#match_delete">match_delete/2</seealso>
+ </item>
+ <item>
+ <seealso marker="#tab2list">tab2list/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#info">info/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#sync">sync/1</seealso>
+ </item>
+ <item>
+ <seealso marker="#backup">backup/2</seealso>
+ </item>
+ </list>
+
+ <p>The semantics of them and their exact signatures are
+ explained below. </p>
+
+ </description>
+
+ <section>
+ <title>CALLBACK FUNCTIONS</title>
+ <p>The following functions must be exported from a
+ <c>mib-server</c> data callback module: </p>
+
+ <marker id="open"></marker>
+ </section>
+
+ <funcs>
+ <func>
+ <name>Module:open(Name, RecordName, Fields, Type, Options) -> {ok, TabId} | {error, Reason}</name>
+ <fsummary>Create new (mib-server) data instance</fsummary>
+ <type>
+ <v>Name = atom()</v>
+ <v>RecordName = atom()</v>
+ <v>Fields = [atom()]</v>
+ <v>Type = set | bag()</v>
+ <v>Options = list()</v>
+ <v>TabId = term()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Create or open a mib storage table. </p>
+ <p>Note that the <c>RecordName</c> and <c>Fields</c> arguments
+ my not be used in all implementations (they are actually only
+ needed for mnesia-based implementations). </p>
+
+ <p>Note also that the <c>Options</c> argument comes from
+ the <c>options</c> config option of the mib-storage config option,
+ and is passed on as is. </p>
+
+ <marker id="close"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:close(TabId) -> void()</name>
+ <fsummary>Close the mib-storage table</fsummary>
+ <type>
+ <v>State = term()</v>
+ </type>
+ <desc>
+ <p>Close the mib-storage table.</p>
+
+ <marker id="read"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:read(TabId, Key) -> false | {value, Record}</name>
+ <fsummary>Read a record from the mib-storage table</fsummary>
+ <type>
+ <v>TabId = term()</v>
+ <v>Key = term()</v>
+ <v>Record = tuple()</v>
+ </type>
+ <desc>
+ <p>Read a record from the mib-storage table. </p>
+
+ <marker id="write"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:write(TabId, Record) -> ok | {error, Reason}</name>
+ <fsummary>Write a record to the mib-storage table</fsummary>
+ <type>
+ <v>TabId = term()</v>
+ <v>Record = tuple()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Write a record to the mib-storage table. </p>
+
+ <marker id="delete1"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:delete(TabId) -> void()</name>
+ <fsummary>Delete an entire mib-storage table</fsummary>
+ <type>
+ <v>TabId = term()</v>
+ </type>
+ <desc>
+ <p>Delete an entire mib-storage table. </p>
+
+ <marker id="delete2"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:delete(TabId, Key) -> ok | {error, Reason}</name>
+ <fsummary>Delete a record from the mib-storage table</fsummary>
+ <type>
+ <v>TabId = term()</v>
+ <v>Key = term()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Delete a record from the mib-storage table. </p>
+
+ <marker id="match_object"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:match_object(TabId, Pattern) -> {ok, Recs} | {error, Reason}</name>
+ <fsummary>Search the mib-storage table for record matching pattern</fsummary>
+ <type>
+ <v>TabId = term()</v>
+ <v>Pattern = match_pattern()</v>
+ <v>Recs = [tuple()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Search the mib-storage table for record that match the
+ specified pattern. </p>
+
+ <marker id="match_delete"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:match_delete(TabId, Pattern) -> {ok, Recs} | {error, Reason}</name>
+ <fsummary>Delete records in the mib-storage table matching pattern</fsummary>
+ <type>
+ <v>TabId = term()</v>
+ <v>Pattern = match_pattern()</v>
+ <v>Recs = [tuple()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Search the mib-storage table for record that match the
+ specified pattern and then delete them. The records deleted are
+ also returned. </p>
+
+ <marker id="tab2list"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:tab2list(TabId) -> Recs</name>
+ <fsummary>Return all records of the mib-storage table</fsummary>
+ <type>
+ <v>TabId = term()</v>
+ <v>Recs = [tuple()]</v>
+ </type>
+ <desc>
+ <p>Return all records in the mib-storage table in the form
+ of a list. </p>
+
+ <marker id="info"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:info(TabId) -> {ok, Info} | {error, Reason}</name>
+ <fsummary>Returns information about the mib-storage table. </fsummary>
+ <type>
+ <v>TabId = term()</v>
+ <v>Info = term()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Retrieve implementation dependent mib-storage table
+ information. </p>
+
+ <marker id="sync"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:sync(TabId) -> void()</name>
+ <fsummary>Synchronize mib-storage table</fsummary>
+ <type>
+ <v>TabId = term()</v>
+ </type>
+ <desc>
+ <p>Synchronize the mib-storage table. </p>
+ <p>What this means, if anything, is implementation dependent. </p>
+
+ <marker id="backup"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:backup(TabId, BackupDir) -> ok | {error, Reason}</name>
+ <fsummary>Perform a backup of the mib-storage table</fsummary>
+ <type>
+ <v>TabId = term()</v>
+ <v>BackupDir = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Perform a backup of the mib-storage table. </p>
+ <p>What this means, if anything, is implementation dependent. </p>
+
+ </desc>
+ </func>
+
+ </funcs>
+
+</erlref>
+
diff --git a/lib/snmp/doc/src/snmpa_mpd.xml b/lib/snmp/doc/src/snmpa_mpd.xml
index 202e6b5661..a39c087c20 100644
--- a/lib/snmp/doc/src/snmpa_mpd.xml
+++ b/lib/snmp/doc/src/snmpa_mpd.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1999</year><year>2010</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -43,6 +44,12 @@
<marker id="init"></marker>
</description>
+ <section>
+ <title>DATA TYPES</title>
+ <p>See the <seealso marker="snmpa_conf#types">
+ data types in <c>snmpa_conf</c></seealso>.</p>
+ </section>
+
<funcs>
<func>
<name>init(Vsns) -> mpd_state()</name>
@@ -63,16 +70,17 @@
</func>
<func>
- <name>process_packet(Packet, TDomain, TAddress, State, NoteStore, Log) -> {ok, Vsn, Pdu, PduMS, ACMData} | {discarded, Reason} | {discovery, DiscoPacket}</name>
- <name>process_packet(Packet, TDomain, TAddress, LocalEngineID, State, NoteStore, Log) -> {ok, Vsn, Pdu, PduMS, ACMData} | {discarded, Reason} | {discovery, DiscoPacket}</name>
+ <name>process_packet(Packet, From, State, NoteStore, Log) -> {ok, Vsn, Pdu, PduMS, ACMData} | {discarded, Reason} | {discovery, DiscoPacket}</name>
+ <name>process_packet(Packet, From, LocalEngineID, State, NoteStore, Log) -> {ok, Vsn, Pdu, PduMS, ACMData} | {discarded, Reason} | {discovery, DiscoPacket}</name>
<fsummary>Process a packet received from the network</fsummary>
<type>
<v>Packet = binary()</v>
- <v>TDomain = snmpUDPDomain</v>
- <v>TAddress = {Ip, Udp}</v>
+ <v>From = {TDomain, TAddr}</v>
+ <v>TDomain = transportDomainUdpIpv4 | transportDomainUdpIpv6</v>
+ <v>TAddr = {IpAddr, IpPort}</v>
<v>LocalEngineID = string()</v>
- <v>Ip = {integer(), integer(), integer(), integer()}</v>
- <v>Udp = integer()</v>
+ <v>IpAddr = <seealso marker="kernel:inet#type-ip_address">inet:ip_address()</seealso></v>
+ <v>IpPort = inet:port_number()</v>
<v>State = mpd_state()</v>
<v>NoteStore = pid()</v>
<v>Log = snmp_log()</v>
@@ -85,7 +93,7 @@
</type>
<desc>
<p>Processes an incoming packet. Performs authentication and
- decryption as necessary. The return values should be passed the
+ decryption as necessary. The return values should be passed to the
agent.</p>
<note>
@@ -150,14 +158,20 @@
network.
</p>
<p><c>MsgData</c> is the message specific data used in
- the SNMP message. This value is received in a <c>send_pdu</c>
- or <c>send_pdu_req</c> message from the agent. In SNMPv1 and
+ the SNMP message. This value is received in a
+ <seealso marker="snmp_agent_netif#im_send_pdu"><c>send_pdu</c></seealso>
+ or
+ <seealso marker="snmp_agent_netif#im_send_pdu_req">
+ <c>send_pdu_req</c></seealso>
+ message from the agent. In SNMPv1 and
SNMPv2c, this message data is the community string. In
- SNMPv3, it is the context information.
- <c>To</c> is a list of the destination addresses and
+ SNMPv3, it is the context information.</p>
+ <p>
+ <c>To</c> is a list of destination addresses and
their corresponding security parameters. This value is
- also received from the requests mentioned above.
- </p>
+ received in the same message from the agent and then transformed
+ trough <seealso marker="#process_taddrs"><c>process_taddrs</c></seealso>
+ before passed to this function.</p>
<note>
<p>Note that the use of the LocalEngineID argument is only intended
@@ -166,6 +180,32 @@
(see SNMP-FRAMEWORK-MIB). </p>
</note>
+ <marker id="process_taddrs"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>process_taddrs(TDests) -> Dests</name>
+ <fsummary>Transform addresses from internal MIB format to a less internal
+ </fsummary>
+ <type>
+ <v>TDests = [TDest]</v>
+ <v>TDest = {{TDomain, TAddr}, SecData} | {TDomain, TAddr}</v>
+ <v>TDomain = term() % Not at tuple</v>
+ <v>TAddr = term()</v>
+ <v>SecData = term()</v>
+ <v>Dests = [Dest]</v>
+ <v>Dest = {{Domain, Addr}, SecData} | {Domain, Addr}</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddress() % Depends on Domain</v>
+ </type>
+ <desc>
+ <p>Transforms addresses from internal MIB format to one
+ more useful to <seealso marker="snmp_agent_netif">Agent Net if</seealso>.
+ </p>
+ <p>See also <seealso marker="#generate_msg"><c>generate_msg</c>.</seealso>
+ </p>
+
<marker id="discarded_pdu"></marker>
</desc>
</func>
diff --git a/lib/snmp/doc/src/snmpa_network_interface.xml b/lib/snmp/doc/src/snmpa_network_interface.xml
index a986343a4f..d4d4989e90 100644
--- a/lib/snmp/doc/src/snmpa_network_interface.xml
+++ b/lib/snmp/doc/src/snmpa_network_interface.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_network_interface_filter.xml b/lib/snmp/doc/src/snmpa_network_interface_filter.xml
index bff0a24879..7cd08f8935 100644
--- a/lib/snmp/doc/src/snmpa_network_interface_filter.xml
+++ b/lib/snmp/doc/src/snmpa_network_interface_filter.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2007</year><year>2012</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -58,10 +59,10 @@
on two levels: </p>
<list type="bulleted">
<item>
- <p>The first level is at the UDP entry / exit point, i.e.
- immediately after the receipt of the message, before any message
+ <p>The first level is at the transport entry / exit point, i.e.
+ immediately after the receipt of the message before any message
processing is done (accept_recv) and
- immediately before sending the message, after all message
+ immediately before sending the message after all message
processing is done (accept_send).</p>
</item>
<item>
@@ -78,6 +79,12 @@
<seealso marker="snmp_app#configuration_params">req_limit</seealso> and
the function
<seealso marker="snmpa#register_notification_filter">register_notification_filter</seealso>. </p>
+ <p>Legacy network interface filter modules used arguments on the form
+ <c>(IpAddr, PortNumber,...)</c> instead of
+ <c>(Domain, Addr, ...)</c>, and if the SNMP agent is run without
+ changing the configuration to use transport domains
+ the network interface filter will still get
+ the old arguments and work as before.</p>
</description>
<section>
@@ -88,15 +95,17 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
'set-request' | trap | 'get-bulk-request' | 'inform-request' |
report
</code>
+ <p>See also the <seealso marker="snmpa_conf#types">
+ data types in <c>snmpa_conf</c></seealso>.</p>
<marker id="accept_recv"></marker>
</section>
<funcs>
<func>
- <name>accept_recv(Ip, Port) -> boolean()</name>
+ <name>accept_recv(Domain, Addr) -> boolean()</name>
<fsummary>Shall the received message be accepted</fsummary>
<type>
- <v>Ip = ip_address()</v>
- <v>Port = port()</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddressWithPort()</v>
</type>
<desc>
<p>Called at the reception of a message (before <em>any</em> processing
@@ -107,11 +116,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
</desc>
</func>
<func>
- <name>accept_send(Ip, Port) -> boolean()</name>
+ <name>accept_send(Domain, Addr) -> boolean()</name>
<fsummary>Shall the message be sent</fsummary>
<type>
- <v>Ip = ip_address()</v>
- <v>Port = port()</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddressWithPort()</v>
</type>
<desc>
<p>Called before the sending of a message (after <em>all</em> processing
@@ -122,11 +131,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
</desc>
</func>
<func>
- <name>accept_recv_pdu(Ip, Port, PduType) -> boolean()</name>
+ <name>accept_recv_pdu(Domain, Addr, PduType) -> boolean()</name>
<fsummary>Shall the received pdu be accepted</fsummary>
<type>
- <v>Ip = ip_address()</v>
- <v>Port = port()</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddressWithPort()</v>
<v>PduType = pdu_type()</v>
</type>
<desc>
@@ -144,7 +153,9 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
<type>
<v>Targets = targets()</v>
<v>targets() = [target()]</v>
- <v>target() = {ip_address(), port()}</v>
+ <v>target() = {Domain, Addr}</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddressWithPort()</v>
<v>PduType = pdu_type() > 0</v>
<v>Reply = boolean() | NewTargets</v>
<v>NewTargets = targets()</v>
@@ -155,7 +166,7 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
<p>For the message to be discarded all together, the function
<em>must</em> return <em>false</em>. </p>
<p>Note that it is possible for this function to filter out targets
- (but <em>not</em> add its own) by returning an updated
+ (but <em>not</em> to add its own) by returning an updated
<c>Targets</c> list (<c>NewTargets</c>). </p>
</desc>
</func>
diff --git a/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml b/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml
index c52479f76a..cbae158544 100644
--- a/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml
+++ b/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml
@@ -1,24 +1,25 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
<year>2008</year>
- <year>2009</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
The Initial Developer of the Original Code is Ericsson AB.
</legalnotice>
@@ -45,22 +46,30 @@
must export the following functions: </p>
<list type="bulleted">
<item>
- <p><seealso marker="#delivery_targets">delivery_targets/3</seealso></p>
+ <p><seealso marker="#delivery_targets/3">delivery_targets/3</seealso></p>
</item>
<item>
- <p><seealso marker="#delivery_info">delivery_info/4</seealso></p>
+ <p><seealso marker="#delivery_info/4">delivery_info/4</seealso></p>
</item>
</list>
<p>The semantics of them and their exact signatures are explained
below. </p>
+ <p>Legacy notification delivery information receiver modules
+ used a target argument on the form
+ <c>{IpAddr, PortNumber}</c> instead of
+ <c>{Domain, Addr}</c>, and if the SNMP Agent is run without
+ changing the configuration to use transport domains
+ the notification delivery information receiver will still get
+ the old arguments and work as before.</p>
+
</description>
<section>
<title>DATA TYPES</title>
- <code type="none"><![CDATA[
-address() = A 4-tuple
- ]]></code>
+ <p>See the <seealso marker="snmpa_conf#types">
+ data types in <c>snmpa_conf</c></seealso>.</p>
+ <marker id="accept_recv"></marker>
<marker id="delivery_targets"></marker>
</section>
@@ -71,10 +80,8 @@ address() = A 4-tuple
<fsummary>Inform about target addresses</fsummary>
<type>
<v>Tag = term()</v>
- <v>Targets = [target()]</v>
- <v>target() = {Address, Port}</v>
- <v>Address = address()</v>
- <v>Port = integer()</v>
+ <v>Targets = [Target]</v>
+ <v>Target = {transportDomain(), transportAddressWithPort()</v>
<v>Extra = term()</v>
</type>
<desc>
@@ -94,10 +101,8 @@ address() = A 4-tuple
<fsummary>Inform about delivery result</fsummary>
<type>
<v>Tag = term()</v>
- <v>Target = target()</v>
- <v>target() = {Address, Port}</v>
- <v>Address = address()</v>
- <v>Port = integer()</v>
+ <v>Targets = [Target]</v>
+ <v>Target = {transportDomain(), transportAddressWithPort()</v>
<v>DeliveryResult = delivery_result()</v>
<v>delivery_result() = no_response | got_response</v>
<v>Extra = term()</v>
diff --git a/lib/snmp/doc/src/snmpa_notification_filter.xml b/lib/snmp/doc/src/snmpa_notification_filter.xml
index c3b300ecab..0f16ba4440 100644
--- a/lib/snmp/doc/src/snmpa_notification_filter.xml
+++ b/lib/snmp/doc/src/snmpa_notification_filter.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_supervisor.xml b/lib/snmp/doc/src/snmpa_supervisor.xml
index 89b4eb8d54..86c6fbc350 100644
--- a/lib/snmp/doc/src/snmpa_supervisor.xml
+++ b/lib/snmp/doc/src/snmpa_supervisor.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpc.xml b/lib/snmp/doc/src/snmpc.xml
index 61d19251c5..aba51bb500 100644
--- a/lib/snmp/doc/src/snmpc.xml
+++ b/lib/snmp/doc/src/snmpc.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2011</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpc_cmd.xml b/lib/snmp/doc/src/snmpc_cmd.xml
index 971f8a3cff..e4e710a58c 100644
--- a/lib/snmp/doc/src/snmpc_cmd.xml
+++ b/lib/snmp/doc/src/snmpc_cmd.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE comref SYSTEM "comref.dtd">
<comref>
<header>
<copyright>
- <year>2011</year><year>2011</year>
+ <year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
diff --git a/lib/snmp/doc/src/snmpm.xml b/lib/snmp/doc/src/snmpm.xml
index 8ab3be8e18..4818aeb697 100644
--- a/lib/snmp/doc/src/snmpm.xml
+++ b/lib/snmp/doc/src/snmpm.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2012</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -69,6 +70,9 @@ sec_name() = string()
sec_level() = noAuthNoPriv | authNoPriv | authPriv
]]></code>
+ <p>See also the <seealso marker="snmpa_conf#types">
+ data types in <c>snmpa_conf</c></seealso>.</p>
+
<marker id="monitor"></marker>
</section>
<funcs>
@@ -279,7 +283,6 @@ sec_level = noAuthNoPriv | authNoPriv | authPriv
<fsummary>Register this agent</fsummary>
<type>
<v>UserId = term()</v>
- <v>Addr = ip_address()</v>
<v>TargetName = target_name()</v>
<v>Config = [agent_config()]</v>
<v>agent_config() = {Item, Val}</v>
@@ -301,9 +304,9 @@ sec_level = noAuthNoPriv | authNoPriv | authPriv
<p>The type of <c>Val</c> depends on <c>Item</c>: </p>
<code type="none"><![CDATA[
[mandatory] engine_id = string()
-[mandatory] address = ip_address()
-[optional] port = integer()
-[optional] tdomain = transportDomainUdpIpv4 | transportDomainUdpIpv6
+[mandatory] tadress = transportAddress() % Depends on tdomain
+[optional] port = inet:port_number()
+[optional] tdomain = transportDomain()
[optional] community = string()
[optional] timeout = integer() | snmp_timer()
[optional] max_message_size = integer()
@@ -314,7 +317,8 @@ sec_level = noAuthNoPriv | authNoPriv | authPriv
]]></code>
<p>Note that if no <c>tdomain</c> is given, the default value,
<c>transportDomainUdpIpv4</c>, is used.</p>
- <p>Note that if no <c>port</c> is given, the default value is used.</p>
+ <p>Note that if no <c>port</c> is given and if <c>taddress</c> does not
+ contain a port number, the default value is used.</p>
<marker id="unregister_agent"></marker>
</desc>
@@ -367,7 +371,7 @@ sec_level = noAuthNoPriv | authNoPriv | authPriv
<p>Update agent config. The function <c>update_agent_info/3</c>
should be used when several values needs to be updated atomically. </p>
<p>See function
- <seealso marker="#register_agent">register_agent</seealso>)
+ <seealso marker="#register_agent">register_agent</seealso>
for more info about what kind of items are allowed. </p>
<marker id="which_agents"></marker>
@@ -1210,32 +1214,40 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1
</func>
<func>
- <name>log_to_txt(LogDir, Mibs)</name>
- <name>log_to_txt(LogDir, Mibs, OutFile) -> ok | {error, Reason}</name>
- <name>log_to_txt(LogDir, Mibs, OutFile, LogName) -> ok | {error, Reason}</name>
- <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) -> ok | {error, Reason}</name>
- <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir)</name>
+ <name>log_to_txt(LogDir, Block | Mibs)</name>
+ <name>log_to_txt(LogDir, Mibs, Block | OutFile) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, Block | LogName) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, Block | LogFile) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block | Start) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start) -> ok | {error, Reason}</name>
<name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) -> ok | {error, Reason}</name>
+ <name>log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop) -> ok | {error, Reason}</name>
<fsummary>Convert an Audit Trail Log to text format</fsummary>
<type>
<v>LogDir = string()</v>
<v>Mibs = [MibName]</v>
<v>MibName = string()</v>
+ <v>Block = boolean()</v>
<v>OutFile = string()</v>
<v>LogName = string()</v>
<v>LogFile = string()</v>
- <v>Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} </v>
+ <v>Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} </v>
<v>Reason = disk_log_open_error() | file_open_error() | term()</v>
<v>disk_log_open_error() = {LogName, term()}</v>
<v>file_open_error() = {OutFile, term()}</v>
</type>
<desc>
<p>Converts an Audit Trail Log to a readable text file.
- <c>OutFile</c> defaults to "./snmpm_log.txt".
- <c>LogName</c> defaults to "snmpm_log".
- <c>LogFile</c> defaults to "snmpm.log".
- See <seealso marker="snmp#log_to_txt">snmp:log_to_txt</seealso>
- for more info.</p>
+ <c>OutFile</c> defaults to "./snmpm_log.txt".
+ <c>LogName</c> defaults to "snmpm_log".
+ <c>LogFile</c> defaults to "snmpm.log".</p>
+ <p>The <c>Block</c> argument indicates if the log should be blocked
+ during conversion. This could be usefull when converting large
+ logs (when otherwise the log could wrap during conversion).
+ Defaults to <c>true</c>. </p>
+ <p>See <seealso marker="snmp#log_to_txt">snmp:log_to_txt</seealso>
+ for more info.</p>
<marker id="log_to_io"></marker>
</desc>
@@ -1243,20 +1255,23 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1
<func>
<name>log_to_io(LogDir) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Block | Mibs) -> ok | {error, Reason}</name>
<name>log_to_io(LogDir, Mibs) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs, LogName) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason}</name>
- <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, Block | LogName) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, Block | LogFile) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Block | Start) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start) -> ok | {error, Reason}</name>
<name>log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop) -> ok | {error, Reason}</name>
<fsummary>Convert an Audit Trail Log to text format</fsummary>
<type>
<v>LogDir = string()</v>
<v>Mibs = [MibName]</v>
<v>MibName = string()</v>
+ <v>Block = boolean()</v>
<v>LogName = string()</v>
<v>LogFile = string()</v>
- <v>Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} </v>
+ <v>Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} </v>
<v>Reason = disk_log_open_error() | file_open_error() | term()</v>
<v>disk_log_open_error() = {LogName, term()}</v>
<v>file_open_error() = {OutFile, term()}</v>
@@ -1265,8 +1280,12 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1
<p>Converts an Audit Trail Log to a readable format and
prints it on stdio.
<c>LogName</c> defaults to "snmpm_log".
- <c>LogFile</c> defaults to "snmpm.log".
- See <seealso marker="snmp#log_to_io">snmp:log_to_io</seealso>
+ <c>LogFile</c> defaults to "snmpm.log".</p>
+ <p>The <c>Block</c> argument indicates if the log should be blocked
+ during conversion. This could be usefull when converting large
+ logs (when otherwise the log could wrap during conversion).
+ Defaults to <c>true</c>. </p>
+ <p>See <seealso marker="snmp#log_to_io">snmp:log_to_io</seealso>
for more info.</p>
<marker id="change_log_size"></marker>
diff --git a/lib/snmp/doc/src/snmpm_conf.xml b/lib/snmp/doc/src/snmpm_conf.xml
index 177e29faa3..a3097e5f7e 100644
--- a/lib/snmp/doc/src/snmpm_conf.xml
+++ b/lib/snmp/doc/src/snmpm_conf.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2006</year><year>2009</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -195,14 +196,14 @@
</desc>
</func>
<func>
- <name>agents_entry(UserId, TargetName, Comm, Ip, Port, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel) -> agents_entry()</name>
+ <name>agents_entry(UserId, TargetName, Comm, Domain, Addr, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel) -> agents_entry()</name>
<fsummary>Create an agents entry</fsummary>
<type>
<v>UserId = term()</v>
<v>TargetName = string()</v>
<v>Comm = string()</v>
- <v>Ip = string()</v>
- <v>Port = integer()</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddress()</v>
<v>EngineID = string()</v>
<v>Timeout = integer()</v>
<v>MaxMessageSize = integer()</v>
diff --git a/lib/snmp/doc/src/snmpm_mpd.xml b/lib/snmp/doc/src/snmpm_mpd.xml
index 030c79e0e6..08276e4b30 100644
--- a/lib/snmp/doc/src/snmpm_mpd.xml
+++ b/lib/snmp/doc/src/snmpm_mpd.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -39,7 +40,12 @@
It is supposed to be used from a Network Interface process
(<seealso marker="snmp_manager_netif">Definition of Manager Net if</seealso>).
</p>
+
+ <p>Legacy API function <c>process_msg/7</c> that has got separate
+ <c>IpAddr</c> and <c>PortNumber</c> arguments still works as before
+ for backwards compatibility reasons.</p>
</description>
+
<funcs>
<func>
<name>init_mpd(Vsns) -> mpd_state()</name>
@@ -58,13 +64,12 @@
</desc>
</func>
<func>
- <name>process_msg(Msg, TDomain, Addr, Port, State, NoteStore, Logger) -> {ok, Vsn, Pdu, PduMS, MsgData} | {discarded, Reason}</name>
+ <name>process_msg(Msg, Domain, Addr, State, NoteStore, Logger) -> {ok, Vsn, Pdu, PduMS, MsgData} | {discarded, Reason}</name>
<fsummary>Process a message received from the network</fsummary>
<type>
<v>Msg = binary()</v>
- <v>TDomain = snmpUDPDomain</v>
- <v>Addr = {integer(), integer(), integer(), integer()}</v>
- <v>Port = integer()</v>
+ <v>Domain = transportDomainUdpIpv4 | transportDomainUdpIpv6</v>
+ <v>Addr = {<seealso marker="kernel:inet#type-ip_address">inet:ip_address(), inet:port_number()</seealso>} </v>
<v>State = mpd_state()</v>
<v>NoteStore = pid()</v>
<v>Logger = function()</v>
diff --git a/lib/snmp/doc/src/snmpm_network_interface.xml b/lib/snmp/doc/src/snmpm_network_interface.xml
index 33eb736b8f..73892aa2e8 100644
--- a/lib/snmp/doc/src/snmpm_network_interface.xml
+++ b/lib/snmp/doc/src/snmpm_network_interface.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -69,6 +70,10 @@
<p>The semantics of them and their exact signatures are explained
below. </p>
+ <p>Legacy API function <c>send_pdu/7</c> that has got separate
+ <c>IpAddr</c> and <c>PortNumber</c> arguments still works as before
+ for backwards compatibility reasons.</p>
+
<marker id="start_link"></marker>
</description>
@@ -103,15 +108,15 @@
</func>
<func>
- <name>send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port, ExtraInfo) -> void()</name>
+ <name>send_pdu(Pid, Pdu, Vsn, MsgData, Domain, Addr, ExtraInfo) -> void()</name>
<fsummary>Request the network interface process to send this pdu</fsummary>
<type>
<v>Pid = pid()</v>
<v>Pdu = pdu()</v>
<v>Vsn = 'version-1' | 'version-2' | 'version-3'</v>
<v>MsgData = term()</v>
- <v>Addr = address()</v>
- <v>Port = integer()</v>
+ <v>Domain = transportDomainUdpIpv4 | transportDomainUdpIpv6</v>
+ <v>Addr = {<seealso marker="kernel:inet#type-ip_address">inet:ip_address(), inet:port_number()</seealso>} </v>
<v>ExtraInfo = term()</v>
</type>
<desc>
diff --git a/lib/snmp/doc/src/snmpm_network_interface_filter.xml b/lib/snmp/doc/src/snmpm_network_interface_filter.xml
index 4dc133dd71..742cd53fc6 100644
--- a/lib/snmp/doc/src/snmpm_network_interface_filter.xml
+++ b/lib/snmp/doc/src/snmpm_network_interface_filter.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2007</year><year>2012</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -76,6 +77,12 @@
The default filter accepts all messages.</p>
<p>A network interface filter can e.g. be used during testing or for load
regulation. </p>
+ <p>Legacy network interface filter modules used arguments on the form
+ <c>(IpAddr, PortNumber,...)</c> instead of
+ <c>(Domain, Addr, ...)</c>, and if the SNMP manager is run without
+ changing the configuration to use transport domains
+ the network interface filter will still get
+ the old arguments and work as before.</p>
</description>
<section>
@@ -86,16 +93,18 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
'set-request' | trap | 'get-bulk-request' | 'inform-request' |
report | trappdu
</code>
+ <p>See also the <seealso marker="snmpa_conf#types">
+ data types in <c>snmpa_conf</c></seealso>.</p>
<marker id="accept_recv"></marker>
</section>
<funcs>
<func>
- <name>accept_recv(Addr, Port) -> boolean()</name>
+ <name>accept_recv(Domain, Addr) -> boolean()</name>
<fsummary>Shall the received message be accepted</fsummary>
<type>
- <v>Addr = ip_address()</v>
- <v>Port = port()</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddressWithPort()</v>
</type>
<desc>
<p>Called at the reception of a message (before <em>any</em> processing
@@ -107,11 +116,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
</func>
<func>
- <name>accept_send(Addr, Port) -> boolean()</name>
+ <name>accept_send(Domain, Addr) -> boolean()</name>
<fsummary>Shall the message be sent</fsummary>
<type>
- <v>Addr = ip_address()</v>
- <v>Port = port()</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddressWithPort()</v>
</type>
<desc>
<p>Called before the sending of a message (after <em>all</em> processing
@@ -123,11 +132,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
</func>
<func>
- <name>accept_recv_pdu(Addr, Port, PduType) -> boolean()</name>
+ <name>accept_recv_pdu(Domain, Addr, PduType) -> boolean()</name>
<fsummary>Shall the received pdu be accepted</fsummary>
<type>
- <v>Addr = ip_address()</v>
- <v>Port = port()</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddressWithPort()</v>
<v>PduType = pdu_type()</v>
</type>
<desc>
@@ -141,11 +150,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
</func>
<func>
- <name>accept_send_pdu(Addr, Port, PduType) -> boolean()</name>
+ <name>accept_send_pdu(Domain, Addr, PduType) -> boolean()</name>
<fsummary>Shall the pdu be sent</fsummary>
<type>
- <v>Addr = ip_address()</v>
- <v>Port = port()</v>
+ <v>Domain = transportDomain()</v>
+ <v>Addr = transportAddressWithPort()</v>
<v>PduType = pdu_type() > 0</v>
</type>
<desc>
diff --git a/lib/snmp/doc/src/snmpm_user.xml b/lib/snmp/doc/src/snmpm_user.xml
index 1823e0c815..87ae1d224a 100644
--- a/lib/snmp/doc/src/snmpm_user.xml
+++ b/lib/snmp/doc/src/snmpm_user.xml
@@ -1,23 +1,24 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
</legalnotice>
@@ -56,40 +57,64 @@
<item>
<p>handle_report/3</p>
</item>
+ <item>
+ <p>handle_invalid_result/2</p>
+ </item>
</list>
<p>The semantics of them and their exact signatures are explained
- below. </p>
- <p>Note that if an agent is registered using the old, no longer
- documented, functions (using Addr and Port), the old variant of the
- callback functions, handle_pdu, handle_trap, handle_inform and
- handle_report, will be called. </p>
+ below. </p>
+ <p>Some of the function has no defined return value (<c>void()</c>),
+ they can of course return anything. But the functions that do have
+ specified return value(s) <em>must</em> adhere to this. None of the
+ functions can use exit of throw to return. </p>
- <marker id="handle_error"></marker>
+ <p>If the manager is not configured to use any particular
+ transport domain, the behaviour <c>handle_agent/4</c>
+ will for backwards copmpatibility reasons be called with the old
+ <c>IpAddr</c> and <c>PortNumber</c> arguments</p>
+
+ <marker id="types"></marker>
</description>
+
+ <section>
+ <title>DATA TYPES</title>
+ <code type="none"><![CDATA[
+snmp_gen_info() = {ErrorStatus :: atom(),
+ ErrorIndex :: pos_integer(),
+ Varbinds :: [snmp:varbind()]}
+snmp_v1_trap_info() :: {Enteprise :: snmp:oid(),
+ Generic :: integer(),
+ Spec :: integer(),
+ Timestamp :: integer(),
+ Varbinds :: [snmp:varbind()]}
+ ]]></code>
+ <marker id="handle_error"></marker>
+ </section>
+
<funcs>
<func>
- <name>handle_error(ReqId, Reason, UserData) -> Reply</name>
+ <name>handle_error(ReqId, Reason, UserData) -> void()</name>
<fsummary>Handle error</fsummary>
<type>
<v>ReqId = integer()</v>
<v>Reason = {unexpected_pdu, SnmpInfo} | {invalid_sec_info, SecInfo, SnmpInfo} | {empty_message, Addr, Port} | term()</v>
+ <v>SnmpInfo = snmp_gen_info()</v>
+ <v>SecInfo = term()</v>
<v>Addr = ip_address()</v>
<v>Port = integer()</v>
<v>UserData = term()</v>
- <v>Reply = ignore</v>
</type>
<desc>
<p>This function is called when the manager needs to
- communicate an "asynchronous" error, to the user:
- e.g. failure to send an asynchronous message (i.e. encoding
- error), a received message was discarded due to security
- error, the manager failed to generate a response message to
- a received inform-request, or when receiving an unexpected
- PDU from an agent (could be an expired async request). </p>
- <p>If <c>ReqId</c> is less then 0, it means that this
- information was not available to the manager (that info was
- never retrieved before the message was discarded).
- </p>
+ communicate an "asynchronous" error to the user:
+ e.g. failure to send an asynchronous message (i.e. encoding
+ error), a received message was discarded due to security
+ error, the manager failed to generate a response message to
+ a received inform-request, or when receiving an unexpected
+ PDU from an agent (could be an expired async request). </p>
+ <p>If <c>ReqId</c> is less then 0, it means that this
+ information was not available to the manager (that info was
+ never retrieved before the message was discarded). </p>
<p>For <c>SnmpInfo</c> see handle_agent below.</p>
<marker id="handle_agent"></marker>
@@ -97,29 +122,29 @@
</func>
<func>
- <name>handle_agent(Addr, Port, Type, SnmpInfo, UserData) -> Reply</name>
+ <name>handle_agent(Domain, Addr, Type, SnmpInfo, UserData) -> Reply</name>
<fsummary>Handle agent</fsummary>
<type>
- <v>Addr = ip_address()</v>
- <v>Port = integer()</v>
+ <v>Domain = transportDomainUdpIpv4 | transportDomainUdpIpv6</v>
+ <v>Addr = {<seealso marker="kernel:inet#type-ip_address">inet:ip_address(), inet:port_number()</seealso>} </v>
<v>Type = pdu | trap | report | inform</v>
<v>SnmpInfo = SnmpPduInfo | SnmpTrapInfo | SnmpReportInfo | SnmpInformInfo</v>
- <v>ErrorStatus = atom()</v>
- <v>ErrorIndex = integer()</v>
- <v>Varbinds = [varbind()]</v>
- <v>varbind() = #varbind</v>
+ <v>SnmpPduInfo = snmp_gen_info()</v>
+ <v>SnmpTrapInfo = snmp_v1_trap_info()</v>
+ <v>SnmpReportInfo = snmp_gen_info()</v>
+ <v>SnmpInformInfo = snmp_gen_info()</v>
<v>UserData = term()</v>
- <v>Reply = ignore | {register, UserId, TargetName, agent_info()}</v>
+ <v>Reply = ignore | {register, UserId, TargetName, AgentConfig}</v>
<v>UserId = term()</v>
<v>TargetName = target_name()</v>
- <v>agent_info() = [{agent_info_item(), agent_info_value()}]</v>
+ <v>AgentConfig = [agent_config()]</v>
</type>
<desc>
- <p>This function is called when a message is received from an
- unknown agent.</p>
+ <p>This function is called when a message is received from an
+ unknown agent.</p>
<p>Note that this will always be the default user that is called.</p>
- <p>For more info about the <c>agent_info()</c>, see
- <seealso marker="snmpm#register_agent">register_agent</seealso>.</p>
+ <p>For more info about the <c>agent_config()</c>, see
+ <seealso marker="snmpm#register_agent">register_agent</seealso>.</p>
<p>The arguments <c>Type</c> and <c>SnmpInfo</c> relates in the
following way: </p>
@@ -148,7 +173,7 @@
</list>
<p>The only user which would return
- <c>{register, UserId, TargetName, agent_info()}</c> is the
+ <c>{register, UserId, TargetName, AgentConfig}</c> is the
<em>default user</em>.</p>
<marker id="handle_pdu"></marker>
@@ -156,18 +181,13 @@
</func>
<func>
- <name>handle_pdu(TargetName, ReqId, SnmpPduInfo, UserData) -> Reply</name>
+ <name>handle_pdu(TargetName, ReqId, SnmpPduInfo, UserData) -> void()</name>
<fsummary>Handle the reply to an asynchronous request</fsummary>
<type>
<v>TargetName = target_name()</v>
<v>ReqId = term()</v>
- <v>SnmpPduInfo = {ErrorStatus, ErrorIndex, Varbinds}</v>
- <v>ErrorStatus = atom()</v>
- <v>ErrorIndex = integer()</v>
- <v>Varbinds = [varbind()]</v>
- <v>varbind() = #varbind</v>
+ <v>SnmpPduInfo = snmp_gen_info()</v>
<v>UserData = term()</v>
- <v>Reply = ignore</v>
</type>
<desc>
<p>Handle the reply to an asynchronous request, such as
@@ -186,27 +206,19 @@
<fsummary>Handle a trap/notification message</fsummary>
<type>
<v>TargetName = TargetName2 = target_name()</v>
- <v>SnmpTrapInfo = {Enteprise, Generic, Spec, Timestamp, Varbinds} | {ErrorStatus, ErrorIndex, Varbinds}</v>
- <v>Enterprise = oid()</v>
- <v>Generic = integer()</v>
- <v>Spec = integer()</v>
- <v>Timestamp = integer()</v>
- <v>ErrorStatus = atom()</v>
- <v>ErrorIndex = integer()</v>
- <v>Varbinds = [varbind()]</v>
- <v>varbind() = #varbind</v>
+ <v>SnmpTrapInfo = snmp_v1_trap_info() | snmp_gen_info()</v>
<v>UserData = term()</v>
- <v>Reply = ignore | unregister | {register, UserId, TargetName2, agent_info()}</v>
+ <v>Reply = ignore | unregister | {register, UserId, TargetName2, AgentConfig}</v>
<v>UserId = term()</v>
- <v>agent_info() = [{agent_info_item(), agent_info_value()}]</v>
+ <v>AgentConfig = [agent_config()]</v>
</type>
<desc>
<p>Handle a trap/notification message from an agent.</p>
- <p>For more info about the <c>agent_info()</c>, see
- <seealso marker="snmpm#register_agent">register_agent</seealso></p>
+ <p>For more info about the <c>agent_config()</c>, see
+ <seealso marker="snmpm#register_agent">register_agent</seealso></p>
<p>The only user which would return
- <c>{register, UserId, TargetName2, agent_info()}</c> is the
- <em>default user</em>.</p>
+ <c>{register, UserId, TargetName2, agent_info()}</c> is the
+ <em>default user</em>.</p>
<marker id="handle_inform"></marker>
</desc>
@@ -217,29 +229,25 @@
<fsummary>Handle a inform message</fsummary>
<type>
<v>TargetName = TargetName2 = target_name()</v>
- <v>SnmpInformInfo = {ErrorStatus, ErrorIndex, Varbinds}</v>
- <v>ErrorStatus = atom()</v>
- <v>ErrorIndex = integer()</v>
- <v>Varbinds = [varbind()]</v>
- <v>varbind() = #varbind</v>
+ <v>SnmpInformInfo = snmp_gen_info()</v>
<v>UserData = term()</v>
- <v>Reply = ignore | unregister | {register, UserId, TargetName2, agent_info()}</v>
+ <v>Reply = ignore | no_reply | unregister | {register, UserId, TargetName2, AgentConfig}</v>
<v>UserId = term()</v>
- <v>agent_info() = [{agent_info_item(), agent_info_value()}]</v>
+ <v>AgentConfig = [agent_config()]</v>
</type>
<desc>
<p>Handle a inform message.</p>
- <p>For more info about the <c>agent_info()</c>, see
- <seealso marker="snmpm#register_agent">register_agent</seealso></p>
+ <p>For more info about the <c>agent_config()</c>, see
+ <seealso marker="snmpm#register_agent">register_agent</seealso></p>
<p>The only user which would return
- <c>{register, UserId, TargetName2, agent_info()}</c> is the
- <em>default user</em>.</p>
- <p>If the
- <seealso marker="snmp_app">inform request behaviour</seealso>
- configuration option is set to <c>user</c> or
- <c>{user, integer()}</c>, the response (acknowledgment) to this
- inform-request will be sent when this function returns.</p>
-
+ <c>{register, UserId, TargetName2, AgentConfig}</c> is the
+ <em>default user</em>.</p>
+ <p>If the
+ <seealso marker="snmp_app">inform request behaviour</seealso>
+ configuration option is set to <c>user</c> or
+ <c>{user, integer()}</c>, the response (acknowledgment) to this
+ inform-request will be sent when this function returns.</p>
+
<marker id="handle_report"></marker>
</desc>
</func>
@@ -251,23 +259,46 @@
<v>TargetName = TargetName2 = target_name()</v>
<v>Addr = ip_address()</v>
<v>Port = integer()</v>
- <v>SnmpReportInfo = {ErrorStatus, ErrorIndex, Varbinds}</v>
- <v>ErrorStatus = atom()</v>
- <v>ErrorIndex = integer()</v>
- <v>Varbinds = [varbind()]</v>
- <v>varbind() = #varbind</v>
+ <v>SnmpReportInfo = snmp_gen_info()</v>
<v>UserData = term()</v>
- <v>Reply = ignore | unregister | {register, UserId, TargetName2, agent_info()}</v>
+ <v>Reply = ignore | unregister | {register, UserId, TargetName2, AgentConfig}</v>
<v>UserId = term()</v>
- <v>agent_info() = [{agent_info_item(), agent_info_value()}]</v>
+ <v>AgentConfig = [agent_config()]</v>
</type>
<desc>
<p>Handle a report message.</p>
- <p>For more info about the <c>agent_info()</c>, see
- <seealso marker="snmpm#register_agent">register_agent</seealso></p>
+ <p>For more info about the <c>agent_config()</c>, see
+ <seealso marker="snmpm#register_agent">register_agent</seealso></p>
<p>The only user which would return
- <c>{register, UserId, TargetName2, agent_info()}</c> is the
- <em>default user</em>.</p>
+ <c>{register, UserId, TargetName2, AgentConfig}</c> is the
+ <em>default user</em>.</p>
+
+ <marker id="handle_invalid_result"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>handle_invalid_result(IN, OUT) -> void()</name>
+ <fsummary>Handle a report message</fsummary>
+ <type>
+ <v>IN = {Func, Args}</v>
+ <v>Func = atom()</v>
+ <v>Args = list()</v>
+ <v>OUT = {crash, CrashInfo} | {result, InvalidResult}</v>
+ <v>CrashInfo = {ErrorType, Error, Stacktrace}</v>
+ <v>ErrorType = atom()</v>
+ <v>Error = term()</v>
+ <v>Stacktrace = list()</v>
+ <v>InvalidResult = term()</v>
+ </type>
+ <desc>
+ <p>If <em>any</em> of the <em>other</em> callback functions crashes
+ (exit, throw or a plain crash) or return an invalid result (if a valid
+ return has been specified), this function is called.
+ The purpose is to allow the user handle this
+ error (for instance to issue an error report).</p>
+ <p><c>IN</c> reprecents the function called (and its arguments).
+ <c>OUT</c> represents the unexpected/invalid result. </p>
</desc>
</func>
</funcs>
diff --git a/lib/snmp/doc/src/structure.ps b/lib/snmp/doc/src/structure.ps
deleted file mode 100644
index ffb345eb6a..0000000000
--- a/lib/snmp/doc/src/structure.ps
+++ /dev/null
@@ -1,170 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: bild2.fig
-%%Creator: fig2dev Version 3.1 Patchlevel 2
-%%CreationDate: Mon Jan 3 10:34:34 2000
-%%For: nibe@gundor (Bengt Nilsson, ETX/DN/SP)
-%Magnification: 1.00
-%%Orientation: Portrait
-%%BoundingBox: 0 0 376 308
-%%Pages: 0
-%%BeginSetup
-%%IncludeFeature: *PageSize Letter
-%%EndSetup
-%%EndComments
-/$F2psDict 200 dict def
-$F2psDict begin
-$F2psDict /mtrx matrix put
-/col-1 {0 setgray} bind def
-/col0 {0.000 0.000 0.000 srgb} bind def
-/col1 {0.000 0.000 1.000 srgb} bind def
-/col2 {0.000 1.000 0.000 srgb} bind def
-/col3 {0.000 1.000 1.000 srgb} bind def
-/col4 {1.000 0.000 0.000 srgb} bind def
-/col5 {1.000 0.000 1.000 srgb} bind def
-/col6 {1.000 1.000 0.000 srgb} bind def
-/col7 {1.000 1.000 1.000 srgb} bind def
-/col8 {0.000 0.000 0.560 srgb} bind def
-/col9 {0.000 0.000 0.690 srgb} bind def
-/col10 {0.000 0.000 0.820 srgb} bind def
-/col11 {0.530 0.810 1.000 srgb} bind def
-/col12 {0.000 0.560 0.000 srgb} bind def
-/col13 {0.000 0.690 0.000 srgb} bind def
-/col14 {0.000 0.820 0.000 srgb} bind def
-/col15 {0.000 0.560 0.560 srgb} bind def
-/col16 {0.000 0.690 0.690 srgb} bind def
-/col17 {0.000 0.820 0.820 srgb} bind def
-/col18 {0.560 0.000 0.000 srgb} bind def
-/col19 {0.690 0.000 0.000 srgb} bind def
-/col20 {0.820 0.000 0.000 srgb} bind def
-/col21 {0.560 0.000 0.560 srgb} bind def
-/col22 {0.690 0.000 0.690 srgb} bind def
-/col23 {0.820 0.000 0.820 srgb} bind def
-/col24 {0.500 0.190 0.000 srgb} bind def
-/col25 {0.630 0.250 0.000 srgb} bind def
-/col26 {0.750 0.380 0.000 srgb} bind def
-/col27 {1.000 0.500 0.500 srgb} bind def
-/col28 {1.000 0.630 0.630 srgb} bind def
-/col29 {1.000 0.750 0.750 srgb} bind def
-/col30 {1.000 0.880 0.880 srgb} bind def
-/col31 {1.000 0.840 0.000 srgb} bind def
-
-end
-save
--143.0 361.0 translate
-1 -1 scale
-
-/cp {closepath} bind def
-/ef {eofill} bind def
-/gr {grestore} bind def
-/gs {gsave} bind def
-/sa {save} bind def
-/rs {restore} bind def
-/l {lineto} bind def
-/m {moveto} bind def
-/rm {rmoveto} bind def
-/n {newpath} bind def
-/s {stroke} bind def
-/sh {show} bind def
-/slc {setlinecap} bind def
-/slj {setlinejoin} bind def
-/slw {setlinewidth} bind def
-/srgb {setrgbcolor} bind def
-/rot {rotate} bind def
-/sc {scale} bind def
-/sd {setdash} bind def
-/ff {findfont} bind def
-/sf {setfont} bind def
-/scf {scalefont} bind def
-/sw {stringwidth} bind def
-/tr {translate} bind def
-/tnt {dup dup currentrgbcolor
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
- bind def
-/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
- 4 -2 roll mul srgb} bind def
-/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
-/$F2psEnd {$F2psEnteredState restore end} def
-%%EndProlog
-
-$F2psBegin
-10 setmiterlimit
-n 0 792 m 0 0 l 612 0 l 612 792 l cp clip
- 0.06000 0.06000 sc
-/Times-Roman ff 180.00 scf sf
-5850 2550 m
-gs 1 -1 sc (\(associate a MIB object with) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-5850 2775 m
-gs 1 -1 sc (snmp_generic:table_funct) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-5850 3000 m
-gs 1 -1 sc (snmp_generic:variable_func\)) col-1 sh gr
-7.500 slw
-% Polyline
-n 4200 3150 m 4200 3450 l gs col-1 s gr
-% Polyline
-n 3600 1275 m 4800 1275 l 4800 1725 l 3600 1725 l cp gs col-1 s gr
-% Polyline
-n 3600 1725 m 4800 1725 l 4800 2100 l 3600 2100 l cp gs col-1 s gr
-% Polyline
-n 4200 2100 m 4200 2775 l gs col-1 s gr
-% Polyline
-n 3000 3450 m 5400 3450 l 5400 3975 l 3000 3975 l cp gs col-1 s gr
-% Polyline
-n 4200 3975 m 5400 3975 l 5400 4500 l 4200 4500 l cp gs col-1 s gr
-% Polyline
-n 3000 5025 m 4200 5025 l 4200 5550 l 3000 5550 l cp gs col-1 s gr
-% Polyline
-n 3000 3975 m 4200 3975 l 4200 4500 l 3000 4500 l cp gs col-1 s gr
-% Polyline
-n 3000 4500 m 4200 4500 l 4200 5025 l 3000 5025 l cp gs col-1 s gr
-% Polyline
-n 2400 900 m 8625 900 l 8625 6000 l 2400 6000 l cp gs col-1 s gr
-% Polyline
-n 8625 6000 m 8625 6000 l 8625 6000 l 8625 6000 l cp gs col-1 s gr
-/Times-Roman ff 180.00 scf sf
-3525 3000 m
-gs 1 -1 sc (Assosiacition file) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3750 1575 m
-gs 1 -1 sc (SNMP Agent) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-4050 1950 m
-gs 1 -1 sc (MIB) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3075 4275 m
-gs 1 -1 sc (snmp_local_db) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-4500 4275 m
-gs 1 -1 sc (Mnesia) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3450 4800 m
-gs 1 -1 sc (pets) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3450 5325 m
-gs 1 -1 sc (ets) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-3600 3825 m
-gs 1 -1 sc (snmp_generic) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-5925 3600 m
-gs 1 -1 sc (Support for get-next,) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-5925 3825 m
-gs 1 -1 sc (RowStatus operations) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-6000 4275 m
-gs 1 -1 sc (Database) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-6000 4800 m
-gs 1 -1 sc (Adds persistent properties) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-6000 5025 m
-gs 1 -1 sc (to ets) col-1 sh gr
-/Times-Roman ff 180.00 scf sf
-6000 5475 m
-gs 1 -1 sc (The standard Erlang module) col-1 sh gr
-$F2psEnd
-rs
diff --git a/lib/snmp/examples/Makefile b/lib/snmp/examples/Makefile
index 341107ce30..39ea5f74db 100644
--- a/lib/snmp/examples/Makefile
+++ b/lib/snmp/examples/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/examples/ex1/Makefile b/lib/snmp/examples/ex1/Makefile
index 8d10476b30..a3d02ea778 100644
--- a/lib/snmp/examples/ex1/Makefile
+++ b/lib/snmp/examples/ex1/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/examples/ex1/ex1.erl b/lib/snmp/examples/ex1/ex1.erl
index 3618cd3b8c..c525ae4d6a 100644
--- a/lib/snmp/examples/ex1/ex1.erl
+++ b/lib/snmp/examples/ex1/ex1.erl
@@ -3,16 +3,17 @@
%% <holder>Ericsson AB, All Rights Reserved</holder>
%%</copyright>
%%<legalnotice>
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% The Initial Developer of the Original Code is Ericsson AB.
%%</legalnotice>
diff --git a/lib/snmp/examples/ex2/Makefile b/lib/snmp/examples/ex2/Makefile
index a85ff8e4e2..624a1df2ee 100644
--- a/lib/snmp/examples/ex2/Makefile
+++ b/lib/snmp/examples/ex2/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2012. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/examples/ex2/snmp_ex2_manager.erl b/lib/snmp/examples/ex2/snmp_ex2_manager.erl
index 1b247d713d..939f9f2b4d 100644
--- a/lib/snmp/examples/ex2/snmp_ex2_manager.erl
+++ b/lib/snmp/examples/ex2/snmp_ex2_manager.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -43,7 +44,8 @@
handle_pdu/4,
handle_trap/3,
handle_inform/3,
- handle_report/3]).
+ handle_report/3,
+ handle_invalid_result/3]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
@@ -406,5 +408,9 @@ handle_report(TargetName, SnmpReport, Server) when is_pid(Server) ->
report_callback(Server, handle_inform, {TargetName, SnmpReport}),
ok.
+handle_invalid_result(In, Out, Server) when is_pid(Server) ->
+ report_callback(Server, handle_invalid_result, {In, Out}),
+ ok.
+
report_callback(Pid, Tag, Info) ->
Pid ! {snmp_callback, Tag, Info}.
diff --git a/lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl b/lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl
index 81939dd614..e8f748c337 100644
--- a/lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl
+++ b/lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/examples/subdirs.mk b/lib/snmp/examples/subdirs.mk
index 9f4b69951e..b6a1709369 100644
--- a/lib/snmp/examples/subdirs.mk
+++ b/lib/snmp/examples/subdirs.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/include/.gitignore b/lib/snmp/include/.gitignore
new file mode 100644
index 0000000000..4db987f64a
--- /dev/null
+++ b/lib/snmp/include/.gitignore
@@ -0,0 +1,4 @@
+*.hrl
+!SNMPv2-TC.hrl
+!snmp_tables.hrl
+!snmp_types.hrl
diff --git a/lib/snmp/include/SNMPv2-TC.hrl b/lib/snmp/include/SNMPv2-TC.hrl
index 231be39220..21797f9227 100644
--- a/lib/snmp/include/SNMPv2-TC.hrl
+++ b/lib/snmp/include/SNMPv2-TC.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/include/snmp_tables.hrl b/lib/snmp/include/snmp_tables.hrl
index 4eea5ec282..d6fa00ca43 100644
--- a/lib/snmp/include/snmp_tables.hrl
+++ b/lib/snmp/include/snmp_tables.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/include/snmp_types.hrl b/lib/snmp/include/snmp_types.hrl
index 399379a49b..ffe30996dc 100644
--- a/lib/snmp/include/snmp_types.hrl
+++ b/lib/snmp/include/snmp_types.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/mibs/Makefile.in b/lib/snmp/mibs/Makefile.in
index 5c1f855fad..2350194077 100644
--- a/lib/snmp/mibs/Makefile.in
+++ b/lib/snmp/mibs/Makefile.in
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
@@ -141,11 +142,11 @@ OTP_MIBDIR = $(shell if test -d ../../otp_mibs; then echo otp_mibs; \
debug opt: $(TARGET_FILES)
$(ERL_TOP)/lib/snmp/bin/snmp-v2tov1: $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1.src
- $(PERL) -p -e 's?%PERL%?$(PERL)? ' < $< > $@
- chmod 755 $@
+ $(gen_verbose)$(PERL) -p -e 's?%PERL%?$(PERL)? ' < $< > $@
+ $(V_at)chmod 755 $@
$(SNMP_BIN_TARGET_DIR)/OTP-REG.bin: $(ERL_TOP)/lib/$(OTP_MIBDIR)/mibs/OTP-REG.mib
- $(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $<
+ $(snmp_verbose)$(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $<
# To support parallel make, we'll need explicit dependencies
# to ensure that an imported MIB has been compiled when it's needed.
@@ -214,7 +215,7 @@ info:
@echo "RELSYSDIR = "$(RELSYSDIR)""
v1/%.mib.v1: %.mib $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1
- $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $<
+ $(gen_verbose)$(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $<
# ----------------------------------------------------
diff --git a/lib/snmp/priv/conf/Makefile b/lib/snmp/priv/conf/Makefile
index 341107ce30..39ea5f74db 100644
--- a/lib/snmp/priv/conf/Makefile
+++ b/lib/snmp/priv/conf/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/priv/conf/agent/Makefile b/lib/snmp/priv/conf/agent/Makefile
index 3082889dc8..e905f55999 100644
--- a/lib/snmp/priv/conf/agent/Makefile
+++ b/lib/snmp/priv/conf/agent/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/priv/conf/agent/files.mk b/lib/snmp/priv/conf/agent/files.mk
index 2f81515af9..bccf162ef5 100644
--- a/lib/snmp/priv/conf/agent/files.mk
+++ b/lib/snmp/priv/conf/agent/files.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/priv/conf/manager/Makefile b/lib/snmp/priv/conf/manager/Makefile
index a04c227754..27024c171f 100644
--- a/lib/snmp/priv/conf/manager/Makefile
+++ b/lib/snmp/priv/conf/manager/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/priv/conf/manager/files.mk b/lib/snmp/priv/conf/manager/files.mk
index 61dde77d93..db52a3712f 100644
--- a/lib/snmp/priv/conf/manager/files.mk
+++ b/lib/snmp/priv/conf/manager/files.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/priv/conf/subdirs.mk b/lib/snmp/priv/conf/subdirs.mk
index b3e159b0e4..c17f5db483 100644
--- a/lib/snmp/priv/conf/subdirs.mk
+++ b/lib/snmp/priv/conf/subdirs.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/priv/mibs/.gitignore b/lib/snmp/priv/mibs/.gitignore
index e69de29bb2..a8a0dcec44 100644
--- a/lib/snmp/priv/mibs/.gitignore
+++ b/lib/snmp/priv/mibs/.gitignore
@@ -0,0 +1 @@
+*.bin
diff --git a/lib/snmp/src/Makefile b/lib/snmp/src/Makefile
index 341107ce30..39ea5f74db 100644
--- a/lib/snmp/src/Makefile
+++ b/lib/snmp/src/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/agent/Makefile b/lib/snmp/src/agent/Makefile
index beed696648..2943a4d550 100644
--- a/lib/snmp/src/agent/Makefile
+++ b/lib/snmp/src/agent/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/agent/depend.mk b/lib/snmp/src/agent/depend.mk
index ea9261e266..8eba50fa3b 100644
--- a/lib/snmp/src/agent/depend.mk
+++ b/lib/snmp/src/agent/depend.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
@@ -77,10 +78,6 @@ $(EBIN)/snmpa_error_logger.$(EMULATOR): \
snmpa_error_report.erl \
snmpa_error_logger.erl
-$(EBIN)/snmpa_general_db.$(EMULATOR): \
- snmpa_general_db.erl \
- ../misc/snmp_verbosity.hrl
-
$(EBIN)/snmpa_local_db.$(EMULATOR): \
snmpa_local_db.erl \
../misc/snmp_debug.hrl \
@@ -88,6 +85,18 @@ $(EBIN)/snmpa_local_db.$(EMULATOR): \
../../include/snmp_types.hrl \
../../include/STANDARD-MIB.hrl
+$(EBIN)/snmpa_mib_storage.$(EMULATOR): \
+ snmpa_mib_storage.erl
+
+$(EBIN)/snmpa_mib_storage_ets.$(EMULATOR): \
+ snmpa_mib_storage_ets.erl
+
+$(EBIN)/snmpa_mib_storage_dets.$(EMULATOR): \
+ snmpa_mib_storage_dets.erl
+
+$(EBIN)/snmpa_mib_storage_mnesia.$(EMULATOR): \
+ snmpa_mib_storage_mnesia.erl
+
$(EBIN)/snmpa_mib.$(EMULATOR): \
snmpa_mib.erl \
../misc/snmp_debug.hrl \
@@ -96,6 +105,10 @@ $(EBIN)/snmpa_mib.$(EMULATOR): \
$(EBIN)/snmpa_mib_data.$(EMULATOR): \
snmpa_mib_data.erl \
+ ../../include/snmp_types.hrl
+
+$(EBIN)/snmpa_mib_data_tttn.$(EMULATOR): \
+ snmpa_mib_data_tttn.erl \
../misc/snmp_debug.hrl \
../misc/snmp_verbosity.hrl \
../../include/snmp_types.hrl
diff --git a/lib/snmp/src/agent/modules.mk b/lib/snmp/src/agent/modules.mk
index 33ab41b434..0f8615588a 100644
--- a/lib/snmp/src/agent/modules.mk
+++ b/lib/snmp/src/agent/modules.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
@@ -21,15 +22,21 @@ BEHAVIOUR_MODULES = \
snmpa_authentication_service \
snmpa_discovery_handler \
snmpa_error_report \
+ snmpa_mib_storage \
+ snmpa_mib_data \
snmpa_network_interface \
snmpa_network_interface_filter \
snmpa_notification_delivery_info_receiver \
snmpa_notification_filter \
snmpa_set_mechanism
+# snmpa is "plain" interface module but also defines some agent specific types
+# and therefor must be compiled before the modules that use them, including
+# the behaviour modules...
+# snmpa_mib_data_ttln
MODULES = \
- $(BEHAVIOUR_MODULES) \
snmpa \
+ $(BEHAVIOUR_MODULES) \
snmpa_acm \
snmpa_agent \
snmpa_agent_sup \
@@ -39,10 +46,12 @@ MODULES = \
snmpa_error \
snmpa_error_io \
snmpa_error_logger \
- snmpa_general_db \
snmpa_local_db \
+ snmpa_mib_storage_ets \
+ snmpa_mib_storage_dets \
+ snmpa_mib_storage_mnesia \
snmpa_mib \
- snmpa_mib_data \
+ snmpa_mib_data_tttn \
snmpa_mib_lib \
snmpa_misc_sup \
snmpa_mpd \
diff --git a/lib/snmp/src/agent/snmp_community_mib.erl b/lib/snmp/src/agent/snmp_community_mib.erl
index 7bdd500727..9fd7b30f9f 100644
--- a/lib/snmp/src/agent/snmp_community_mib.erl
+++ b/lib/snmp/src/agent/snmp_community_mib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -31,6 +32,7 @@
-include("snmpa_internal.hrl").
-include("SNMP-COMMUNITY-MIB.hrl").
-include("SNMP-TARGET-MIB.hrl").
+-include("SNMPv2-TM.hrl").
-include("SNMPv2-TC.hrl").
-include("snmp_types.hrl").
@@ -129,10 +131,11 @@ read_community_config_files(Dir) ->
[FileName, D, Reason]),
ok
end,
- Filter = fun(Comms) -> Comms end,
- Check = fun(Entry) -> check_community(Entry) end,
+ Order = fun snmp_conf:no_order/2,
+ Filter = fun snmp_conf:no_filter/1,
+ Check = fun(Entry, State) -> {check_community(Entry), State} end,
[Comms] =
- snmp_conf:read_files(Dir, [{Gen, Filter, Check, "community.conf"}]),
+ snmp_conf:read_files(Dir, [{FileName, Gen, Order, Check, Filter}]),
Comms.
check_community({Index, CommunityName, SecName, CtxName, TransportTag}) ->
@@ -192,7 +195,7 @@ add_community(Idx, CommName, SecName, EngineId, CtxName, TransportTag) ->
do_add_community(Community).
do_add_community(Community) ->
- case (catch check_community(Community)) of
+ try check_community(Community) of
{ok, Row} ->
Key = element(1, Row),
case table_cre_row(snmpCommunityTable, Key, Row) of
@@ -201,11 +204,12 @@ do_add_community(Community) ->
{ok, Key};
false ->
{error, create_failed}
- end;
+ end
+ catch
{error, Reason} ->
{error, Reason};
- Error ->
- {error, Error}
+ Class:Reason ->
+ {error, {Class, Reason, erlang:get_stacktrace()}}
end.
%% FIXME: does not work with mnesia
@@ -243,6 +247,10 @@ gc_tabs() ->
%%-----------------------------------------------------------------
community2vacm(Community, Addr) ->
Idxs = ets:lookup(snmp_community_cache, Community),
+ ?vtrace("community2vacm ->~n"
+ " Community: ~p~n"
+ " Addr: ~p~n"
+ " Idxs: ~p", [Community, Addr, Idxs]),
loop_c2v_rows(lists:keysort(2, Idxs), Addr).
loop_c2v_rows([{_, CommunityIndex} | T], Addr) ->
@@ -250,6 +258,9 @@ loop_c2v_rows([{_, CommunityIndex} | T], Addr) ->
"~n CommunityIndex: ~p", [CommunityIndex]),
case get_row(CommunityIndex) of
{_Community, VacmParams, Tag} ->
+ ?vtrace("loop_c2v_rows ->~n"
+ " VacmParams: ~p~n"
+ " Tag: ~p", [VacmParams, Tag]),
{TDomain, TAddr} = Addr,
case snmp_target_mib:is_valid_tag(Tag, TDomain, TAddr) of
true ->
@@ -506,7 +517,12 @@ snmpTargetAddrExtTable(get_next, RowIndex, Cols) ->
NCols = conv1(Cols),
conv2(next(snmpTargetAddrExtTable, RowIndex, NCols));
snmpTargetAddrExtTable(set, RowIndex, Cols0) ->
- case (catch verify_snmpTargetAddrExtTable_cols(Cols0, [])) of
+ case
+ (catch verify_snmpTargetAddrExtTable_cols(
+ Cols0,
+ get_snmpTargetAddrTDomain(RowIndex, Cols0),
+ []))
+ of
{ok, Cols} ->
NCols = conv3(Cols),
snmp_generic:table_func(set, RowIndex, NCols,
@@ -515,7 +531,11 @@ snmpTargetAddrExtTable(set, RowIndex, Cols0) ->
Error
end;
snmpTargetAddrExtTable(is_set_ok, RowIndex, Cols0) ->
- case (catch verify_snmpTargetAddrExtTable_cols(Cols0, [])) of
+ case (catch verify_snmpTargetAddrExtTable_cols(
+ Cols0,
+ get_snmpTargetAddrTDomain(RowIndex, Cols0),
+ []))
+ of
{ok, Cols} ->
NCols = conv3(Cols),
snmp_generic:table_func(is_set_ok, RowIndex, NCols,
@@ -525,29 +545,49 @@ snmpTargetAddrExtTable(is_set_ok, RowIndex, Cols0) ->
end.
-verify_snmpTargetAddrExtTable_cols([], Cols) ->
+
+get_snmpTargetAddrTDomain(RowIndex, Col) ->
+ case
+ get(
+ snmpTargetAddrTable, RowIndex,
+ [?snmpTargetAddrRowStatus,?snmpTargetAddrTDomain])
+ of
+ [{value,?snmpTargetAddrRowStatus_active},ValueTDomain] ->
+ case ValueTDomain of
+ {value,TDomain} ->
+ TDomain;
+ _ ->
+ ?snmpUDPDomain
+ end;
+ _ ->
+ wrongValue(Col)
+ end.
+
+
+
+verify_snmpTargetAddrExtTable_cols([], _TDomain, Cols) ->
{ok, lists:reverse(Cols)};
-verify_snmpTargetAddrExtTable_cols([{Col, Val0}|Cols], Acc) ->
- Val = verify_snmpTargetAddrExtTable_col(Col, Val0),
- verify_snmpTargetAddrExtTable_cols(Cols, [{Col, Val}|Acc]).
+verify_snmpTargetAddrExtTable_cols([{Col, Val0}|Cols], TDomain, Acc) ->
+ Val = verify_snmpTargetAddrExtTable_col(Col, TDomain, Val0),
+ verify_snmpTargetAddrExtTable_cols(Cols, TDomain, [{Col, Val}|Acc]).
-verify_snmpTargetAddrExtTable_col(?snmpTargetAddrTMask, []) ->
+verify_snmpTargetAddrExtTable_col(?snmpTargetAddrTMask, _TDomain, []) ->
[];
-verify_snmpTargetAddrExtTable_col(?snmpTargetAddrTMask, TMask) ->
- case (catch snmp_conf:check_taddress(TMask)) of
+verify_snmpTargetAddrExtTable_col(?snmpTargetAddrTMask, TDomain, TMask) ->
+ case (catch snmp_conf:check_taddress(TDomain, TMask)) of
ok ->
TMask;
_ ->
wrongValue(?snmpTargetAddrTMask)
end;
-verify_snmpTargetAddrExtTable_col(?snmpTargetAddrMMS, MMS) ->
+verify_snmpTargetAddrExtTable_col(?snmpTargetAddrMMS, _TDomain, MMS) ->
case (catch snmp_conf:check_packet_size(MMS)) of
ok ->
MMS;
_ ->
wrongValue(?snmpTargetAddrMMS)
end;
-verify_snmpTargetAddrExtTable_col(_, Val) ->
+verify_snmpTargetAddrExtTable_col(_, _TDomain, Val) ->
Val.
db(snmpTargetAddrExtTable) -> db(snmpTargetAddrTable);
@@ -583,6 +623,7 @@ conv3([{Idx, Val}|T]) -> [{Idx+10, Val} | conv3(T)];
conv3([]) -> [].
+
get(Name, RowIndex, Cols) ->
snmp_generic:handle_table_get(db(Name), RowIndex, Cols, foi(Name)).
diff --git a/lib/snmp/src/agent/snmp_framework_mib.erl b/lib/snmp/src/agent/snmp_framework_mib.erl
index cc191bd956..7ea4f0ed97 100644
--- a/lib/snmp/src/agent/snmp_framework_mib.erl
+++ b/lib/snmp/src/agent/snmp_framework_mib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -41,6 +42,7 @@
-compile({no_auto_import,[error/1]}).
-export([init/0, configure/1]).
-export([intContextTable/1, intContextTable/3,
+ intAgentTransportDomain/1, intAgentTransports/1,
intAgentUDPPort/1, intAgentIpAddress/1,
snmpEngineID/1,
snmpEngineBoots/1,
@@ -51,7 +53,7 @@
set_engine_boots/1, set_engine_time/1,
table_next/2, check_status/3]).
-export([add_context/1, delete_context/1]).
--export([check_agent/1, check_context/1]).
+-export([check_agent/2, check_context/1, order_agent/2]).
%%-----------------------------------------------------------------
@@ -115,54 +117,46 @@ do_configure(Dir) ->
read_internal_config_files(Dir) ->
?vdebug("read context config file",[]),
- Gen = fun(D, Reason) ->
- convert_context(D, Reason)
- end,
- Filter = fun(Contexts) -> Contexts end,
- Check = fun(Entry) -> check_context(Entry) end,
- [Ctxs] = snmp_conf:read_files(Dir, [{Gen, Filter, Check, "context.conf"}]),
+ Gen = fun gen_context/2,
+ Order = fun snmp_conf:no_order/2,
+ Filter = fun snmp_conf:no_filter/1,
+ Check = fun(Entry, State) -> {check_context(Entry), State} end,
+ [Ctxs] =
+ snmp_conf:read_files
+ (Dir, [{"context.conf", Gen, Order, Check, Filter}]),
Ctxs.
-
read_agent(Dir) ->
?vdebug("read agent config file", []),
- FileName = "agent.conf",
- Check = fun(Entry) -> check_agent(Entry) end,
+ FileName = "agent.conf",
File = filename:join(Dir, FileName),
- Agent =
+ Conf0 =
try
- snmp_conf:read(File, Check)
+ snmp_conf:read(File, fun order_agent/2, fun check_agent/2)
catch
throw:{error, Reason} ->
error({failed_reading_config_file, Dir, FileName, Reason})
end,
- sort_agent(Agent).
-
-
-%%-----------------------------------------------------------------
-%% Make sure that each mandatory agent attribute is present, and
-%% provide default values for the other non-present attributes.
-%%-----------------------------------------------------------------
-sort_agent(L) ->
- Mand = [{intAgentIpAddress, mandatory},
- {intAgentUDPPort, mandatory},
- {snmpEngineMaxMessageSize, mandatory},
- {snmpEngineID, mandatory}],
- {ok, L2} = snmp_conf:check_mandatory(L, Mand),
- lists:keysort(1, L2).
+ Mand =
+ [{intAgentTransports, mandatory},
+ {snmpEngineMaxMessageSize, mandatory},
+ {snmpEngineID, mandatory}],
+ {ok, Conf} = snmp_conf:check_mandatory(Conf0, Mand),
+ Conf.
%%-----------------------------------------------------------------
%% Generate a context.conf file.
%%-----------------------------------------------------------------
-convert_context(Dir, _Reason) ->
+gen_context(Dir, _Reason) ->
config_err("missing context.conf file => generating a default file", []),
File = filename:join(Dir, "context.conf"),
case file:open(File, [write]) of
{ok, Fid} ->
ok = io:format(Fid, "~s\n", [context_header()]),
ok = io:format(Fid, "%% The default context\n\"\".\n", []),
- file:close(Fid);
+ file:close(Fid),
+ [];
{error, Reason} ->
file:delete(File),
error({failed_creating_file, File, Reason})
@@ -196,10 +190,50 @@ check_context(Context) ->
%% Agent
%% {Name, Value}.
%%-----------------------------------------------------------------
-check_agent({intAgentIpAddress, Value}) ->
- snmp_conf:check_ip(Value);
-check_agent({intAgentUDPPort, Value}) ->
- snmp_conf:check_integer(Value);
+check_agent(Entry, undefined) ->
+ check_agent(Entry, {snmp_target_mib:default_domain(), undefined});
+check_agent({intAgentTransportDomain, Domain}, {_, Port}) ->
+ {snmp_conf:check_domain(Domain), {Domain, Port}};
+check_agent({intAgentUDPPort, Port}, {Domain, _}) ->
+ ok = snmp_conf:check_port(Port),
+ {ok, {Domain, Port}};
+check_agent({intAgentIpAddress, _}, {_, undefined}) ->
+ error({missing_mandatory, intAgentUDPPort});
+check_agent({intAgentIpAddress = Tag, Ip} = Entry, {Domain, Port} = State) ->
+ {case snmp_conf:check_ip(Domain, Ip) of
+ ok ->
+ [Entry,
+ {intAgentTransports, [{Domain, {Ip, Port}}]}];
+ {ok, FixedIp} ->
+ [{Tag, FixedIp},
+ {intAgentTransports, [{Domain, {FixedIp, Port}}]}]
+ end, State};
+check_agent({intAgentTransports = Tag, Transports}, {_, Port} = State)
+ when is_list(Transports) ->
+ CheckedTransports =
+ [case Transport of
+ {Domain, Address} ->
+ case
+ case Port of
+ undefined ->
+ snmp_conf:check_address(Domain, Address);
+ _ ->
+ snmp_conf:check_address(Domain, Address, Port)
+ end
+ of
+ ok ->
+ Transport;
+ {ok, FixedAddress} ->
+ {Domain, FixedAddress}
+ end;
+ _ ->
+ error({bad_transport, Transport})
+ end
+ || Transport <- Transports],
+ {{ok, {Tag, CheckedTransports}}, State};
+check_agent(Entry, State) ->
+ {check_agent(Entry), State}.
+
%% This one is kept for backwards compatibility
check_agent({intAgentMaxPacketSize, Value}) ->
snmp_conf:check_packet_size(Value);
@@ -210,6 +244,14 @@ check_agent({snmpEngineID, Value}) ->
check_agent(X) ->
error({invalid_agent_attribute, X}).
+%% Ordering function to sort intAgentTransportDomain first
+%% hence before intAgentIpAddress. Sort other entries on the key.
+order_agent(EntryA, EntryB) ->
+ snmp_conf:keyorder(
+ 1, EntryA, EntryB,
+ [intAgentTransportDomain, intAgentUDPPort | sort]).
+
+
maybe_create_table(Name) ->
case snmpa_local_db:table_exists(db(Name)) of
@@ -382,6 +424,14 @@ intAgentUDPPort(Op) ->
intAgentIpAddress(Op) ->
snmp_generic:variable_func(Op, db(intAgentIpAddress)).
+intAgentTransportDomain(Op) ->
+ snmp_generic:variable_func(Op, db(intAgentTransportDomain)).
+
+intAgentTransports(Op) ->
+ snmp_generic:variable_func(Op, db(intAgentTransports)).
+
+
+
snmpEngineID(print) ->
VarAndValue = [{snmpEngineID, snmpEngineID(get)}],
snmpa_mib_lib:print_variables(VarAndValue);
diff --git a/lib/snmp/src/agent/snmp_generic.erl b/lib/snmp/src/agent/snmp_generic.erl
index 06afa68d96..fc23e16ef1 100644
--- a/lib/snmp/src/agent/snmp_generic.erl
+++ b/lib/snmp/src/agent/snmp_generic.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -414,7 +415,12 @@ table_check_status(NameDb, Col, ?'RowStatus_createAndGo', RowIndex, Cols) ->
% side effect free and we only use the result temporary.
case catch snmpa_local_db:table_construct_row(
NameDb, RowIndex, ?'RowStatus_createAndGo', Cols) of
- {'EXIT', _} ->
+ {'EXIT', _Reason} ->
+ ?vtrace(
+ "failed construct row (createAndGo): "
+ " n Reason: ~p"
+ " n Stack: ~p",
+ [_Reason, erlang:get_stacktrace()]),
{noCreation, Col}; % Bad RowIndex
Row ->
case lists:member(noinit, tuple_to_list(Row)) of
@@ -431,7 +437,12 @@ table_check_status(NameDb, Col, ?'RowStatus_createAndWait', RowIndex, Cols) ->
false ->
case catch snmpa_local_db:table_construct_row(
NameDb, RowIndex, ?'RowStatus_createAndGo', Cols) of
- {'EXIT', _} ->
+ {'EXIT', _Reason} ->
+ ?vtrace(
+ "failed construct row (createAndWait): "
+ " n Reason: ~p"
+ " n Stack: ~p",
+ [_Reason, erlang:get_stacktrace()]),
{noCreation, Col}; % Bad RowIndex
_Row ->
{noError, 0}
@@ -711,7 +722,19 @@ find_col(Col, [_H | T]) -> find_col(Col, T).
try_apply(nofunc, _) -> {noError, 0};
-try_apply(F, Args) -> apply(F, Args).
+try_apply(F, Args) -> maybe_verbose_apply(F, Args).
+
+maybe_verbose_apply(M, Args) ->
+ case get(verbosity) of
+ false ->
+ apply(M, Args);
+ _ ->
+ ?vlog("~n apply: ~w,~p~n", [M,Args]),
+ Res = apply(M,Args),
+ ?vlog("~n returned: ~p", [Res]),
+ Res
+ end.
+
table_info({Name, _Db}) ->
case snmpa_symbolic_store:table_info(Name) of
diff --git a/lib/snmp/src/agent/snmp_generic_mnesia.erl b/lib/snmp/src/agent/snmp_generic_mnesia.erl
index 7fd6501977..131b9b0368 100644
--- a/lib/snmp/src/agent/snmp_generic_mnesia.erl
+++ b/lib/snmp/src/agent/snmp_generic_mnesia.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmp_index.erl b/lib/snmp/src/agent/snmp_index.erl
index 1902fe2613..38b39a9b7e 100644
--- a/lib/snmp/src/agent/snmp_index.erl
+++ b/lib/snmp/src/agent/snmp_index.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmp_notification_mib.erl b/lib/snmp/src/agent/snmp_notification_mib.erl
index 37e09f5d3e..3f1ba5d8b3 100644
--- a/lib/snmp/src/agent/snmp_notification_mib.erl
+++ b/lib/snmp/src/agent/snmp_notification_mib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -106,17 +107,19 @@ do_reconfigure(Dir) ->
read_notify_config_files(Dir) ->
?vdebug("read notify config file",[]),
FileName = "notify.conf",
- Gen = fun(D, Reason) ->
- info_msg("failed reading config file ~s"
- "~n Config Dir: ~s"
- "~n Reason: ~p",
- [FileName, D, Reason]),
- ok
- end,
- Filter = fun(Notifs) -> Notifs end,
- Check = fun(Entry) -> check_notify(Entry) end,
+ Gen =
+ fun (D, Reason) ->
+ info_msg("failed reading config file ~s"
+ "~n Config Dir: ~s"
+ "~n Reason: ~p",
+ [FileName, D, Reason]),
+ ok
+ end,
+ Order = fun snmp_conf:no_order/2,
+ Filter = fun snmp_conf:no_filter/1,
+ Check = fun (Entry, State) -> {check_notify(Entry), State} end,
[Notifs] =
- snmp_conf:read_files(Dir, [{Gen, Filter, Check, "notify.conf"}]),
+ snmp_conf:read_files(Dir, [{FileName, Gen, Order, Check, Filter}]),
Notifs.
check_notify({Name, Tag, Type}) ->
diff --git a/lib/snmp/src/agent/snmp_shadow_table.erl b/lib/snmp/src/agent/snmp_shadow_table.erl
index 34543d542b..f9181f70a7 100644
--- a/lib/snmp/src/agent/snmp_shadow_table.erl
+++ b/lib/snmp/src/agent/snmp_shadow_table.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -76,7 +77,7 @@ delete_time_stamp_table() ->
end.
update(Name, UpdateFunc, Interval) ->
- CurrentTime = get_time(),
+ CurrentTime = snmp_misc:now(ms),
case mnesia:dirty_read({time_stamp, Name}) of
[#time_stamp{data = Expire}] when CurrentTime =< Expire -> ok;
_ ->
@@ -117,9 +118,6 @@ table_func(Op, RowIndex, Cols,
update(Name, UpdateFunc, Interval),
snmp_generic:table_func(Op, RowIndex, Cols, {Name, mnesia}).
-get_time() ->
- {M,S,U} = erlang:now(),
- 1000000000 * M + 1000 * S + (U div 1000).
%%-----------------------------------------------------------------
%% Urrk.
@@ -183,5 +181,3 @@ delete_table(Tab) ->
error_msg(F, A) ->
?snmpa_error(F, A).
-
-
diff --git a/lib/snmp/src/agent/snmp_standard_mib.erl b/lib/snmp/src/agent/snmp_standard_mib.erl
index 766b75022b..bfe471178d 100644
--- a/lib/snmp/src/agent/snmp_standard_mib.erl
+++ b/lib/snmp/src/agent/snmp_standard_mib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -152,16 +153,19 @@ do_reconfigure(Dir) ->
%%-----------------------------------------------------------------
read_standard(Dir) ->
?vdebug("check standard config file",[]),
- FileName = "standard.conf",
- Gen = fun(D, Reason) ->
- throw({error, {failed_reading_config_file,
- D, FileName,
- list_dir(Dir), Reason}})
- end,
- Filter = fun(Standard) -> sort_standard(Standard) end,
- Check = fun(Entry) -> check_standard(Entry) end,
+ FileName = "standard.conf",
+ Gen =
+ fun (D, Reason) ->
+ throw(
+ {error,
+ {failed_reading_config_file,
+ D, FileName, list_dir(Dir), Reason}})
+ end,
+ Order = fun snmp_conf:no_order/2,
+ Check = fun (Entry, State) -> {check_standard(Entry), State} end,
+ Filter = fun sort_standard/1,
[Standard] =
- snmp_conf:read_files(Dir, [{Gen, Filter, Check, FileName}]),
+ snmp_conf:read_files(Dir, [{FileName, Gen, Order, Check, Filter}]),
Standard.
list_dir(Dir) ->
@@ -543,8 +547,9 @@ dummy(_Op) -> ok.
%%-----------------------------------------------------------------
snmp_set_serial_no(new) ->
snmp_generic:variable_func(new, {snmpSetSerialNo, volatile}),
- {A1,A2,A3} = erlang:now(),
- random:seed(A1,A2,A3),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
Val = random:uniform(2147483648) - 1,
snmp_generic:variable_func(set, Val, {snmpSetSerialNo, volatile});
diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl
index b01d536caa..e65fa7f340 100644
--- a/lib/snmp/src/agent/snmp_target_mib.erl
+++ b/lib/snmp/src/agent/snmp_target_mib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -133,18 +134,22 @@ do_reconfigure(Dir) ->
read_target_config_files(Dir) ->
?vdebug("check target address and parameter config file(s)",[]),
- TAGen = fun(_D, _Reason) -> ok end,
- TAFilter = fun(Addr) -> Addr end,
- TACheck = fun(Entry) -> check_target_addr(Entry) end,
- TPGen = fun(_D, _Reason) -> ok end,
- TPFilter = fun(Params) -> Params end,
- TPCheck = fun(Entry) -> check_target_params(Entry) end,
+ TAName = "target_addr.conf",
+ TACheck = fun (Entry, State) -> {check_target_addr(Entry), State} end,
+
+ TPName = "target_params.conf",
+ TPCheck = fun (Entry, State) -> {check_target_params(Entry), State} end,
+
+ NoGen = fun snmp_conf:no_gen/2,
+ NoOrder = fun snmp_conf:no_order/2,
+ NoFilter = fun snmp_conf:no_filter/1,
[Addrs, Params] =
- snmp_conf:read_files(Dir,
- [{TAGen, TAFilter, TACheck, "target_addr.conf"},
- {TPGen, TPFilter, TPCheck, "target_params.conf"}]),
+ snmp_conf:read_files(
+ Dir,
+ [{TAName, NoGen, NoOrder, TACheck, NoFilter},
+ {TPName, NoGen, NoOrder, TPCheck, NoFilter}]),
{Addrs, Params}.
@@ -154,79 +159,173 @@ read_target_config_files(Dir) ->
%% TMask, MMS}
%%-----------------------------------------------------------------
-check_target_addr({Name, Domain, Ip, Udp, Timeout, RetryCount, TagList,
- Params, EngineId, TMask, MMS}) ->
+check_target_addr(
+ {Name, Domain, Ip, Udp, Timeout, RetryCount, TagList, Params,
+ EngineId, TMask, MMS}) -> % Arity 11
+ Address = {Ip, Udp},
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId, TMask, MMS);
+check_target_addr(
+ {Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId, TMask, MMS}) % Arity 10
+ when is_atom(Domain) ->
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId, TMask, MMS);
+check_target_addr(
+ {Name, Ip, Udp, Timeout, RetryCount, TagList, Params,
+ EngineId, TMask, MMS})
+ when is_integer(Udp) -> % Arity 10
+ Domain = default_domain(),
+ Address = {Ip, Udp},
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId, TMask, MMS);
+check_target_addr(
+ {_Name, Domain, Address, _Timeout, _RetryCount, _TagList, _Params,
+ _EngineId, _TMask, _MMS}) -> % Arity 10
+ error({bad_address, {Domain, Address}});
+check_target_addr(
+ {Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId}) % Arity 8
+ when is_atom(Domain) ->
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId);
+check_target_addr(
+ {Name, Ip, Udp, Timeout, RetryCount, TagList, Params,
+ EngineId}) % Arity 8
+ when is_integer(Udp) ->
+ Domain = default_domain(),
+ Address = {Ip, Udp},
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId);
+check_target_addr(
+ {_Name, Domain, Address, _Timeout, _RetryCount, _TagList, _Params,
+ _EngineId}) ->% Arity 8
+ error({bad_address, {Domain, Address}});
+%% Use dummy engine id if the old style is found
+check_target_addr(
+ {Name, Domain, Address, Timeout, RetryCount, TagList, Params}) % Arity 7
+ when is_atom(Domain) ->
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params);
+check_target_addr(
+ {Name, Ip, Udp, Timeout, RetryCount, TagList, Params}) % Arity 7
+ when is_integer(Udp) ->
+ Domain = default_domain(),
+ Address = {Ip, Udp},
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params);
+check_target_addr(
+ {_Name, Domain, Address, _Timeout, _RetryCount, _TagList, _Params}) -> % Arity 7
+ error({bad_address, {Domain, Address}});
+%% Use dummy engine id if the old style is found
+check_target_addr(
+ {Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ TMask, MMS}) % Arity 9
+ when is_atom(Domain) ->
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params, TMask, MMS);
+check_target_addr(
+ {Name, Ip, Udp, Timeout, RetryCount, TagList, Params,
+ TMask, MMS}) % Arity 9
+ when is_integer(Udp) ->
+ Domain = default_domain(),
+ Address = {Ip, Udp},
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params, TMask, MMS);
+check_target_addr(
+ {_Name, Domain, Address, _Timeout, _RetryCount, _TagList, _Params,
+ _TMask, _MMS}) -> % Arity 9
+ error({bad_address, {Domain, Address}});
+check_target_addr(X) ->
+ error({invalid_target_addr, X}).
+
+check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params) -> % Arity 7
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ "dummy").
+%%
+check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId) -> % Arity 8
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId, [], 2048).
+%%
+check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ TMask, MMS) -> % Arity 9
+ check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ "dummy", TMask, MMS).
+%%
+check_target_addr(
+ Name, Domain, Address, Timeout, RetryCount, TagList, Params,
+ EngineId, Mask, MMS) -> % Arity 10
?vtrace("check target address with:"
"~n Name: ~s"
"~n Domain: ~p"
- "~n Ip: ~p"
- "~n Udp: ~p"
+ "~n Address: ~p"
"~n Timeout: ~p"
"~n RetryCount: ~p"
"~n TagList: ~p"
"~n Params: ~p"
"~n EngineId: ~p"
- "~n TMask: ~p"
+ "~n Mask: ~p"
"~n MMS: ~p",
- [Name,
- Domain, Ip, Udp,
+ [Name, Domain, Address,
Timeout, RetryCount,
- TagList, Params, EngineId, TMask, MMS]),
+ TagList, Params, EngineId, Mask, MMS]),
snmp_conf:check_string(Name,{gt,0}),
snmp_conf:check_domain(Domain),
- snmp_conf:check_ip(Domain, Ip),
- snmp_conf:check_integer(Udp, {gt, 0}),
+ NAddress = check_address(Domain, Address),
snmp_conf:check_integer(Timeout, {gte, 0}),
snmp_conf:check_integer(RetryCount, {gte,0}),
snmp_conf:check_string(TagList),
snmp_conf:check_string(Params),
check_engine_id(EngineId),
- TAddress = snmp_conf:mk_taddress(Domain, Ip, Udp),
+ NMask = check_mask(Domain, Mask),
TDomain = snmp_conf:mk_tdomain(Domain),
- check_tmask(TDomain, TMask, TAddress),
+ TAddress = snmp_conf:mk_taddress(Domain, NAddress),
+ TMask = snmp_conf:mk_taddress(Domain, NMask),
snmp_conf:check_packet_size(MMS),
?vtrace("check target address done",[]),
Addr = {Name, TDomain, TAddress, Timeout,
RetryCount, TagList, Params,
?'StorageType_nonVolatile', ?'RowStatus_active', EngineId,
TMask, MMS}, % Values for Augmenting table in SNMP-COMMUNITY-MIB
- {ok, Addr};
-check_target_addr({Name, Ip, Udp, Timeout, RetryCount, TagList,
- Params, EngineId, TMask, MMS}) ->
- Domain = default_domain(),
- check_target_addr({Name,
- Domain, Ip, Udp,
- Timeout, RetryCount, TagList,
- Params, EngineId, TMask, MMS});
-check_target_addr({Name, Ip, Udp, Timeout, RetryCount, TagList, Params,
- EngineId}) ->
- check_target_addr({Name, Ip, Udp, Timeout, RetryCount, TagList,
- Params, EngineId, [], 2048});
-%% Use dummy engine id if the old style is found
-check_target_addr({Name, Ip, Udp, Timeout, RetryCount, TagList, Params}) ->
- check_target_addr({Name, Ip, Udp, Timeout, RetryCount, TagList,
- Params, "dummy", [], 2048});
-%% Use dummy engine id if the old style is found
-check_target_addr({Name, Ip, Udp, Timeout, RetryCount, TagList, Params,
- TMask, MMS}) ->
- check_target_addr({Name, Ip, Udp, Timeout, RetryCount, TagList,
- Params, "dummy", TMask, MMS});
-check_target_addr(X) ->
- error({invalid_target_addr, X}).
-
+ {ok, Addr}.
check_engine_id(discovery) ->
ok;
check_engine_id(EngineId) ->
snmp_conf:check_string(EngineId).
+check_address(Domain, Address) ->
+ case snmp_conf:check_address(Domain, Address, 162) of
+ ok ->
+ Address;
+ {ok, NAddress} ->
+ NAddress
+ end.
-check_tmask(_TDomain, [], _TAddress) ->
- ok;
-check_tmask(TDomain, TMask, TAddress) when length(TMask) =:= length(TAddress) ->
- snmp_conf:check_taddress(TDomain, TMask);
-check_tmask(_TDomain, TMask, _TAddr) ->
- throw({error, {invalid_tmask, TMask}}).
+check_mask(_Domain, [] = Mask) ->
+ Mask;
+check_mask(Domain, Mask) ->
+ try snmp_conf:check_address(Domain, Mask) of
+ ok ->
+ Mask;
+ {ok, NMask} ->
+ NMask
+ catch
+ {error, {bad_address, Info}} ->
+ error({bad_mask, Info})
+ end.
%%-----------------------------------------------------------------
@@ -248,13 +347,6 @@ check_target_params(X) ->
error({invalid_target_params, X}).
-
-%% maybe_create_table(Name) ->
-%% case snmpa_local_db:table_exists(db(Name)) of
-%% true -> ok;
-%% _ -> snmpa_local_db:table_create(db(Name))
-%% end.
-
init_tabs(Addrs, Params) ->
?vdebug("create target address table",[]),
AddrDB = db(snmpTargetAddrTable),
@@ -286,16 +378,21 @@ table_del_row(Tab, Key) ->
snmpa_mib_lib:table_del_row(db(Tab), Key).
-add_addr(Name, Ip, Port, Timeout, Retry, TagList,
- Params, EngineId, TMask, MMS) ->
- Domain = default_domain(),
- add_addr(Name, Domain, Ip, Port, Timeout, Retry, TagList,
- Params, EngineId, TMask, MMS).
-
-add_addr(Name, Domain, Ip, Port, Timeout, Retry, TagList,
- Params, EngineId, TMask, MMS) ->
- Addr = {Name, Domain, Ip, Port, Timeout, Retry, TagList,
- Params, EngineId, TMask, MMS},
+add_addr(
+ Name, Domain_or_Ip, Addr_or_Port, Timeout, Retry, TagList, Params,
+ EngineId, TMask, MMS) ->
+ add_addr(
+ {Name, Domain_or_Ip, Addr_or_Port, Timeout, Retry, TagList, Params,
+ EngineId, TMask, MMS}).
+%%
+add_addr(
+ Name, Domain, Ip, Port, Timeout, Retry, TagList, Params,
+ EngineId, TMask, MMS) ->
+ add_addr(
+ {Name, Domain, Ip, Port, Timeout, Retry, TagList, Params,
+ EngineId, TMask, MMS}).
+%%
+add_addr(Addr) ->
case (catch check_target_addr(Addr)) of
{ok, Row} ->
Key = element(1, Row),
@@ -576,8 +673,9 @@ snmpTargetSpinLock(print) ->
snmpTargetSpinLock(new) ->
snmp_generic:variable_func(new, {snmpTargetSpinLock, volatile}),
- {A1,A2,A3} = erlang:now(),
- random:seed(A1,A2,A3),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
Val = random:uniform(2147483648) - 1,
snmp_generic:variable_func(set, Val, {snmpTargetSpinLock, volatile});
@@ -604,6 +702,20 @@ snmpTargetAddrTable(print) ->
FOI = foi(Table),
PrintRow =
fun(Prefix, Row) ->
+ TDomain = element(?snmpTargetAddrTDomain, Row),
+ Domain =
+ try snmp_conf:tdomain_to_domain(TDomain)
+ catch
+ {error, {bad_tdomain, _}} ->
+ undefined
+ end,
+ TAddress = element(?snmpTargetAddrTAddress, Row),
+ AddrString =
+ try snmp_conf:mk_addr_string({Domain, TAddress})
+ catch
+ {error, {bad_address, _}} ->
+ "-"
+ end,
lists:flatten(
io_lib:format("~sName: ~p"
"~n~sTDomain: ~p (~w)"
@@ -618,21 +730,8 @@ snmpTargetAddrTable(print) ->
"~n~s[Ext] TMask: ~p"
"~n~s[Ext] MMS: ~p",
[Prefix, element(?snmpTargetAddrName, Row),
- Prefix, element(?snmpTargetAddrTDomain, Row),
- case element(?snmpTargetAddrTDomain, Row) of
- ?snmpUDPDomain -> snmpUDPDomain;
- ?transportDomainUdpIpv4 -> transportDomainUdpIpv4;
- ?transportDomainUdpIpv6 -> transportDomainUdpIpv6;
- _ -> undefined
- end,
- Prefix, element(?snmpTargetAddrTAddress, Row),
- case element(?snmpTargetAddrTAddress, Row) of
- [A,B,C,D,U1,U2] ->
- lists:flatten(
- io_lib:format("~w.~w.~w.~w:~w",
- [A, B, C, D, U1 bsl 8 + U2]));
- _ -> "-"
- end,
+ Prefix, TDomain, Domain,
+ Prefix, TAddress, AddrString,
Prefix, element(?snmpTargetAddrTimeout, Row),
Prefix, element(?snmpTargetAddrRetryCount, Row),
Prefix, element(?snmpTargetAddrTagList, Row),
@@ -976,5 +1075,3 @@ error(Reason) ->
config_err(F, A) ->
snmpa_error:config_err("[TARGET-MIB]: " ++ F, A).
-
-
diff --git a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl
index 3c4ba1af66..f6e4fd3951 100644
--- a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl
+++ b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -137,18 +138,20 @@ do_reconfigure(Dir) ->
read_usm_config_files(Dir) ->
?vdebug("read usm config file",[]),
- Gen = fun(D, Reason) -> generate_usm(D, Reason) end,
- Filter = fun(Usms) -> Usms end,
- Check = fun(Entry) -> check_usm(Entry) end,
+ Gen = fun (D, Reason) -> generate_usm(D, Reason) end,
+ Order = fun snmp_conf:no_order/2,
+ Check = fun (Entry, State) -> {check_usm(Entry), State} end,
+ Filter = fun snmp_conf:no_filter/1,
[Usms] =
- snmp_conf:read_files(Dir, [{Gen, Filter, Check, "usm.conf"}]),
+ snmp_conf:read_files(Dir, [{"usm.conf", Gen, Order, Check, Filter}]),
Usms.
generate_usm(Dir, _Reason) ->
info_msg("Incomplete configuration. Generating empty usm.conf.", []),
USMFile = filename:join(Dir, "usm.conf"),
- ok = file:write_file(USMFile, list_to_binary([])).
+ ok = file:write_file(USMFile, list_to_binary([])),
+ [].
check_usm({EngineID, Name, SecName, Clone, AuthP, AuthKeyC, OwnAuthKeyC,
@@ -214,12 +217,12 @@ check_user(User) ->
case element(?usmUserAuthProtocol, User) of
?usmNoAuthProtocol -> ok;
?usmHMACMD5AuthProtocol ->
- case is_crypto_supported(md5_mac_96) of
+ case is_crypto_supported(md5) of
true -> ok;
false -> exit({unsupported_crypto, md5_mac_96})
end;
?usmHMACSHAAuthProtocol ->
- case is_crypto_supported(sha_mac_96) of
+ case is_crypto_supported(sha) of
true -> ok;
false -> exit({unsupported_crypto, sha_mac_96})
end
@@ -227,14 +230,14 @@ check_user(User) ->
case element(?usmUserPrivProtocol, User) of
?usmNoPrivProtocol -> ok;
?usmDESPrivProtocol ->
- case is_crypto_supported(des_cbc_decrypt) of
+ case is_crypto_supported(des_cbc) of
true -> ok;
- false -> exit({unsupported_crypto, des_cbc_decrypt})
+ false -> exit({unsupported_crypto, des_cbc})
end;
?usmAesCfb128Protocol ->
- case is_crypto_supported(aes_cfb_128_decrypt) of
+ case is_crypto_supported(aes_cfb128) of
true -> ok;
- false -> exit({unsupported_crypto, aes_cfb_128_decrypt})
+ false -> exit({unsupported_crypto, aes_cfb128})
end
end.
@@ -437,8 +440,9 @@ usmUserSpinLock(print) ->
usmUserSpinLock(new) ->
snmp_generic:variable_func(new, {usmUserSpinLock, volatile}),
- {A1,A2,A3} = erlang:now(),
- random:seed(A1,A2,A3),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
Val = random:uniform(2147483648) - 1,
snmp_generic:variable_func(set, Val, {usmUserSpinLock, volatile});
@@ -874,13 +878,13 @@ validate_auth_protocol(RowIndex, Cols) ->
_ -> inconsistentValue(?usmUserAuthProtocol)
end;
?usmHMACMD5AuthProtocol ->
- case is_crypto_supported(md5_mac_96) of
+ case is_crypto_supported(md5) of
true -> ok;
false ->
wrongValue(?usmUserAuthProtocol)
end;
?usmHMACSHAAuthProtocol ->
- case is_crypto_supported(sha_mac_96) of
+ case is_crypto_supported(sha) of
true -> ok;
false ->
wrongValue(?usmUserAuthProtocol)
@@ -1008,7 +1012,7 @@ validate_priv_protocol(RowIndex, Cols) ->
?usmDESPrivProtocol ->
%% The 'catch' handles the case when 'crypto' is
%% not present in the system.
- case is_crypto_supported(des_cbc_decrypt) of
+ case is_crypto_supported(des_cbc) of
true ->
case get_auth_proto(RowIndex, Cols) of
?usmNoAuthProtocol ->
@@ -1022,7 +1026,7 @@ validate_priv_protocol(RowIndex, Cols) ->
?usmAesCfb128Protocol ->
%% The 'catch' handles the case when 'crypto' is
%% not present in the system.
- case is_crypto_supported(aes_cfb_128_decrypt) of
+ case is_crypto_supported(aes_cfb128) of
true ->
case get_auth_proto(RowIndex, Cols) of
?usmNoAuthProtocol ->
@@ -1164,7 +1168,7 @@ mk_key_change(Hash, OldKey, NewKey) ->
%% case in the standard where Random is pre-defined.
mk_key_change(Alg, OldKey, NewKey, KeyLen, Random) ->
%% OldKey and Random is of length KeyLen...
- Digest = lists:sublist(binary_to_list(crypto:Alg(OldKey++Random)), KeyLen),
+ Digest = lists:sublist(binary_to_list(crypto:hash(Alg, OldKey++Random)), KeyLen),
%% ... and so is Digest
Delta = snmp_misc:str_xor(Digest, NewKey),
Random ++ Delta.
@@ -1181,7 +1185,7 @@ extract_new_key(Hash, OldKey, KeyChange) ->
sha -> sha
end,
{Random, Delta} = split(KeyLen, KeyChange, []),
- Digest = lists:sublist(binary_to_list(crypto:Alg(OldKey++Random)), KeyLen),
+ Digest = lists:sublist(binary_to_list(crypto:hash(Alg, OldKey++Random)), KeyLen),
NewKey = snmp_misc:str_xor(Digest, Delta),
NewKey.
@@ -1189,29 +1193,7 @@ extract_new_key(Hash, OldKey, KeyChange) ->
-define(i8(Int), Int band 255).
mk_random(Len) when Len =< 20 ->
- %% Use of yield():
- %% This will either schedule another process, or fail and invoke
- %% the error_handler (in old versions). In either case, it is
- %% safe to assume that now, reductions and garbage_collection have
- %% changed in a non-deterministically way.
- {_,_,A} = erlang:now(),
- catch erlang:yield(),
- {_,_,B} = erlang:now(),
- catch erlang:yield(),
- {_,_,C} = erlang:now(),
- {D,_} = erlang:statistics(reductions),
- {E,_} = erlang:statistics(runtime),
- {F,_} = erlang:statistics(wall_clock),
- {G,H,_} = erlang:statistics(garbage_collection),
- catch erlang:yield(),
- {_,_,C2} = erlang:now(),
- {D2,_} = erlang:statistics(reductions),
- {_,H2,_} = erlang:statistics(garbage_collection),
- %% X(N) means we can use N bits from variable X:
- %% A(16) B(16) C(16) D(16) E(8) F(16) G(8) H(16)
- Rnd20 = [?i16(A),?i16(B),?i16(C),?i16(D),?i8(E),?i16(F),
- ?i8(G),?i16(H),?i16(C2),?i16(D2),?i16(H2)],
- lists:sublist(Rnd20, Len).
+ binary_to_list(crypto:strong_rand_bytes(Len)).
split(0, Rest, FirstRev) ->
{lists:reverse(FirstRev), Rest};
@@ -1219,13 +1201,10 @@ split(N, [H | T], FirstRev) when N > 0 ->
split(N-1, T, [H | FirstRev]).
+-compile({inline, [{is_crypto_supported,1}]}).
is_crypto_supported(Func) ->
- %% The 'catch' handles the case when 'crypto' is
- %% not present in the system (or not started).
- case catch lists:member(Func, crypto:info()) of
- true -> true;
- _ -> false
- end.
+ snmp_misc:is_crypto_supported(Func).
+
inconsistentValue(V) -> throw({inconsistentValue, V}).
inconsistentName(N) -> throw({inconsistentName, N}).
diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl
index 436f15eb9c..02415e8036 100644
--- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl
+++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -33,6 +34,8 @@
%% Internal exports
-export([check_vacm/1]).
+%%
+-export([emask2imask/1]).
-include("snmp_types.hrl").
@@ -49,6 +52,14 @@
-endif.
+-type internal_view_mask() :: null | [internal_view_mask_element()].
+-type internal_view_mask_element() :: 0 | 1.
+
+-type external_view_mask() :: octet_string(). % At most length of 16 octet
+-type octet_string() :: [octet()].
+-type octet() :: byte().
+
+
%%-----------------------------------------------------------------
%% Func: configure/1
%% Args: Dir is the directory where the configuration files are found.
@@ -115,15 +126,18 @@ do_reconfigure(Dir) ->
read_vacm_config_files(Dir) ->
?vdebug("read vacm config file",[]),
- Gen = fun(_D, _Reason) -> ok end,
- Filter = fun(Vacms) ->
- Sec2Group = [X || {vacmSecurityToGroup, X} <- Vacms],
- Access = [X || {vacmAccess, X} <- Vacms],
- View = [X || {vacmViewTreeFamily, X} <- Vacms],
- {Sec2Group, Access, View}
- end,
- Check = fun(Entry) -> check_vacm(Entry) end,
- [Vacms] = snmp_conf:read_files(Dir, [{Gen, Filter, Check, "vacm.conf"}]),
+ Gen = fun snmp_conf:no_gen/2,
+ Order = fun snmp_conf:no_order/2,
+ Check = fun (Entry, State) -> {check_vacm(Entry), State} end,
+ Filter =
+ fun (Vacms) ->
+ Sec2Group = [X || {vacmSecurityToGroup, X} <- Vacms],
+ Access = [X || {vacmAccess, X} <- Vacms],
+ View = [X || {vacmViewTreeFamily, X} <- Vacms],
+ {Sec2Group, Access, View}
+ end,
+ [Vacms] =
+ snmp_conf:read_files(Dir, [{"vacm.conf", Gen, Order, Check, Filter}]),
Vacms.
%%-----------------------------------------------------------------
@@ -160,14 +174,7 @@ check_vacm({vacmViewTreeFamily, ViewName, Tree, Type, Mask}) ->
{ok, TypeVal} =
snmp_conf:check_atom(Type, [{included, ?view_included},
{excluded, ?view_excluded}]),
- MaskVal =
- case (catch snmp_conf:check_atom(Mask, [{null, []}])) of
- {error, _} ->
- snmp_conf:check_oid(Mask),
- Mask;
- {ok, X} ->
- X
- end,
+ {ok, MaskVal} = snmp_conf:check_imask(Mask),
Vacm = {ViewName, Tree, MaskVal, TypeVal,
?'StorageType_nonVolatile', ?'RowStatus_active'},
{ok, {vacmViewTreeFamily, Vacm}};
@@ -194,8 +201,8 @@ init_tabs(Sec2Group, Access, View) ->
ok.
init_sec2group_table([Row | T]) ->
-%% ?vtrace("init security-to-group table: "
-%% "~n Row: ~p",[Row]),
+ %% ?vtrace("init security-to-group table: "
+ %% "~n Row: ~p",[Row]),
Key1 = element(1, Row),
Key2 = element(2, Row),
Key = [Key1, length(Key2) | Key2],
@@ -496,7 +503,7 @@ verify_vacmSecurityToGroupTable_col(_, Val) ->
%%
%%-----------------------------------------------------------------
vacmAccessTable(print) ->
- %% M�ste jag g�ra om alla entrien till {RowIdx, Row}?
+ %% Do I need to turn all entries into {RowIdx, Row}?
TableInfo = get_table(vacmAccessTable),
PrintRow =
fun(Prefix, Row) ->
@@ -841,8 +848,9 @@ vacmViewSpinLock(print) ->
vacmViewSpinLock(new) ->
snmp_generic:variable_func(new, volatile_db(vacmViewSpinLock)),
- {A1,A2,A3} = erlang:now(),
- random:seed(A1,A2,A3),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
Val = random:uniform(2147483648) - 1,
snmp_generic:variable_func(set, Val, volatile_db(vacmViewSpinLock));
@@ -953,13 +961,23 @@ verify_vacmViewTreeFamilyTable_col(?vacmViewTreeFamilySubtree, Tree) ->
wrongValue(?vacmViewTreeFamilySubtree)
end;
verify_vacmViewTreeFamilyTable_col(?vacmViewTreeFamilyMask, Mask) ->
+ %% Mask here is in the "external" format. That is, according
+ %% to the MIB, which means that its an OCTET STRING of max 16
+ %% octets.
+ %% We however store the mask as a list of 1's (exact) and
+ %% 0's (wildcard), which means we have to convert the mask.
case Mask of
- null -> [];
- [] -> [];
+ %% The Mask can only have this value if the vacmViewTreeFamilyTable
+ %% is called locally!
+ null ->
+ [];
+ [] ->
+ [];
_ ->
- case (catch snmp_conf:check_oid(Mask)) of
- ok ->
- Mask;
+ %% Check and convert to our internal format
+ case check_mask(Mask) of
+ {ok, IMask} ->
+ IMask;
_ ->
wrongValue(?vacmViewTreeFamilyMask)
end
@@ -977,6 +995,60 @@ verify_vacmViewTreeFamilyTable_col(_, Val) ->
Val.
+check_mask(Mask) when is_list(Mask) andalso (length(Mask) =< 16) ->
+ try
+ begin
+ {ok, emask2imask(Mask)}
+ end
+ catch
+ throw:{error, _} ->
+ {error, {bad_mask, Mask}};
+ T:E ->
+ {error, {bad_mask, Mask, T, E}}
+ end;
+check_mask(BadMask) ->
+ {error, {bad_mask, BadMask}}.
+
+-spec emask2imask(EMask :: external_view_mask()) ->
+ IMask :: internal_view_mask().
+
+%% Convert an External Mask (OCTET STRING) to Internal Mask (list of 0 or 1)
+emask2imask(EMask) ->
+ lists:flatten([octet2bits(Octet) || Octet <- EMask]).
+
+octet2bits(Octet)
+ when is_integer(Octet) andalso (Octet >= 16#00) andalso (16#FF >= Octet) ->
+ <<A:1, B:1, C:1, D:1, E:1, F:1, G:1, H:1>> = <<Octet>>,
+ [A, B, C, D, E, F, G, H];
+octet2bits(BadOctet) ->
+ throw({error, {bad_octet, BadOctet}}).
+
+-spec imask2emask(IMask :: internal_view_mask()) ->
+ EMask :: external_view_mask().
+
+%% Convert an Internal Mask (list of 0 or 1) to External Mask (OCTET STRING)
+imask2emask(IMask) ->
+ imask2emask(IMask, []).
+
+imask2emask([], EMask) ->
+ lists:reverse(EMask);
+imask2emask(IMask, EMask) ->
+ %% Make sure we have atleast 8 bits
+ %% (maybe extend with 1's)
+ IMask2 =
+ case length(IMask) of
+ Small when Small < 8 ->
+ IMask ++ lists:duplicate(8-Small, 1);
+ _ ->
+ IMask
+ end,
+ %% Extract 8 bits
+ [A, B, C, D, E, F, G, H | IMaskRest] = IMask2,
+ <<Octet:8>> = <<A:1, B:1, C:1, D:1, E:1, F:1, G:1, H:1>>,
+ imask2emask(IMaskRest, [Octet | EMask]).
+
+
+
table_next(Name, RestOid) ->
snmp_generic:table_next(db(Name), RestOid).
@@ -1014,11 +1086,41 @@ stc(vacmSecurityToGroupTable) -> ?vacmSecurityToGroupStorageType;
stc(vacmViewTreeFamilyTable) -> ?vacmViewTreeFamilyStorageType.
next(Name, RowIndex, Cols) ->
- snmp_generic:handle_table_next(db(Name), RowIndex, Cols,
- fa(Name), foi(Name), noc(Name)).
+ Result = snmp_generic:handle_table_next(db(Name), RowIndex, Cols,
+ fa(Name), foi(Name), noc(Name)),
+ externalize_next(Name, Result).
get(Name, RowIndex, Cols) ->
- snmp_generic:handle_table_get(db(Name), RowIndex, Cols, foi(Name)).
+ Result = snmp_generic:handle_table_get(db(Name), RowIndex, Cols,
+ foi(Name)),
+ externalize_get(Name, Cols, Result).
+
+
+externalize_next(Name, Result) when is_list(Result) ->
+ F = fun({[Col | _] = Idx, Val}) -> {Idx, externalize(Name, Col, Val)};
+ (Other) -> Other
+ end,
+ [F(R) || R <- Result];
+externalize_next(_, Result) ->
+ Result.
+
+
+externalize_get(Name, Cols, Result) when is_list(Result) ->
+ %% Patch returned values
+ F = fun({Col, {value, Val}}) -> {value, externalize(Name, Col, Val)};
+ ({_, Other}) -> Other
+ end,
+ %% Merge column numbers and return values. there must be as much
+ %% return values as there are columns requested. And then patch all values
+ [F(R) || R <- lists:zip(Cols, Result)];
+externalize_get(_, _, Result) ->
+ Result.
+
+externalize(vacmViewTreeFamilyTable, ?vacmViewTreeFamilyMask, Val) ->
+ imask2emask(Val);
+externalize(_, _, Val) ->
+ Val.
+
wrongValue(V) -> throw({wrongValue, V}).
@@ -1035,4 +1137,3 @@ error(Reason) ->
config_err(F, A) ->
snmpa_error:config_err("[VIEW-BASED-ACM-MIB]: " ++ F, A).
-
diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl
index b45a47ec6b..ff7be54283 100644
--- a/lib/snmp/src/agent/snmpa.erl
+++ b/lib/snmp/src/agent/snmpa.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -39,8 +40,10 @@
enum_to_int/2, enum_to_int/3,
info/0, info/1, old_info_format/1,
- load_mibs/1, load_mibs/2,
- unload_mibs/1, unload_mibs/2,
+ load_mib/1, load_mib/2,
+ load_mibs/1, load_mibs/2, load_mibs/3,
+ unload_mib/1, unload_mib/2,
+ unload_mibs/1, unload_mibs/2, unload_mibs/3,
which_mibs/0, which_mibs/1,
whereis_mib/1, whereis_mib/2,
dump_mibs/0, dump_mibs/1,
@@ -83,11 +86,10 @@
-export([add_agent_caps/2, del_agent_caps/1, get_agent_caps/0]).
%% Audit Trail Log functions
--export([log_to_txt/1,
- log_to_txt/2, log_to_txt/3, log_to_txt/4,
- log_to_txt/5, log_to_txt/6, log_to_txt/7,
- log_to_io/1, log_to_io/2, log_to_io/3,
- log_to_io/4, log_to_io/5, log_to_io/6,
+-export([log_to_txt/1, log_to_txt/2, log_to_txt/3, log_to_txt/4,
+ log_to_txt/5, log_to_txt/6, log_to_txt/7, log_to_txt/8,
+ log_to_io/1, log_to_io/2, log_to_io/3, log_to_io/4,
+ log_to_io/5, log_to_io/6, log_to_io/7,
log_info/0,
change_log_size/1,
get_log_type/0, get_log_type/1,
@@ -111,10 +113,42 @@
-export([print_mib_info/0, print_mib_tables/0, print_mib_variables/0]).
+-export_type([
+ me/0,
+
+ %% Agent config types
+ mib_storage/0,
+ mib_storage_opt/0,
+ mib_storage_module/0,
+ mib_storage_options/0
+ ]).
+
+-deprecated([{old_info_format, 1, next_major_release}]).
+
+
-include("snmpa_atl.hrl").
-include("snmpa_internal.hrl").
+-include_lib("snmp/include/snmp_types.hrl"). % type of me needed.
+
+-define(DISCO_EXTRA_INFO, undefined).
+-define(ATL_BLOCK_DEFAULT, true).
+
--define(DISCO_EXTRA_INFO, undefined).
+%%-----------------------------------------------------------------
+%% Types
+%%-----------------------------------------------------------------
+
+-type me() :: #me{}.
+
+%% Agent config types
+-type mib_storage() :: [mib_storage_opt()].
+-type mib_storage_opt() :: {module, mib_storage_module()} |
+ {options, mib_storage_options()}.
+
+%% Module implementing the snmpa_mib_storage behaviour
+-type mib_storage_module() :: atom().
+%% Options specific to the above module
+-type mib_storage_options() :: list().
%%-----------------------------------------------------------------
@@ -269,19 +303,75 @@ backup(Agent, BackupDir) ->
dump_mibs() -> snmpa_agent:dump_mibs(snmp_master_agent).
dump_mibs(File) -> snmpa_agent:dump_mibs(snmp_master_agent, File).
+
+load_mib(Mib) ->
+ load_mib(snmp_master_agent, Mib).
+
+-spec load_mib(Agent :: pid() | atom(), Mib :: string()) ->
+ ok | {error, Reason :: already_loaded | term()}.
+
+load_mib(Agent, Mib) ->
+ case load_mibs(Agent, [Mib]) of
+ {error, {'load aborted at', Mib, Reason}} ->
+ {error, Reason};
+ Else ->
+ Else
+ end.
+
load_mibs(Mibs) ->
- load_mibs(snmp_master_agent, Mibs).
+ load_mibs(snmp_master_agent, Mibs, false).
load_mibs(Agent, Mibs) when is_list(Mibs) ->
- snmpa_agent:load_mibs(Agent, Mibs).
+ snmpa_agent:load_mibs(Agent, Mibs, false);
+load_mibs(Mibs, Force)
+ when is_list(Mibs) andalso ((Force =:= true) orelse (Force =:= false)) ->
+ load_mibs(snmp_master_agent, Mibs, Force).
+
+-spec load_mibs(Agent :: pid() | atom(),
+ Mibs :: [MibName :: string()],
+ Force :: boolean()) ->
+ ok | {error, {'load aborted at', MibName :: string(), InternalReason :: already_loaded | term()}}.
+
+load_mibs(Agent, Mibs, Force)
+ when is_list(Mibs) andalso ((Force =:= true) orelse (Force =:= false)) ->
+ snmpa_agent:load_mibs(Agent, Mibs, Force).
+
+
+unload_mib(Mib) ->
+ unload_mib(snmp_master_agent, Mib).
+
+-spec unload_mib(Agent :: pid() | atom(), Mib :: string()) ->
+ ok | {error, Reason :: not_loaded | term()}.
+
+unload_mib(Agent, Mib) ->
+ case unload_mibs(Agent, [Mib]) of
+ {error, {'unload aborted at', Mib, Reason}} ->
+ {error, Reason};
+ Else ->
+ Else
+ end.
unload_mibs(Mibs) ->
- unload_mibs(snmp_master_agent, Mibs).
+ unload_mibs(snmp_master_agent, Mibs, false).
unload_mibs(Agent, Mibs) when is_list(Mibs) ->
- snmpa_agent:unload_mibs(Agent, Mibs).
+ snmpa_agent:unload_mibs(Agent, Mibs);
+unload_mibs(Mibs, Force)
+ when is_list(Mibs) andalso ((Force =:= true) orelse (Force =:= false)) ->
+ unload_mibs(snmp_master_agent, Mibs, Force).
+
+-spec unload_mibs(Agent :: pid() | atom(),
+ Mibs :: [MibName :: string()],
+ Force :: boolean()) ->
+ ok | {error, {'unload aborted at', MibName :: string(), InternalReason :: not_loaded | term()}}.
+
+unload_mibs(Agent, Mibs, Force)
+ when is_list(Mibs) andalso ((Force =:= true) orelse (Force =:= false)) ->
+ snmpa_agent:unload_mibs(Agent, Mibs, Force).
+
which_mibs() -> which_mibs(snmp_master_agent).
which_mibs(Agent) -> snmpa_agent:which_mibs(Agent).
+
whereis_mib(Mib) ->
whereis_mib(snmp_master_agent, Mib).
whereis_mib(Agent, Mib) when is_atom(Mib) ->
@@ -783,43 +873,207 @@ get_agent_caps() ->
%%% Audit Trail Log functions
%%%-----------------------------------------------------------------
+-spec log_to_txt(LogDir :: snmp:dir()) ->
+ snmp:void().
+
log_to_txt(LogDir) ->
log_to_txt(LogDir, []).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()]) ->
+ snmp:void().
+
+log_to_txt(LogDir, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ Mibs = [],
+ OutFile = "snmpa_log.txt",
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
+
log_to_txt(LogDir, Mibs) ->
+ Block = ?ATL_BLOCK_DEFAULT,
OutFile = "snmpa_log.txt",
LogName = ?audit_trail_log_name,
LogFile = ?audit_trail_log_file,
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile).
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ OutFile = "snmpa_log.txt",
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
log_to_txt(LogDir, Mibs, OutFile) ->
+ Block = ?ATL_BLOCK_DEFAULT,
LogName = ?audit_trail_log_name,
LogFile = ?audit_trail_log_file,
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile).
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
log_to_txt(LogDir, Mibs, OutFile, LogName) ->
+ Block = ?ATL_BLOCK_DEFAULT,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
LogFile = ?audit_trail_log_file,
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile).
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) ->
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Start :: snmp_log:log_time()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) ->
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Block :: boolean(),
+ Start :: snmp_log:log_time()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Start :: snmp_log:log_time(),
+ Stop :: snmp_log:log_time()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start);
+
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) ->
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Block :: boolean(),
+ Start :: snmp_log:log_time(),
+ Stop :: snmp_log:log_time()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop) ->
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop).
log_to_io(LogDir) ->
log_to_io(LogDir, []).
+
+log_to_io(LogDir, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ Mibs = [],
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block);
log_to_io(LogDir, Mibs) ->
+ Block = ?ATL_BLOCK_DEFAULT,
LogName = ?audit_trail_log_name,
LogFile = ?audit_trail_log_file,
- snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block).
+
+log_to_io(LogDir, Mibs, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block);
log_to_io(LogDir, Mibs, LogName) ->
+ Block = ?ATL_BLOCK_DEFAULT,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block).
+
+log_to_io(LogDir, Mibs, LogName, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
LogFile = ?audit_trail_log_file,
- snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block);
log_to_io(LogDir, Mibs, LogName, LogFile) ->
- snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block).
+
+log_to_io(LogDir, Mibs, LogName, LogFile, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block);
log_to_io(LogDir, Mibs, LogName, LogFile, Start) ->
- snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start).
+
+log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start);
log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) ->
- snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop).
+
+log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop).
log_info() ->
diff --git a/lib/snmp/src/agent/snmpa_acm.erl b/lib/snmp/src/agent/snmpa_acm.erl
index 42a0d4d6a3..de67df8a06 100644
--- a/lib/snmp/src/agent/snmpa_acm.erl
+++ b/lib/snmp/src/agent/snmpa_acm.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -279,7 +280,7 @@ validate_mib_view(Oid, MibView) ->
end.
get_largest_family([{SubTree, Mask, Type} | T], Oid, Res) ->
- case check_mask(Oid, SubTree, Mask) of
+ case check_mask(Oid, SubTree, snmp_view_based_acm_mib:emask2imask(Mask)) of
true -> get_largest_family(T, Oid, add_res(length(SubTree), SubTree,
Type, Res));
false -> get_largest_family(T, Oid, Res)
@@ -344,7 +345,7 @@ validate_all_mib_view([], _MibView) ->
%% intelligent.
%%-----------------------------------------------------------------
is_definitely_not_in_mib_view(Oid, [{SubTree, Mask,?view_included}|T]) ->
- case check_maybe_mask(Oid, SubTree, Mask) of
+ case check_maybe_mask(Oid, SubTree, snmp_view_based_acm_mib:emask2imask(Mask)) of
true -> false;
false -> is_definitely_not_in_mib_view(Oid, T)
end;
diff --git a/lib/snmp/src/agent/snmpa_agent.erl b/lib/snmp/src/agent/snmpa_agent.erl
index 9d30e332f1..458b88359b 100644
--- a/lib/snmp/src/agent/snmpa_agent.erl
+++ b/lib/snmp/src/agent/snmpa_agent.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -28,7 +29,8 @@
%% External exports
-export([start_link/4, start_link/5, stop/1]).
-export([subagent_set/2,
- load_mibs/2, unload_mibs/2, which_mibs/1, whereis_mib/2, info/1,
+ load_mibs/3, unload_mibs/3,
+ which_mibs/1, whereis_mib/2, info/1,
register_subagent/3, unregister_subagent/2,
send_notification/3,
register_notification_filter/5,
@@ -71,7 +73,8 @@
handle_pdu/8, worker/2, worker_loop/1,
do_send_trap/7, do_send_trap/8]).
%% <BACKWARD-COMPAT>
--export([handle_pdu/7]).
+-export([handle_pdu/7,
+ load_mibs/2, unload_mibs/2]).
%% </BACKWARD-COMPAT>
-include("snmpa_internal.hrl").
@@ -159,12 +162,15 @@
%% it is sent to the worker, and the worker is marked as busy.
%% If a request is received when the worker is busy, a new temporary
%% worker is spawned.
+%%
%% Code change
%% ===========
%% Note that the worker(s) execute the same module as the master
%% agent. For code change we have two options - ignore the workers,
%% or send them a code change message.
+%%
%%-----------------------------------------------------------------
+
-record(state, {type,
parent,
worker,
@@ -219,22 +225,19 @@
%%-----------------------------------------------------------------
start_link(Prio, Parent, Ref, Options) ->
?d("start_link -> entry with"
- "~n Prio: ~p"
- "~n Parent: ~p"
- "~n Ref: ~p"
- "~n Options: ~p", [Prio, Parent, Ref, Options]),
- %% gen_server:start_link(?MODULE, [Prio, Parent, Ref, Options], []).
+ "~n Prio: ~p"
+ "~n Parent: ~p"
+ "~n Ref: ~p"
+ "~n Options: ~p", [Prio, Parent, Ref, Options]),
?GS_START_LINK3(Prio, Parent, Ref, Options).
start_link(Prio, Name, Parent, Ref, Options) ->
?d("start_link -> entry with"
- "~n Prio: ~p"
- "~n Name: ~p"
- "~n Parent: ~p"
- "~n Ref: ~p"
- "~n Options: ~p", [Prio, Name, Parent, Ref, Options]),
-% gen_server:start_link({local, Name}, ?MODULE,
-% [Prio, Parent, Ref, Options], []).
+ "~n Prio: ~p"
+ "~n Name: ~p"
+ "~n Parent: ~p"
+ "~n Ref: ~p"
+ "~n Options: ~p", [Prio, Name, Parent, Ref, Options]),
?GS_START_LINK4(Prio, Name, Parent, Ref, Options).
stop(Agent) -> call(Agent, stop).
@@ -335,10 +338,10 @@ increment_counter(Counter, Initial, Max) ->
init([Prio, Parent, Ref, Options]) ->
?d("init -> entry with"
- "~n Prio: ~p"
- "~n Parent: ~p"
- "~n Ref: ~p"
- "~n Options: ~p", [Prio, Parent, Ref, Options]),
+ "~n Prio: ~p"
+ "~n Parent: ~p"
+ "~n Ref: ~p"
+ "~n Options: ~p", [Prio, Parent, Ref, Options]),
case (catch do_init(Prio, Parent, Ref, Options)) of
{ok, State} ->
?vdebug("started",[]),
@@ -528,12 +531,22 @@ subagent_set(SubAgent, Arguments) ->
%% Called by administrator (not agent; deadlock would occur)
+%% <BACKWARD-COMPAT>
load_mibs(Agent, Mibs) ->
- call(Agent, {load_mibs, Mibs}).
+ load_mibs(Agent, Mibs, false).
+%% </BACKWARD-COMPAT>
+
+load_mibs(Agent, Mibs, Force) ->
+ call(Agent, {load_mibs, Mibs, Force}).
%% Called by administrator (not agent; deadlock would occur)
+%% <BACKWARD-COMPAT>
unload_mibs(Agent, Mibs) ->
- call(Agent, {unload_mibs, Mibs}).
+ unload_mibs(Agent, Mibs, false).
+%% </BACKWARD-COMPAT>
+
+unload_mibs(Agent, Mibs, Force) ->
+ call(Agent, {unload_mibs, Mibs, Force}).
which_mibs(Agent) ->
call(Agent, which_mibs).
@@ -1134,7 +1147,7 @@ handle_call({get, Vars, Context}, _From, S) ->
"~n Vars: ~p"
"~n Context: ~p", [Vars, Context]),
put_pdu_data({undefined, undefined, undefined, undefined, Context}),
- case catch mapfoldl({?MODULE, tr_var}, [], 1, Vars) of
+ case catch mapfoldl(fun ?MODULE:tr_var/2, [], 1, Vars) of
{error, Reason} -> {reply, {error, Reason}, S};
{_, Varbinds} ->
?vdebug("Varbinds: ~p",[Varbinds]),
@@ -1155,7 +1168,7 @@ handle_call({get_next, Vars, Context}, _From, S) ->
"~n Vars: ~p"
"~n Context: ~p",[Vars, Context]),
put_pdu_data({undefined, undefined, undefined, undefined, Context}),
- case catch mapfoldl({?MODULE, tr_var}, [], 1, Vars) of
+ case catch mapfoldl(fun ?MODULE:tr_var/2, [], 1, Vars) of
{error, Reason} -> {reply, {error, Reason}, S};
{_, Varbinds} ->
?vdebug("Varbinds: ~p",[Varbinds]),
@@ -1216,13 +1229,25 @@ handle_call({unregister_subagent, SubTreeOid}, _From, S) ->
end,
{reply, Reply, S};
+%% <BACKWARD-COMPAT>
handle_call({load_mibs, Mibs}, _From, S) ->
?vlog("load mibs ~p", [Mibs]),
{reply, snmpa_mib:load_mibs(get(mibserver), Mibs), S};
+%% </BACKWARD-COMPAT>
+handle_call({load_mibs, Mibs, Force}, _From, S) ->
+ ?vlog("[~w] load mibs ~p", [Force, Mibs]),
+ {reply, snmpa_mib:load_mibs(get(mibserver), Mibs, Force), S};
+
+%% <BACKWARD-COMPAT>
handle_call({unload_mibs, Mibs}, _From, S) ->
?vlog("unload mibs ~p", [Mibs]),
{reply, snmpa_mib:unload_mibs(get(mibserver), Mibs), S};
+%% </BACKWARD-COMPAT>
+
+handle_call({unload_mibs, Mibs, Force}, _From, S) ->
+ ?vlog("[~w] unload mibs ~p", [Force, Mibs]),
+ {reply, snmpa_mib:unload_mibs(get(mibserver), Mibs, Force), S};
handle_call(which_mibs, _From, S) ->
?vlog("which mibs", []),
@@ -1457,80 +1482,80 @@ handle_mibs_cache_request(MibServer, Req) ->
%% Downgrade
%%
-code_change({down, _Vsn}, S1, downgrade_to_pre_4_17_3) ->
- #state{type = Type,
- parent = Parent,
- worker = Worker,
- worker_state = WorkerState,
- set_worker = SetWorker,
- multi_threaded = MT,
- ref = Ref,
- vsns = Vsns,
- nfilters = NF,
- note_store = NoteStore,
- mib_server = MS,
- net_if = NetIf,
- net_if_mod = NetIfMod,
- backup = Backup,
- disco = Disco,
- mibs_cache_request = MCR} = S1,
- S2 = {state,
- type = Type,
- parent = Parent,
- worker = Worker,
- worker_state = WorkerState,
- set_worker = SetWorker,
- multi_threaded = MT,
- ref = Ref,
- vsns = Vsns,
- nfilters = NF,
- note_store = NoteStore,
- mib_server = MS,
- net_if = NetIf,
- net_if_mod = NetIfMod,
- backup = Backup,
- disco = Disco,
- mibs_cache_request = MCR},
- {ok, S2};
-
-%% Upgrade
-%%
-code_change(_Vsn, S1, upgrade_from_pre_4_17_3) ->
- {state,
- type = Type,
- parent = Parent,
- worker = Worker,
- worker_state = WorkerState,
- set_worker = SetWorker,
- multi_threaded = MT,
- ref = Ref,
- vsns = Vsns,
- nfilters = NF,
- note_store = NoteStore,
- mib_server = MS,
- net_if = NetIf,
- net_if_mod = NetIfMod,
- backup = Backup,
- disco = Disco,
- mibs_cache_request = MCR} = S1,
- S2 = #state{type = Type,
- parent = Parent,
- worker = Worker,
- worker_state = WorkerState,
- set_worker = SetWorker,
- multi_threaded = MT,
- ref = Ref,
- vsns = Vsns,
- nfilters = NF,
- note_store = NoteStore,
- mib_server = MS,
- net_if = NetIf,
- net_if_mod = NetIfMod,
- backup = Backup,
- disco = Disco,
- mibs_cache_request = MCR,
- gb_max_vbs = ?DEFAULT_GB_MAX_VBS},
- {ok, S2};
+%% code_change({down, _Vsn}, S1, downgrade_to_pre_4_17_3) ->
+%% #state{type = Type,
+%% parent = Parent,
+%% worker = Worker,
+%% worker_state = WorkerState,
+%% set_worker = SetWorker,
+%% multi_threaded = MT,
+%% ref = Ref,
+%% vsns = Vsns,
+%% nfilters = NF,
+%% note_store = NoteStore,
+%% mib_server = MS,
+%% net_if = NetIf,
+%% net_if_mod = NetIfMod,
+%% backup = Backup,
+%% disco = Disco,
+%% mibs_cache_request = MCR} = S1,
+%% S2 = {state,
+%% type = Type,
+%% parent = Parent,
+%% worker = Worker,
+%% worker_state = WorkerState,
+%% set_worker = SetWorker,
+%% multi_threaded = MT,
+%% ref = Ref,
+%% vsns = Vsns,
+%% nfilters = NF,
+%% note_store = NoteStore,
+%% mib_server = MS,
+%% net_if = NetIf,
+%% net_if_mod = NetIfMod,
+%% backup = Backup,
+%% disco = Disco,
+%% mibs_cache_request = MCR},
+%% {ok, S2};
+
+%% %% Upgrade
+%% %%
+%% code_change(_Vsn, S1, upgrade_from_pre_4_17_3) ->
+%% {state,
+%% type = Type,
+%% parent = Parent,
+%% worker = Worker,
+%% worker_state = WorkerState,
+%% set_worker = SetWorker,
+%% multi_threaded = MT,
+%% ref = Ref,
+%% vsns = Vsns,
+%% nfilters = NF,
+%% note_store = NoteStore,
+%% mib_server = MS,
+%% net_if = NetIf,
+%% net_if_mod = NetIfMod,
+%% backup = Backup,
+%% disco = Disco,
+%% mibs_cache_request = MCR} = S1,
+%% S2 = #state{type = Type,
+%% parent = Parent,
+%% worker = Worker,
+%% worker_state = WorkerState,
+%% set_worker = SetWorker,
+%% multi_threaded = MT,
+%% ref = Ref,
+%% vsns = Vsns,
+%% nfilters = NF,
+%% note_store = NoteStore,
+%% mib_server = MS,
+%% net_if = NetIf,
+%% net_if_mod = NetIfMod,
+%% backup = Backup,
+%% disco = Disco,
+%% mibs_cache_request = MCR,
+%% gb_max_vbs = ?DEFAULT_GB_MAX_VBS},
+%% {ok, S2};
code_change(_Vsn, S, _Extra) ->
{ok, S}.
@@ -2488,10 +2513,19 @@ handle_mib_of(MibServer, Oid) ->
%% Func: process_msg/7
%% Returns: RePdu
%%-----------------------------------------------------------------
-process_msg(MibView, Vsn, Pdu, PduMS, Community, {Ip, Udp}, ContextName,
- GbMaxVBs) ->
+process_msg(
+ MibView, Vsn, Pdu, PduMS, Community,
+ SourceAddress, ContextName, GbMaxVBs) ->
#pdu{request_id = ReqId} = Pdu,
- put(snmp_address, {tuple_to_list(Ip), Udp}),
+ put(
+ snmp_address,
+ case SourceAddress of
+ {Domain, _} when is_atom(Domain) ->
+ SourceAddress;
+ {Ip, Port} when is_integer(Port) ->
+ %% Legacy transport domain
+ {tuple_to_list(Ip), Port}
+ end),
put(snmp_request_id, ReqId),
put(snmp_community, Community),
put(snmp_context, ContextName),
@@ -4411,7 +4445,7 @@ get_mibs(Opts) ->
get_option(mibs, Opts, []).
get_mib_storage(Opts) ->
- get_option(mib_storage, Opts, ets).
+ get_option(mib_storage, Opts).
get_set_mechanism(Opts) ->
get_option(set_mechanism, Opts, snmpa_set).
@@ -4450,6 +4484,9 @@ net_if_verbosity(_Pid,_Verbosity) ->
ok.
+get_option(Key, Opts) ->
+ snmp_misc:get_option(Key, Opts).
+
get_option(Key, Opts, Default) ->
snmp_misc:get_option(Key, Opts, Default).
diff --git a/lib/snmp/src/agent/snmpa_agent_sup.erl b/lib/snmp/src/agent/snmpa_agent_sup.erl
index 9b8c4d12a6..0a5116b2d0 100644
--- a/lib/snmp/src/agent/snmpa_agent_sup.erl
+++ b/lib/snmp/src/agent/snmpa_agent_sup.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -29,10 +30,12 @@
-export([init/1]).
-define(SERVER, ?MODULE).
+%% Always use plain ets for sub-agents
-ifdef(snmp_debug).
--define(DEFAULT_OPTS, [{verbosity, trace}]).
+-define(DEFAULT_SA_OPTS, [{mib_storage, [{module, snmpa_mib_storage_ets}]},
+ {verbosity, trace}]).
-else.
--define(DEFAULT_OPTS, []).
+-define(DEFAULT_SA_OPTS, [{mib_storage, [{module, snmpa_mib_storage_ets}]}]).
-endif.
@@ -63,8 +66,8 @@ start_subagent(ParentAgent, Subtree, Mibs) ->
Ref = make_ref(),
?d("start_subagent -> Ref: ~p", [Ref]),
Options = [{priority, Prio},
- {mibs, Mibs},
- {misc_sup, snmpa_misc_sup} | ?DEFAULT_OPTS],
+ {mibs, Mibs},
+ {misc_sup, snmpa_misc_sup} | ?DEFAULT_SA_OPTS],
Agent = {{sub_agent, Max},
{snmpa_agent, start_link,
[Prio, ParentAgent, Ref, Options]},
diff --git a/lib/snmp/src/agent/snmpa_app.erl b/lib/snmp/src/agent/snmpa_app.erl
index 4e65e8e283..86ff145e93 100644
--- a/lib/snmp/src/agent/snmpa_app.erl
+++ b/lib/snmp/src/agent/snmpa_app.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_atl.hrl b/lib/snmp/src/agent/snmpa_atl.hrl
index ec6beb3542..d07c850891 100644
--- a/lib/snmp/src/agent/snmpa_atl.hrl
+++ b/lib/snmp/src/agent/snmpa_atl.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_authentication_service.erl b/lib/snmp/src/agent/snmpa_authentication_service.erl
index b5ff8460c6..e4238a8384 100644
--- a/lib/snmp/src/agent/snmpa_authentication_service.erl
+++ b/lib/snmp/src/agent/snmpa_authentication_service.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_conf.erl b/lib/snmp/src/agent/snmpa_conf.erl
index c17a6abbd7..fc5116dac9 100644
--- a/lib/snmp/src/agent/snmpa_conf.erl
+++ b/lib/snmp/src/agent/snmpa_conf.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -47,7 +48,7 @@
read_standard_config/1,
%% target_addr.conf
- target_addr_entry/5, target_addr_entry/6,
+ target_addr_entry/5, target_addr_entry/6, target_addr_entry/7,
target_addr_entry/8, target_addr_entry/10, target_addr_entry/11,
write_target_addr_config/2, write_target_addr_config/3,
append_target_addr_config/2,
@@ -108,36 +109,25 @@ write_agent_config(Dir, Conf) ->
Hdr = header() ++ Comment,
write_agent_config(Dir, Hdr, Conf).
-write_agent_config(Dir, Hdr, Conf)
+write_agent_config(Dir, Hdr, Conf)
when is_list(Dir) and is_list(Hdr) and is_list(Conf) ->
- Verify = fun() -> verify_agent_conf(Conf) end,
- Write = fun(Fd) -> write_agent_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, "agent.conf", Verify, Write).
-
+ Order = fun snmp_framework_mib:order_agent/2,
+ Check = fun snmp_framework_mib:check_agent/2,
+ Write = fun (Fd, Entries) -> write_agent_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, "agent.conf", Order, Check, Write, Conf).
-append_agent_config(Dir, Conf)
+append_agent_config(Dir, Conf)
when is_list(Dir) and is_list(Conf) ->
- Verify = fun() -> verify_agent_conf(Conf) end,
- Write = fun(Fd) -> write_agent_conf(Fd, Conf) end,
- append_config_file(Dir, "agent.conf", Verify, Write).
-
+ Order = fun snmp_framework_mib:order_agent/2,
+ Check = fun snmp_framework_mib:check_agent/2,
+ Write = fun write_agent_conf/2,
+ append_config_file(Dir, "agent.conf", Order, Check, Write, Conf).
read_agent_config(Dir) ->
- Verify = fun(Entry) -> verify_agent_conf_entry(Entry) end,
- read_config_file(Dir, "agent.conf", Verify).
+ Order = fun snmp_framework_mib:order_agent/2,
+ Check = fun snmp_framework_mib:check_agent/2,
+ read_config_file(Dir, "agent.conf", Order, Check).
-
-verify_agent_conf([]) ->
- ok;
-verify_agent_conf([H|T]) ->
- verify_agent_conf_entry(H),
- verify_agent_conf(T);
-verify_agent_conf(X) ->
- error({bad_agent_config, X}).
-
-verify_agent_conf_entry(Entry) ->
- ok = snmp_framework_mib:check_agent(Entry),
- ok.
write_agent_conf(Fd, "", Conf) ->
write_agent_conf(Fd, Conf);
@@ -151,6 +141,10 @@ write_agent_conf(Fd, [H|T]) ->
do_write_agent_conf(Fd, H),
write_agent_conf(Fd, T).
+do_write_agent_conf(Fd, {intAgentTransports = Tag, Val}) ->
+ io:format(Fd, "{~w, ~w}.~n", [Tag, Val]);
+do_write_agent_conf(Fd, {intAgentTransportDomain = Tag, Val}) ->
+ io:format(Fd, "{~w, ~w}.~n", [Tag, Val]);
do_write_agent_conf(Fd, {intAgentIpAddress = Tag, Val}) ->
io:format(Fd, "{~w, ~w}.~n", [Tag, Val]);
do_write_agent_conf(Fd, {intAgentUDPPort = Tag, Val} ) ->
@@ -160,7 +154,7 @@ do_write_agent_conf(Fd, {intAgentMaxPacketSize = Tag, Val} ) ->
do_write_agent_conf(Fd, {snmpEngineMaxMessageSize = Tag, Val} ) ->
io:format(Fd, "{~w, ~w}.~n", [Tag, Val]);
do_write_agent_conf(Fd, {snmpEngineID = Tag, Val} ) ->
- io:format(Fd, "{~w, \"~s\"}.~n", [Tag, Val]);
+ io:format(Fd, "{~w, ~p}.~n", [Tag, Val]);
do_write_agent_conf(_Fd, Crap) ->
error({bad_agent_config, Crap}).
@@ -191,34 +185,27 @@ write_context_config(Dir, Conf) ->
write_context_config(Dir, Hdr, Conf)
when is_list(Dir) and is_list(Hdr) and is_list(Conf) ->
- Verify = fun() -> verify_context_conf(Conf) end,
- Write = fun(Fd) -> write_context_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, "context.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_context/2,
+ Write = fun (Fd, Entries) -> write_context_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, "context.conf", Order, Check, Write, Conf).
-append_context_config(Dir, Conf)
+append_context_config(Dir, Conf)
when is_list(Dir) and is_list(Conf) ->
- Verify = fun() -> verify_context_conf(Conf) end,
- Write = fun(Fd) -> write_context_conf(Fd, Conf) end,
- append_config_file(Dir, "context.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_context/2,
+ Write = fun write_context_conf/2,
+ append_config_file(Dir, "context.conf", Order, Check, Write, Conf).
read_context_config(Dir) ->
- Verify = fun(Entry) -> verify_context_conf_entry(Entry) end,
- read_config_file(Dir, "context.conf", Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_context/2,
+ read_config_file(Dir, "context.conf", Order, Check).
-
-verify_context_conf([]) ->
- ok;
-verify_context_conf([H|T]) ->
- verify_context_conf_entry(H),
- verify_context_conf(T);
-verify_context_conf(X) ->
- error({error_context_config, X}).
-
-verify_context_conf_entry(Context) ->
- {ok, _} = snmp_framework_mib:check_context(Context),
- ok.
+
+check_context(Entry, State) ->
+ {check_ok(snmp_framework_mib:check_context(Entry)),
+ State}.
write_context_conf(Fd, "", Conf) ->
write_context_conf(Fd, Conf);
@@ -271,36 +258,29 @@ write_community_config(Dir, Conf) ->
Hdr = header() ++ Comment,
write_community_config(Dir, Hdr, Conf).
-write_community_config(Dir, Hdr, Conf)
+write_community_config(Dir, Hdr, Conf)
when is_list(Dir) and is_list(Hdr) and is_list(Conf) ->
- Verify = fun() -> verify_community_conf(Conf) end,
- Write = fun(Fd) -> write_community_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, "community.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_community/2,
+ Write = fun (Fd, Entries) -> write_community_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, "community.conf", Order, Check, Write, Conf).
-append_community_config(Dir, Conf)
+append_community_config(Dir, Conf)
when is_list(Dir) and is_list(Conf) ->
- Verify = fun() -> verify_community_conf(Conf) end,
- Write = fun(Fd) -> write_community_conf(Fd, Conf) end,
- append_config_file(Dir, "community.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_community/2,
+ Write = fun write_community_conf/2,
+ append_config_file(Dir, "community.conf", Order, Check, Write, Conf).
read_community_config(Dir) ->
- Verify = fun(Entry) -> verify_community_conf_entry(Entry) end,
- read_config_file(Dir, "community.conf", Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_community/2,
+ read_config_file(Dir, "community.conf", Order, Check).
-
-verify_community_conf([]) ->
- ok;
-verify_community_conf([H|T]) ->
- verify_community_conf_entry(H),
- verify_community_conf(T);
-verify_community_conf(X) ->
- error({invalid_community_config, X}).
-
-verify_community_conf_entry(Context) ->
- {ok, _} = snmp_community_mib:check_community(Context),
- ok.
+
+check_community(Entry, State) ->
+ {check_ok(snmp_community_mib:check_community(Entry)),
+ State}.
write_community_conf(Fd, "", Conf) ->
write_community_conf(Fd, Conf);
@@ -309,14 +289,17 @@ write_community_conf(Fd, Hdr, Conf) ->
write_community_conf(Fd, Conf).
write_community_conf(Fd, Conf) ->
- Fun = fun({Idx, Name, SecName, CtxName, TranspTag}) ->
- io:format(Fd, "{\"~s\", \"~s\", \"~s\", \"~s\", \"~s\"}.~n",
- [Idx, Name, SecName, CtxName, TranspTag]);
+ Fun =
+ fun({Idx, Name, SecName, CtxName, TranspTag}) ->
+ io:format(
+ Fd,
+ "{\"~s\", \"~s\", \"~s\", \"~s\", \"~s\"}.~n",
+ [Idx, Name, SecName, CtxName, TranspTag]);
(Crap) ->
- error({bad_community_config, Crap})
+ error({bad_community_config, Crap})
end,
lists:foreach(Fun, Conf).
-
+
%%
%% ------ standard.conf ------
@@ -343,40 +326,29 @@ write_standard_config(Dir, Conf) ->
Hdr = header() ++ Comment,
write_standard_config(Dir, Hdr, Conf).
-write_standard_config(Dir, Hdr, Conf)
+write_standard_config(Dir, Hdr, Conf)
when is_list(Dir) and is_list(Hdr) and is_list(Conf) ->
- Verify = fun() -> verify_standard_conf(Conf) end,
- Write = fun(Fd) -> write_standard_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, "standard.conf", Verify, Write).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_standard/2,
+ Write = fun (Fd, Entries) -> write_standard_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, "standard.conf", Order, Check, Write, Conf).
-
-append_standard_config(Dir, Conf)
+append_standard_config(Dir, Conf)
when is_list(Dir) and is_list(Conf) ->
- Verify = fun() -> verify_standard_conf(Conf) end,
- Write = fun(Fd) -> write_standard_conf(Fd, Conf) end,
- append_config_file(Dir, "standard.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_standard/2,
+ Write = fun write_standard_conf/2,
+ append_config_file(Dir, "standard.conf", Order, Check, Write, Conf).
read_standard_config(Dir) ->
- Verify = fun(Entry) -> verify_standard_conf_entry(Entry) end,
- read_config_file(Dir, "standard.conf", Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_standard/2,
+ read_config_file(Dir, "standard.conf", Order, Check).
-
-verify_standard_conf([]) ->
- ok;
-verify_standard_conf([H|T]) ->
- verify_standard_conf_entry(H),
- verify_standard_conf(T);
-verify_standard_conf(X) ->
- error({bad_standard_config, X}).
-
-verify_standard_conf_entry(Std) ->
- case snmp_standard_mib:check_standard(Std) of
- ok ->
- ok;
- {ok, _} ->
- ok
- end.
+
+check_standard(Entry, State) ->
+ {check_ok(snmp_standard_mib:check_standard(Entry)),
+ State}.
write_standard_conf(Fd, "", Conf) ->
write_standard_conf(Fd, Conf);
@@ -410,72 +382,48 @@ do_write_standard_conf(_Fd, Tag, Val) ->
%% ------ target_addr.conf ------
%%
-target_addr_entry(Name,
- Ip,
- TagList,
- ParamsName,
- EngineId) ->
+target_addr_entry(
+ Name, Ip, TagList, ParamsName, EngineId) ->
target_addr_entry(Name, Ip, TagList, ParamsName, EngineId, []).
-target_addr_entry(Name,
- Ip,
- TagList,
- ParamsName,
- EngineId,
- TMask) ->
- target_addr_entry(Name, Ip, 162, TagList,
- ParamsName, EngineId,
- TMask, 2048).
-
-target_addr_entry(Name,
- Ip,
- Udp,
- TagList,
- ParamsName,
- EngineId,
- TMask,
- MaxMessageSize) ->
- target_addr_entry(Name, Ip, Udp, 1500, 3, TagList,
- ParamsName, EngineId,
- TMask, MaxMessageSize).
-
-target_addr_entry(Name,
- Ip,
- Udp,
- Timeout,
- RetryCount,
- TagList,
- ParamsName,
- EngineId,
- TMask,
- MaxMessageSize) ->
- target_addr_entry(Name, snmp_target_mib:default_domain(), Ip, Udp,
- Timeout, RetryCount, TagList,
- ParamsName, EngineId,
- TMask, MaxMessageSize).
-
-target_addr_entry(Name,
- Domain,
- Ip,
- Udp,
- Timeout,
- RetryCount,
- TagList,
- ParamsName,
- EngineId,
- TMask,
- MaxMessageSize) ->
- {Name,
- Domain,
- Ip,
- Udp,
- Timeout,
- RetryCount,
- TagList,
- ParamsName,
- EngineId,
- TMask,
- MaxMessageSize}.
+target_addr_entry(
+ Name, Domain, Addr, TagList,
+ ParamsName, EngineId) when is_atom(Domain) ->
+ target_addr_entry(
+ Name, Domain, Addr, TagList,
+ ParamsName, EngineId, []);
+target_addr_entry(
+ Name, Ip, TagList, ParamsName,
+ EngineId, TMask) ->
+ target_addr_entry(
+ Name, Ip, 162, TagList, ParamsName,
+ EngineId, TMask, 2048).
+
+target_addr_entry(
+ Name, Domain_or_Ip, Addr_or_Port, TagList,
+ ParamsName, EngineId, TMask) ->
+ target_addr_entry(
+ Name, Domain_or_Ip, Addr_or_Port, TagList,
+ ParamsName, EngineId, TMask, 2048).
+
+target_addr_entry(
+ Name, Domain_or_Ip, Addr_or_Port, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize) ->
+ target_addr_entry(
+ Name, Domain_or_Ip, Addr_or_Port, 1500, 3, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize).
+
+target_addr_entry(
+ Name, Domain_or_Ip, Addr_or_Port, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize) ->
+ {Name, Domain_or_Ip, Addr_or_Port, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize}.
+
+target_addr_entry(
+ Name, Domain, Ip, Udp, Timeout, RetryCount, TagList,
+ ParamsName, EngineId,TMask, MaxMessageSize) ->
+ {Name, Domain, Ip, Udp, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize}.
write_target_addr_config(Dir, Conf) ->
@@ -504,37 +452,29 @@ write_target_addr_config(Dir, Conf) ->
Hdr = header() ++ Comment,
write_target_addr_config(Dir, Hdr, Conf).
-write_target_addr_config(Dir, Hdr, Conf)
+write_target_addr_config(Dir, Hdr, Conf)
when is_list(Dir) and is_list(Hdr) and is_list(Conf) ->
- Verify = fun() -> verify_target_addr_conf(Conf) end,
- Write = fun(Fd) -> write_target_addr_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, "target_addr.conf", Verify, Write).
-
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_target_addr/2,
+ Write = fun (Fd, Entries) -> write_target_addr_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, "target_addr.conf", Order, Check, Write, Conf).
-append_target_addr_config(Dir, Conf)
+append_target_addr_config(Dir, Conf)
when is_list(Dir) and is_list(Conf) ->
- Verify = fun() -> verify_target_addr_conf(Conf) end,
- Write = fun(Fd) -> write_target_addr_conf(Fd, Conf) end,
- append_config_file(Dir, "target_addr.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_target_addr/2,
+ Write = fun write_target_addr_conf/2,
+ append_config_file(Dir, "target_addr.conf", Order, Check, Write, Conf).
read_target_addr_config(Dir) ->
- Verify = fun(Entry) -> verify_target_addr_conf_entry(Entry) end,
- read_config_file(Dir, "target_addr.conf", Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_target_addr/2,
+ read_config_file(Dir, "target_addr.conf", Order, Check).
-
-verify_target_addr_conf([]) ->
- ok;
-verify_target_addr_conf([H|T]) ->
- verify_target_addr_conf_entry(H),
- verify_target_addr_conf(T);
-verify_target_addr_conf(X) ->
- error({bad_target_addr_config, X}).
-
-verify_target_addr_conf_entry(Entry) ->
- {ok, _} = snmp_target_mib:check_target_addr(Entry),
- ok.
+
+check_target_addr(Entry, State) ->
+ {check_ok(snmp_target_mib:check_target_addr(Entry)),
+ State}.
write_target_addr_conf(Fd, "", Conf) ->
write_target_addr_conf(Fd, Conf);
@@ -547,29 +487,41 @@ write_target_addr_conf(Fd, Conf) ->
lists:foreach(Fun, Conf),
ok.
-do_write_target_addr_conf(Fd,
- {Name,
- Ip, Udp,
- Timeout, RetryCount, TagList,
- ParamsName, EngineId,
- TMask, MaxMessageSize}) ->
- Domain = snmp_target_mib:default_domain(),
- do_write_target_addr_conf(Fd,
- {Name,
- Domain, Ip, Udp,
- Timeout, RetryCount, TagList,
- ParamsName, EngineId,
- TMask, MaxMessageSize});
-do_write_target_addr_conf(Fd,
- {Name,
- Domain, Ip, Udp,
- Timeout, RetryCount, TagList,
- ParamsName, EngineId,
- TMask, MaxMessageSize}) ->
- io:format(Fd,
- "{\"~s\", ~w, ~w, ~w, ~w, ~w, \"~s\", \"~s\", \"~s\", ~w, ~w}.~n",
- [Name, Domain, Ip, Udp, Timeout, RetryCount, TagList,
- ParamsName, EngineId, TMask, MaxMessageSize]);
+do_write_target_addr_conf(
+ Fd,
+ {Name, Domain, Address, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize})
+ when is_atom(Domain) ->
+ io:format(
+ Fd,
+ "{\"~s\", ~w, ~w, ~w, ~w, \"~s\", \"~s\", \"~s\", ~w, ~w}.~n",
+ [Name, Domain, Address, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize]);
+do_write_target_addr_conf(
+ Fd,
+ {Name, Ip, Udp, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize})
+ when is_integer(Udp) ->
+ Domain = snmp_target_mib:default_domain(),
+ Address = {Ip, Udp},
+ do_write_target_addr_conf(
+ Fd,
+ {Name, Domain, Address, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize});
+do_write_target_addr_conf(
+ _Fd,
+ {_Name, Domain, Address, _Timeout, _RetryCount, _TagList,
+ _ParamsName, _EngineId, _TMask, _MaxMessageSize}) ->
+ error({bad_address, {Domain, Address}});
+do_write_target_addr_conf(
+ Fd,
+ {Name, Domain, Ip, Udp, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize}) ->
+ Address = {Ip, Udp},
+ do_write_target_addr_conf(
+ Fd,
+ {Name, Domain, Address, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize});
do_write_target_addr_conf(_Fd, Crap) ->
error({bad_target_addr_config, Crap}).
@@ -613,34 +565,27 @@ write_target_params_config(Dir, Conf) ->
write_target_params_config(Dir, Hdr, Conf)
when is_list(Dir) and is_list(Hdr) and is_list(Conf) ->
- Verify = fun() -> verify_target_params_conf(Conf) end,
- Write = fun(Fd) -> write_target_params_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, "target_params.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_target_params/2,
+ Write = fun (Fd, Entries) -> write_target_params_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, "target_params.conf", Order, Check, Write, Conf).
append_target_params_config(Dir, Conf)
when is_list(Dir) and is_list(Conf) ->
- Verify = fun() -> verify_target_params_conf(Conf) end,
- Write = fun(Fd) -> write_target_params_conf(Fd, Conf) end,
- append_config_file(Dir, "target_params.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_target_params/2,
+ Write = fun write_target_params_conf/2,
+ append_config_file(Dir, "target_params.conf", Order, Check, Write, Conf).
read_target_params_config(Dir) ->
- Verify = fun(Entry) -> verify_target_params_conf_entry(Entry) end,
- read_config_file(Dir, "target_params.conf", Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_target_params/2,
+ read_config_file(Dir, "target_params.conf", Order, Check).
-verify_target_params_conf([]) ->
- ok;
-verify_target_params_conf([H|T]) ->
- verify_target_params_conf_entry(H),
- verify_target_params_conf(T);
-verify_target_params_conf(X) ->
- error({bad_target_params_config, X}).
-
-verify_target_params_conf_entry(Entry) ->
- {ok, _} = snmp_target_mib:check_target_params(Entry),
- ok.
+check_target_params(Entry, State) ->
+ {check_ok(snmp_target_mib:check_target_params(Entry)),
+ State}.
write_target_params_conf(Fd, "", Conf) ->
write_target_params_conf(Fd, Conf);
@@ -685,34 +630,27 @@ write_notify_config(Dir, Conf) ->
write_notify_config(Dir, Hdr, Conf)
when is_list(Dir) and is_list(Hdr) and is_list(Conf) ->
- Verify = fun() -> verify_notify_conf(Conf) end,
- Write = fun(Fd) -> write_notify_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, "notify.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_notify/2,
+ Write = fun (Fd, Entries) -> write_notify_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, "notify.conf", Order, Check, Write, Conf).
append_notify_config(Dir, Conf)
when is_list(Dir) and is_list(Conf) ->
- Verify = fun() -> verify_notify_conf(Conf) end,
- Write = fun(Fd) -> write_notify_conf(Fd, Conf) end,
- append_config_file(Dir, "notify.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_notify/2,
+ Write = fun write_notify_conf/2,
+ append_config_file(Dir, "notify.conf", Order, Check, Write, Conf).
read_notify_config(Dir) ->
- Verify = fun(Entry) -> verify_notify_conf_entry(Entry) end,
- read_config_file(Dir, "notify.conf", Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_notify/2,
+ read_config_file(Dir, "notify.conf", Order, Check).
-verify_notify_conf([]) ->
- ok;
-verify_notify_conf([H|T]) ->
- verify_notify_conf_entry(H),
- verify_notify_conf(T);
-verify_notify_conf(X) ->
- error({bad_notify_config, X}).
-
-verify_notify_conf_entry(Entry) ->
- {ok, _} = snmp_notification_mib:check_notify(Entry),
- ok.
+check_notify(Entry, State) ->
+ {check_ok(snmp_notification_mib:check_notify(Entry)),
+ State}.
write_notify_conf(Fd, "", Conf) ->
write_notify_conf(Fd, Conf);
@@ -781,34 +719,27 @@ write_usm_config(Dir, Conf) ->
write_usm_config(Dir, Hdr, Conf)
when is_list(Dir) and is_list(Hdr) and is_list(Conf) ->
- Verify = fun() -> verify_usm_conf(Conf) end,
- Write = fun(Fd) -> write_usm_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, "usm.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_usm/2,
+ Write = fun (Fd, Entries) -> write_usm_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, "usm.conf", Order, Check, Write, Conf).
append_usm_config(Dir, Conf)
when is_list(Dir) and is_list(Conf) ->
- Verify = fun() -> verify_usm_conf(Conf) end,
- Write = fun(Fd) -> write_usm_conf(Fd, Conf) end,
- append_config_file(Dir, "usm.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_usm/2,
+ Write = fun write_usm_conf/2,
+ append_config_file(Dir, "usm.conf", Order, Check, Write, Conf).
read_usm_config(Dir) ->
- Verify = fun(Entry) -> verify_usm_conf_entry(Entry) end,
- read_config_file(Dir, "usm.conf", Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_usm/2,
+ read_config_file(Dir, "usm.conf", Order, Check).
-verify_usm_conf([]) ->
- ok;
-verify_usm_conf([H|T]) ->
- verify_usm_conf_entry(H),
- verify_usm_conf(T);
-verify_usm_conf(X) ->
- error({bad_usm_conf, X}).
-
-verify_usm_conf_entry(Entry) ->
- {ok, _} = snmp_user_based_sm_mib:check_usm(Entry),
- ok.
+check_usm(Entry, State) ->
+ {check_ok(snmp_user_based_sm_mib:check_usm(Entry)),
+ State}.
write_usm_conf(Fd, "", Conf) ->
write_usm_conf(Fd, Conf);
@@ -820,15 +751,16 @@ write_usm_conf(Fd, Conf) ->
Fun = fun(Entry) -> do_write_usm_conf(Fd, Entry) end,
lists:foreach(Fun, Conf).
-do_write_usm_conf(Fd,
- {EngineID, UserName, SecName, Clone,
- AuthP, AuthKeyC, OwnAuthKeyC,
- PrivP, PrivKeyC, OwnPrivKeyC,
- Public, AuthKey, PrivKey}) ->
+do_write_usm_conf(
+ Fd,
+ {EngineID, UserName, SecName, Clone,
+ AuthP, AuthKeyC, OwnAuthKeyC,
+ PrivP, PrivKeyC, OwnPrivKeyC,
+ Public, AuthKey, PrivKey}) ->
io:format(Fd, "{", []),
- io:format(Fd, "\"~s\", ", [EngineID]),
- io:format(Fd, "\"~s\", ", [UserName]),
- io:format(Fd, "\"~s\", ", [SecName]),
+ io:format(Fd, "~p, ", [EngineID]),
+ io:format(Fd, "~p, ", [UserName]),
+ io:format(Fd, "~p, ", [SecName]),
io:format(Fd, "~w, ", [Clone]),
io:format(Fd, "~w, ", [AuthP]),
do_write_usm2(Fd, AuthKeyC, ", "),
@@ -890,34 +822,27 @@ write_vacm_config(Dir, Conf) ->
write_vacm_config(Dir, Hdr, Conf)
when is_list(Dir) and is_list(Hdr) and is_list(Conf) ->
- Verify = fun() -> verify_vacm_conf(Conf) end,
- Write = fun(Fd) -> write_vacm_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, "vacm.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_vacm/2,
+ Write = fun (Fd, Entries) -> write_vacm_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, "vacm.conf", Order, Check, Write, Conf).
append_vacm_config(Dir, Conf)
when is_list(Dir) and is_list(Conf) ->
- Verify = fun() -> verify_vacm_conf(Conf) end,
- Write = fun(Fd) -> write_vacm_conf(Fd, Conf) end,
- append_config_file(Dir, "vacm.conf", Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_vacm/2,
+ Write = fun write_vacm_conf/2,
+ append_config_file(Dir, "vacm.conf", Order, Check, Write, Conf).
read_vacm_config(Dir) ->
- Verify = fun(Entry) -> verify_vacm_conf_entry(Entry) end,
- read_config_file(Dir, "vacm.conf", Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_vacm/2,
+ read_config_file(Dir, "vacm.conf", Order, Check).
-verify_vacm_conf([]) ->
- ok;
-verify_vacm_conf([H|T]) ->
- verify_vacm_conf_entry(H),
- verify_vacm_conf(T);
-verify_vacm_conf(X) ->
- error({bad_vacm_conf, X}).
-
-verify_vacm_conf_entry(Entry) ->
- {ok, _} = snmp_view_based_acm_mib:check_vacm(Entry),
- ok.
+check_vacm(Entry, State) ->
+ {check_ok(snmp_view_based_acm_mib:check_vacm(Entry)),
+ State}.
write_vacm_conf(Fd, "", Conf) ->
write_vacm_conf(Fd, Conf);
@@ -929,49 +854,60 @@ write_vacm_conf(Fd, Conf) ->
Fun = fun(Entry) -> do_write_vacm_conf(Fd, Entry) end,
lists:foreach(Fun, Conf).
-do_write_vacm_conf(Fd,
- {vacmSecurityToGroup,
- SecModel, SecName, GroupName}) ->
- io:format(Fd, "{vacmSecurityToGroup, ~w, \"~s\", \"~s\"}.~n",
- [SecModel, SecName, GroupName]);
-do_write_vacm_conf(Fd,
- {vacmAccess,
- GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV}) ->
- io:format(Fd, "{vacmAccess, \"~s\", \"~s\", ~w, ~w, ~w, "
- "\"~s\", \"~s\", \"~s\"}.~n",
- [GroupName, Prefix, SecModel, SecLevel,
- Match, RV, WV, NV]);
-do_write_vacm_conf(Fd,
- {vacmViewTreeFamily,
- ViewIndex, ViewSubtree, ViewStatus, ViewMask}) ->
- io:format(Fd, "{vacmViewTreeFamily, \"~s\", ~w, ~w, ~w}.~n",
- [ViewIndex, ViewSubtree, ViewStatus, ViewMask]);
+do_write_vacm_conf(
+ Fd,
+ {vacmSecurityToGroup,
+ SecModel, SecName, GroupName}) ->
+ io:format(
+ Fd, "{vacmSecurityToGroup, ~w, ~p, ~p}.~n",
+ [SecModel, SecName, GroupName]);
+do_write_vacm_conf(
+ Fd,
+ {vacmAccess,
+ GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV}) ->
+ io:format(
+ Fd, "{vacmAccess, ~p, ~p, ~w, ~w, ~w, "
+ "~p, ~p, ~p}.~n",
+ [GroupName, Prefix, SecModel, SecLevel,
+ Match, RV, WV, NV]);
+do_write_vacm_conf(
+ Fd,
+ {vacmViewTreeFamily,
+ ViewIndex, ViewSubtree, ViewStatus, ViewMask}) ->
+ io:format(
+ Fd, "{vacmViewTreeFamily, ~p, ~w, ~w, ~w}.~n",
+ [ViewIndex, ViewSubtree, ViewStatus, ViewMask]);
do_write_vacm_conf(_Fd, Crap) ->
error({bad_vacm_config, Crap}).
%% ---- config file wrapper functions ----
-write_config_file(Dir, File, Verify, Write) ->
- snmp_config:write_config_file(Dir, File, Verify, Write).
+write_config_file(Dir, File, Order, Check, Write, Conf) ->
+ snmp_config:write_config_file(Dir, File, Order, Check, Write, Conf).
-append_config_file(Dir, File, Verify, Write) ->
- snmp_config:append_config_file(Dir, File, Verify, Write).
+append_config_file(Dir, File, Order, Check, Write, Conf) ->
+ snmp_config:append_config_file(Dir, File, Order, Check, Write, Conf).
-read_config_file(Dir, File, Verify) ->
- snmp_config:read_config_file(Dir, File, Verify).
+read_config_file(Dir, File, Order, Check) ->
+ snmp_config:read_config_file(Dir, File, Order, Check).
%% ---- config file utility functions ----
+check_ok(ok) ->
+ ok;
+check_ok({ok, _}) ->
+ ok.
+
header() ->
{Y,Mo,D} = date(),
{H,Mi,S} = time(),
- io_lib:format("%% This file was generated by "
- "~w (version-~s) ~w-~2.2.0w-~2.2.0w "
- "~2.2.0w:~2.2.0w:~2.2.0w\n",
- [?MODULE, ?version, Y, Mo, D, H, Mi, S]).
-
+ io_lib:format(
+ "%% This file was generated by "
+ "~w (version-~s) ~w-~2.2.0w-~2.2.0w "
+ "~2.2.0w:~2.2.0w:~2.2.0w\n",
+ [?MODULE, ?version, Y, Mo, D, H, Mi, S]).
error(R) ->
throw({error, R}).
diff --git a/lib/snmp/src/agent/snmpa_discovery_handler.erl b/lib/snmp/src/agent/snmpa_discovery_handler.erl
index cf38583054..ffdd6aca1e 100644
--- a/lib/snmp/src/agent/snmpa_discovery_handler.erl
+++ b/lib/snmp/src/agent/snmpa_discovery_handler.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_discovery_handler_default.erl b/lib/snmp/src/agent/snmpa_discovery_handler_default.erl
index 12a27993ab..8bd8d1973e 100644
--- a/lib/snmp/src/agent/snmpa_discovery_handler_default.erl
+++ b/lib/snmp/src/agent/snmpa_discovery_handler_default.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_error.erl b/lib/snmp/src/agent/snmpa_error.erl
index db2b8d0178..804c850593 100644
--- a/lib/snmp/src/agent/snmpa_error.erl
+++ b/lib/snmp/src/agent/snmpa_error.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_error_io.erl b/lib/snmp/src/agent/snmpa_error_io.erl
index 54cdb6baac..e961d4b525 100644
--- a/lib/snmp/src/agent/snmpa_error_io.erl
+++ b/lib/snmp/src/agent/snmpa_error_io.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_error_logger.erl b/lib/snmp/src/agent/snmpa_error_logger.erl
index b1124fd728..d52a3e48ac 100644
--- a/lib/snmp/src/agent/snmpa_error_logger.erl
+++ b/lib/snmp/src/agent/snmpa_error_logger.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_error_report.erl b/lib/snmp/src/agent/snmpa_error_report.erl
index 35c02edcab..8f28eac653 100644
--- a/lib/snmp/src/agent/snmpa_error_report.erl
+++ b/lib/snmp/src/agent/snmpa_error_report.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_general_db.erl b/lib/snmp/src/agent/snmpa_general_db.erl
index a06604c9cf..431302b6cc 100644
--- a/lib/snmp/src/agent/snmpa_general_db.erl
+++ b/lib/snmp/src/agent/snmpa_general_db.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_internal.hrl b/lib/snmp/src/agent/snmpa_internal.hrl
index 6537562d44..fe3ba9f39e 100644
--- a/lib/snmp/src/agent/snmpa_internal.hrl
+++ b/lib/snmp/src/agent/snmpa_internal.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_local_db.erl b/lib/snmp/src/agent/snmpa_local_db.erl
index 2c0cad807a..eb67b9cd6f 100644
--- a/lib/snmp/src/agent/snmpa_local_db.erl
+++ b/lib/snmp/src/agent/snmpa_local_db.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -191,6 +192,12 @@ dets_open(DbDir, DbInitError, Opts) ->
end
end;
_ ->
+ case DbInitError of
+ create_db_and_dir ->
+ ok = filelib:ensure_dir(Filename);
+ _ ->
+ ok
+ end,
case do_dets_open(Name, Filename, Opts) of
{ok, Dets} ->
?vdebug("dets open done",[]),
@@ -583,7 +590,7 @@ handle_cast({variable_inc, Name, Db, N}, State) ->
{value, Val} -> Val;
_ -> 0
end,
- insert(Db, Name, M+N rem 4294967296, State),
+ insert(Db, Name, (M+N) rem 4294967296, State),
{noreply, State};
handle_cast({verbosity,Verbosity}, State) ->
@@ -1005,6 +1012,10 @@ table_construct_row(Name, RowIndex, Status, Cols) ->
defvals = Defs, status_col = StatusCol,
first_own_index = FirstOwnIndex, not_accessible = NoAccs} =
snmp_generic:table_info(Name),
+ ?vtrace(
+ "table_construct_row Indexes: ~p~n"
+ " RowIndex: ~p",
+ [Indexes, RowIndex]),
Keys = snmp_generic:split_index_to_keys(Indexes, RowIndex),
OwnKeys = snmp_generic:get_own_indexes(FirstOwnIndex, Keys),
Row = OwnKeys ++ snmp_generic:table_create_rest(length(OwnKeys) + 1,
diff --git a/lib/snmp/src/agent/snmpa_mib.erl b/lib/snmp/src/agent/snmpa_mib.erl
index 575a018c0c..ab1098514c 100644
--- a/lib/snmp/src/agent/snmpa_mib.erl
+++ b/lib/snmp/src/agent/snmpa_mib.erl
@@ -1,24 +1,24 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
-module(snmpa_mib).
-%% c(snmpa_mib).
%%%-----------------------------------------------------------------
%%% This module implements a MIB server.
@@ -27,7 +27,7 @@
%% External exports
-export([start_link/3, stop/1,
lookup/2, next/3, which_mib/2, which_mibs/1, whereis_mib/2,
- load_mibs/2, unload_mibs/2,
+ load_mibs/3, unload_mibs/3,
register_subagent/3, unregister_subagent/2, info/1, info/2,
verbosity/2, dump/1, dump/2,
backup/2,
@@ -40,6 +40,10 @@
which_cache_size/1
]).
+%% <BACKWARD-COMPAT>
+-export([load_mibs/2, unload_mibs/2]).
+%% </BACKWARD-COMPAT>
+
%% Internal exports
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
code_change/3]).
@@ -75,12 +79,14 @@
%% Internal Data structures
%%
%% State
-%% data - is the MIB data (defined in snmpa_mib_data)
+%% data - is the MIB data (defined in mib_data module)
%% meo - mib entry override
%% teo - trap (notification) entry override
%%-----------------------------------------------------------------
--record(state, {data, meo, teo, backup,
- cache, cache_tmr, cache_autogc, cache_gclimit, cache_age}).
+-record(state,
+ {data, meo, teo, backup,
+ cache, cache_tmr, cache_autogc, cache_gclimit, cache_age,
+ data_mod}).
@@ -181,19 +187,32 @@ next(MibServer, Oid, MibView) ->
%%----------------------------------------------------------------------
%% Purpose: Loads mibs into the mib process.
%% Args: Mibs is a list of Filenames (compiled mibs).
+%% Force is a boolean
%% Returns: ok | {error, Reason}
%%----------------------------------------------------------------------
+
+%% <BACKWARD-COMPAT>
load_mibs(MibServer, Mibs) ->
- call(MibServer, {load_mibs, Mibs}).
+ load_mibs(MibServer, Mibs, false).
+%% </BACKWARD-COMPAT>
+
+load_mibs(MibServer, Mibs, Force) ->
+ call(MibServer, {load_mibs, Mibs, Force}).
%%----------------------------------------------------------------------
%% Purpose: Loads mibs into the mib process.
%% Args: Mibs is a list of Filenames (compiled mibs).
+%% Force is a boolean
%% Returns: ok | {error, Reason}
%%----------------------------------------------------------------------
+%% <BACKWARD-COMPAT>
unload_mibs(MibServer, Mibs) ->
- call(MibServer, {unload_mibs, Mibs}).
+ unload_mibs(MibServer, Mibs, false).
+%% </BACKWARD-COMPAT>
+
+unload_mibs(MibServer, Mibs, Force) ->
+ call(MibServer, {unload_mibs, Mibs, Force}).
%%----------------------------------------------------------------------
@@ -224,9 +243,9 @@ info(MibServer, Type) ->
call(MibServer, {info, Type}).
dump(MibServer) ->
- call(MibServer, dump).
+ dump(MibServer, io).
-dump(MibServer, File) when is_list(File) ->
+dump(MibServer, File) when (File =:= io) orelse is_list(File) ->
call(MibServer, {dump, File}).
backup(MibServer, BackupDir) when is_list(BackupDir) ->
@@ -256,7 +275,7 @@ init([Prio, Mibs, Opts]) ->
do_init(Prio, Mibs, Opts) ->
process_flag(priority, Prio),
process_flag(trap_exit, true),
- put(sname,ms),
+ put(sname, ms),
put(verbosity, ?vvalidate(get_verbosity(Opts))),
?vlog("starting",[]),
@@ -289,13 +308,19 @@ do_init(Prio, Mibs, Opts) ->
MeOverride = get_me_override(Opts),
TeOverride = get_te_override(Opts),
MibStorage = get_mib_storage(Opts),
- Data = snmpa_mib_data:new(MibStorage),
- ?vtrace("init -> mib data created",[]),
- case (catch mib_operations(load_mib, Mibs, Data,
+ MibDataMod = get_data_mod(Opts),
+ ?vtrace("init -> try create mib data with"
+ "~n MeOverride: ~p"
+ "~n TeOverride: ~p"
+ "~n MibStorage: ~p", [MeOverride, TeOverride, MibStorage]),
+ Data = MibDataMod:new(MibStorage),
+ ?vdebug("init -> mib data created", []),
+ case (catch mib_operations(MibDataMod,
+ load_mib, Mibs, Data,
MeOverride, TeOverride, true)) of
{ok, Data2} ->
?vdebug("started",[]),
- snmpa_mib_data:sync(Data2),
+ MibDataMod:sync(Data2),
?vdebug("mib data synced",[]),
{ok, #state{data = Data2,
teo = TeOverride,
@@ -304,7 +329,8 @@ do_init(Prio, Mibs, Opts) ->
cache_tmr = CacheGcTimer,
cache_autogc = CacheAutoGC,
cache_gclimit = CacheGcLimit,
- cache_age = CacheAge}};
+ cache_age = CacheAge,
+ data_mod = MibDataMod}};
{'aborted at', Mib, _NewData, Reason} ->
?vinfo("failed loading mib ~p: ~p",[Mib,Reason]),
{error, {Mib, Reason}}
@@ -315,32 +341,30 @@ do_init(Prio, Mibs, Opts) ->
%% Returns: {ok, NewMibData} | {'aborted at', Mib, NewData, Reason}
%% Args: Operation is load_mib | unload_mib.
%%----------------------------------------------------------------------
-mib_operations(Operation, Mibs, Data, MeOverride, TeOverride) ->
- mib_operations(Operation, Mibs, Data, MeOverride, TeOverride, false).
-
-
-mib_operations(_Operation, [], Data, _MeOverride, _TeOverride, _Force) ->
+mib_operations(_Mod, _Operation, [], Data, _MeOverride, _TeOverride, _Force) ->
{ok, Data};
-mib_operations(Operation, [Mib|Mibs], Data0, MeOverride, TeOverride, Force) ->
+mib_operations(Mod, Operation, [Mib|Mibs], Data0, MeOverride, TeOverride, Force) ->
?vtrace("mib operations ~p on"
- "~n Mibs: ~p"
- "~n with "
- "~n MeOverride: ~p"
- "~n TeOverride: ~p"
- "~n Force: ~p", [Operation,Mibs,MeOverride,TeOverride,Force]),
- Data = mib_operation(Operation, Mib, Data0, MeOverride, TeOverride, Force),
- mib_operations(Operation, Mibs, Data, MeOverride, TeOverride, Force).
-
-mib_operation(Operation, Mib, Data0, MeOverride, TeOverride, Force)
+ "~n Mibs: ~p"
+ "~n with "
+ "~n MeOverride: ~p"
+ "~n TeOverride: ~p"
+ "~n Force: ~p",
+ [Operation, Mibs, MeOverride, TeOverride, Force]),
+ Data = mib_operation(Mod,
+ Operation, Mib, Data0, MeOverride, TeOverride, Force),
+ mib_operations(Mod, Operation, Mibs, Data, MeOverride, TeOverride, Force).
+
+mib_operation(Mod, Operation, Mib, Data0, MeOverride, TeOverride, Force)
when is_list(Mib) ->
?vtrace("mib operation on mib ~p", [Mib]),
- case apply(snmpa_mib_data, Operation, [Data0,Mib,MeOverride,TeOverride]) of
- {error, 'already loaded'} when (Operation =:= load_mib) andalso
+ case apply(Mod, Operation, [Data0, Mib, MeOverride, TeOverride]) of
+ {error, already_loaded} when (Operation =:= load_mib) andalso
(Force =:= true) ->
?vlog("ignore mib ~p -> already loaded", [Mib]),
Data0;
- {error, 'not loaded'} when (Operation =:= unload_mib) andalso
- (Force =:= true) ->
+ {error, not_loaded} when (Operation =:= unload_mib) andalso
+ (Force =:= true) ->
?vlog("ignore mib ~p -> not loaded", [Mib]),
Data0;
{error, Reason} ->
@@ -350,7 +374,7 @@ mib_operation(Operation, Mib, Data0, MeOverride, TeOverride, Force)
{ok, Data} ->
Data
end;
-mib_operation(_Op, Mib, Data, _MeOverride, _TeOverride, _Force) ->
+mib_operation(_Mod, _Op, Mib, Data, _MeOverride, _TeOverride, _Force) ->
throw({'aborted at', Mib, Data, bad_mibname}).
@@ -395,15 +419,15 @@ handle_call({update_cache_opts, Key, Value}, _From, State) ->
{reply, Result, NewState};
handle_call({lookup, Oid}, _From,
- #state{data = Data, cache = Cache} = State) ->
+ #state{data = Data, cache = Cache, data_mod = Mod} = State) ->
?vlog("lookup ~p", [Oid]),
Key = {lookup, Oid},
{Reply, NewState} =
case maybe_cache_lookup(Cache, Key) of
?NO_CACHE ->
- {snmpa_mib_data:lookup(Data, Oid), State};
+ {Mod:lookup(Data, Oid), State};
[] ->
- Rep = snmpa_mib_data:lookup(Data, Oid),
+ Rep = Mod:lookup(Data, Oid),
ets:insert(Cache, {Key, Rep, timestamp()}),
{Rep, maybe_start_cache_gc_timer(State)};
[{Key, Rep, _}] ->
@@ -414,22 +438,23 @@ handle_call({lookup, Oid}, _From,
?vdebug("lookup -> Reply: ~p", [Reply]),
{reply, Reply, NewState};
-handle_call({which_mib, Oid}, _From, #state{data = Data} = State) ->
+handle_call({which_mib, Oid}, _From,
+ #state{data = Data, data_mod = Mod} = State) ->
?vlog("which_mib ~p",[Oid]),
- Reply = snmpa_mib_data:which_mib(Data, Oid),
+ Reply = Mod:which_mib(Data, Oid),
?vdebug("which_mib: ~p",[Reply]),
{reply, Reply, State};
handle_call({next, Oid, MibView}, _From,
- #state{data = Data, cache = Cache} = State) ->
+ #state{data = Data, cache = Cache, data_mod = Mod} = State) ->
?vlog("next ~p [~p]", [Oid, MibView]),
Key = {next, Oid, MibView},
{Reply, NewState} =
case maybe_cache_lookup(Cache, Key) of
?NO_CACHE ->
- {snmpa_mib_data:next(Data, Oid, MibView), State};
+ {Mod:next(Data, Oid, MibView), State};
[] ->
- Rep = snmpa_mib_data:next(Data, Oid, MibView),
+ Rep = Mod:next(Data, Oid, MibView),
ets:insert(Cache, {Key, Rep, timestamp()}),
{Rep, maybe_start_cache_gc_timer(State)};
[{Key, Rep, _}] ->
@@ -440,90 +465,110 @@ handle_call({next, Oid, MibView}, _From,
?vdebug("next -> Reply: ~p", [Reply]),
{reply, Reply, NewState};
-handle_call({load_mibs, Mibs}, _From,
- #state{data = Data,
- teo = TeOverride,
- meo = MeOverride,
- cache = Cache} = State) ->
- ?vlog("load mibs ~p",[Mibs]),
+%% <BACKWARD-COMPAT>
+handle_call({load_mibs, Mibs}, From, State) ->
+ handle_call({load_mibs, Mibs, false}, From, State);
+%% </BACKWARD-COMPAT>
+
+handle_call({load_mibs, Mibs, Force}, _From,
+ #state{data = Data,
+ teo = TeOverride,
+ meo = MeOverride,
+ cache = Cache,
+ data_mod = Mod} = State) ->
+ ?vlog("[~w] load mibs ~p", [Force, Mibs]),
%% Invalidate cache
NewCache = maybe_invalidate_cache(Cache),
- {NData,Reply} =
- case (catch mib_operations(load_mib, Mibs, Data,
- MeOverride, TeOverride)) of
+ {NData, Reply} =
+ case (catch mib_operations(Mod, load_mib, Mibs, Data,
+ MeOverride, TeOverride, Force)) of
{'aborted at', Mib, NewData, Reason} ->
?vlog("aborted at ~p for reason ~p",[Mib,Reason]),
- {NewData,{error, {'load aborted at', Mib, Reason}}};
+ {NewData, {error, {'load aborted at', Mib, Reason}}};
{ok, NewData} ->
- {NewData,ok}
+ {NewData, ok}
end,
- snmpa_mib_data:sync(NData),
+ Mod:sync(NData),
{reply, Reply, State#state{data = NData, cache = NewCache}};
-handle_call({unload_mibs, Mibs}, _From,
- #state{data = Data,
- teo = TeOverride,
- meo = MeOverride,
- cache = Cache} = State) ->
- ?vlog("unload mibs ~p",[Mibs]),
+%% <BACKWARD-COMPAT>
+handle_call({unload_mibs, Mibs}, From, State) ->
+ handle_call({unload_mibs, Mibs, false}, From, State);
+%% </BACKWARD-COMPAT>
+
+handle_call({unload_mibs, Mibs, Force}, _From,
+ #state{data = Data,
+ teo = TeOverride,
+ meo = MeOverride,
+ cache = Cache,
+ data_mod = Mod} = State) ->
+ ?vlog("[~w] unload mibs ~p", [Force, Mibs]),
%% Invalidate cache
NewCache = maybe_invalidate_cache(Cache),
%% Unload mib(s)
- {NData,Reply} =
- case (catch mib_operations(unload_mib, Mibs, Data,
- MeOverride, TeOverride)) of
+ {NData, Reply} =
+ case (catch mib_operations(Mod, unload_mib, Mibs, Data,
+ MeOverride, TeOverride, Force)) of
{'aborted at', Mib, NewData, Reason} ->
- ?vlog("aborted at ~p for reason ~p",[Mib,Reason]),
+ ?vlog("aborted at ~p for reason ~p", [Mib,Reason]),
{NewData, {error, {'unload aborted at', Mib, Reason}}};
{ok, NewData} ->
- {NewData,ok}
+ {NewData, ok}
end,
- snmpa_mib_data:sync(NData),
+ Mod:sync(NData),
{reply, Reply, State#state{data = NData, cache = NewCache}};
-handle_call(which_mibs, _From, #state{data = Data} = State) ->
+handle_call(which_mibs, _From, #state{data = Data, data_mod = Mod} = State) ->
?vlog("which mibs",[]),
- Reply = snmpa_mib_data:which_mibs(Data),
+ Reply = Mod:which_mibs(Data),
{reply, Reply, State};
-handle_call({whereis_mib, Mib}, _From, #state{data = Data} = State) ->
+handle_call({whereis_mib, Mib}, _From,
+ #state{data = Data,
+ data_mod = Mod} = State) ->
?vlog("whereis mib: ~p",[Mib]),
- Reply = snmpa_mib_data:whereis_mib(Data, Mib),
+ Reply = Mod:whereis_mib(Data, Mib),
{reply, Reply, State};
handle_call({register_subagent, Oid, Pid}, _From,
- #state{data = Data, cache = Cache} = State) ->
+ #state{data = Data,
+ cache = Cache,
+ data_mod = Mod} = State) ->
?vlog("register subagent ~p, ~p",[Oid,Pid]),
%% Invalidate cache
NewCache = maybe_invalidate_cache(Cache),
- case snmpa_mib_data:register_subagent(Data, Oid, Pid) of
+ case Mod:register_subagent(Data, Oid, Pid) of
{error, Reason} ->
?vlog("registration failed: ~p",[Reason]),
{reply, {error, Reason}, State#state{cache = NewCache}};
- NewData ->
+ {ok, NewData} ->
{reply, ok, State#state{data = NewData, cache = NewCache}}
end;
handle_call({unregister_subagent, OidOrPid}, _From,
- #state{data = Data, cache = Cache} = State) ->
+ #state{data = Data,
+ cache = Cache,
+ data_mod = Mod} = State) ->
?vlog("unregister subagent ~p",[OidOrPid]),
%% Invalidate cache
NewCache = maybe_invalidate_cache(Cache),
- case snmpa_mib_data:unregister_subagent(Data, OidOrPid) of
+ case Mod:unregister_subagent(Data, OidOrPid) of
+ {ok, NewData} ->
+ {reply, ok, State#state{data = NewData, cache = NewCache}};
{ok, NewData, DeletedSubagentPid} ->
{reply, {ok, DeletedSubagentPid}, State#state{data = NewData,
cache = NewCache}};
{error, Reason} ->
?vlog("unregistration failed: ~p",[Reason]),
- {reply, {error, Reason}, State#state{cache = NewCache}};
- NewData ->
- {reply, ok, State#state{data = NewData, cache = NewCache}}
+ {reply, {error, Reason}, State#state{cache = NewCache}}
end;
-handle_call(info, _From, #state{data = Data, cache = Cache} = State) ->
+handle_call(info, _From, #state{data = Data,
+ cache = Cache,
+ data_mod = Mod} = State) ->
?vlog("info",[]),
Reply =
- case (catch snmpa_mib_data:info(Data)) of
+ case (catch Mod:info(Data)) of
Info when is_list(Info) ->
[{cache, size_cache(Cache)} | Info];
E ->
@@ -531,10 +576,12 @@ handle_call(info, _From, #state{data = Data, cache = Cache} = State) ->
end,
{reply, Reply, State};
-handle_call({info, Type}, _From, #state{data = Data} = State) ->
+handle_call({info, Type}, _From,
+ #state{data = Data,
+ data_mod = Mod} = State) ->
?vlog("info ~p",[Type]),
Reply =
- case (catch snmpa_mib_data:info(Data, Type)) of
+ case (catch Mod:info(Data, Type)) of
Info when is_list(Info) ->
Info;
E ->
@@ -542,21 +589,19 @@ handle_call({info, Type}, _From, #state{data = Data} = State) ->
end,
{reply, Reply, State};
-handle_call(dump, _From, State) ->
- ?vlog("dump",[]),
- Reply = snmpa_mib_data:dump(State#state.data),
- {reply, Reply, State};
-
-handle_call({dump, File}, _From, #state{data = Data} = State) ->
+handle_call({dump, File}, _From,
+ #state{data = Data, data_mod = Mod} = State) ->
?vlog("dump on ~s",[File]),
- Reply = snmpa_mib_data:dump(Data, File),
+ Reply = Mod:dump(Data, File),
{reply, Reply, State};
%% This check (that there is no backup already in progress) is also
%% done in the master agent process, but just in case a user issues
%% a backup call to this process directly, we add a similar check here.
handle_call({backup, BackupDir}, From,
- #state{backup = undefined, data = Data} = State) ->
+ #state{backup = undefined,
+ data = Data,
+ data_mod = Mod} = State) ->
?vlog("backup to ~s", [BackupDir]),
Pid = self(),
V = get(verbosity),
@@ -568,7 +613,7 @@ handle_call({backup, BackupDir}, From,
put(sname, ambs),
put(verbosity, V),
Dir = filename:join([BackupDir]),
- Reply = snmpa_mib_data:backup(Data, Dir),
+ Reply = Mod:backup(Data, Dir),
Pid ! {backup_done, Reply},
unlink(Pid)
end),
@@ -637,8 +682,8 @@ handle_info(Info, State) ->
warning_msg("received unknown info: ~n~p", [Info]),
{noreply, State}.
-terminate(_Reason, #state{data = Data}) ->
- catch snmpa_mib_data:close(Data),
+terminate(_Reason, #state{data = Data, data_mod = Mod}) ->
+ catch Mod:close(Data),
ok.
@@ -655,6 +700,11 @@ terminate(_Reason, #state{data = Data}) ->
%% S2 = {state, Data, MEO, TEO, B},
%% {ok, S2};
+code_change({down, Vsn}, #state{data = Data0, data_mod = Mod} = State, Extra) ->
+ Data = Mod:code_change(down, Vsn, Extra, Data0),
+ {ok, State#state{data = Data}};
+
+
%% %% upgrade
%% %%
%% code_change(_Vsn, S1, upgrade_from_pre_4_12) ->
@@ -663,8 +713,9 @@ terminate(_Reason, #state{data = Data}) ->
%% S2 = #state{data = Data, meo = MEO, teo = TEO, backup = B, cache = Cache},
%% {ok, S2};
-code_change(_Vsn, State, _Extra) ->
- {ok, State}.
+code_change(Vsn, #state{data = Data0, data_mod = Mod} = State, Extra) ->
+ Data = Mod:code_change(up, Vsn, Extra, Data0),
+ {ok, State#state{data = Data}}.
%%-----------------------------------------------------------------
@@ -681,7 +732,10 @@ get_te_override(Options) ->
get_opt(trapentry_override, Options, false).
get_mib_storage(Options) ->
- get_opt(mib_storage, Options, ets).
+ get_opt(mib_storage, Options).
+
+get_data_mod(Options) ->
+ get_opt(data_module, Options, snmpa_mib_data_tttn).
get_cacheopt_autogc(Cache, CacheOpts) ->
IsValid = fun(AutoGC) when ((AutoGC =:= true) orelse
@@ -868,6 +922,9 @@ timestamp() ->
%% ----------------------------------------------------------------
+get_opt(Key, Options) ->
+ snmp_misc:get_option(Key, Options).
+
get_opt(Key, Options, Default) ->
snmp_misc:get_option(Key, Options, Default).
diff --git a/lib/snmp/src/agent/snmpa_mib_data.erl b/lib/snmp/src/agent/snmpa_mib_data.erl
index b80d85d2ee..fcbc0465c8 100644
--- a/lib/snmp/src/agent/snmpa_mib_data.erl
+++ b/lib/snmp/src/agent/snmpa_mib_data.erl
@@ -1,1355 +1,110 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
-module(snmpa_mib_data).
-%%%-----------------------------------------------------------------
-%%% This module implements the MIB internal data structures.
-%%% An MIB Data Structure consists of three items; an ets-table,
-%%% a tree and a list of registered subagents.
-%%% The subagent information is consequently duplicated. It resides
-%%% both in the tree and in the list.
-%%% The ets-table contains all data associated with each variable,
-%%% table, tableentry and tablecolumn in the MIB.
-%%% The tree contains information of the Oids in the MIB.
-%%%
-%%% When a mib is loaded, the tree is built from the plain list
-%%% in the binary file.
-%%%-----------------------------------------------------------------
--include("snmp_types.hrl").
--include("snmp_debug.hrl").
-
--define(VMODULE,"MDATA").
--include("snmp_verbosity.hrl").
-
--define(MIB_DATA,snmpa_mib_data).
--define(MIB_NODE,snmpa_mib_node).
--define(MIB_TREE,snmpa_mib_tree).
--define(DUMMY_TREE_GENERATION,1).
--define(DEFAULT_TREE,{tree,{undefined_node},internal}).
-%%-define(DUMMY_TREE_DB,dummy_tree_db).
-%%-define(DUMMY_TREE_DB_INIT,{?DUMMY_TREE_DB,?DEFAULT_TREE}).
-
+-include_lib("snmp/include/snmp_types.hrl").
%%%-----------------------------------------------------------------
-%%% Table of contents
-%%% =================
-%%% 1. Interface
-%%% 2. Implementation of tree access
-%%% 3. Tree building functions
-%%% 4. Tree merging
-%%% 5. Tree deletion routines
-%%% 6. Functions for subagent handling
-%%% 7. Misc functions
+%%% This is the behaviour for the MIB server backend internal
+%%% data storage.
%%%-----------------------------------------------------------------
+%% These types should really be defined elsewhere...
+-export_type([
+ mib_view/0,
+ mib_view_elem/0,
+ mib_view_mask/0,
+ mib_view_inclusion/0
+ ]).
-%%----------------------------------------------------------------------
-%% data_db is an database containing loaded mibs as:
-%% {MibName = atom(), Symbolic = ?, FullFileName = string()}
-%% it is either ets or mnesia
-%% tree_db is a database containing _one_ record with the tree!
-%% (the reason for this is part to get replication and part out of convenience)
-%% ref_tree is the root node, without any subagent.
-%% tree is the root node (same as ref_tree but with the subagents added).
-%% subagents is a list of {SAPid, Oid}
-%%----------------------------------------------------------------------
--record(mib_data, {mib_db, % table of #mib_info
- node_db, % table of #node_info
- tree_db, % table of #tree
- tree, % The actual tree
- subagents = []}).
-
--record(mib_info, {name, symbolic, file_name}).
--record(node_info, {oid, mib_name, me}).
-
-
-%% API
--export([new/0, new/1, sync/1, close/1,
- load_mib/4, unload_mib/4, which_mibs/1, whereis_mib/2,
- info/1, info/2,
- dump/1, dump/2,
- backup/2,
- lookup/2, next/3, which_mib/2,
- register_subagent/3, unregister_subagent/2]).
-
-%% Internal exports
--export([code_change/2]).
-
-
-%%-----------------------------------------------------------------
-%% A tree is represented as a N-tuple, where each element is a
-%% node. A node is:
-%% 1) {tree, Tree, Info} where Info can be {table, Id}, {table_entry, Id}
-%% or perhaps 'internal'
-%% 2) undefined_node (memory optimization (instead of {node, undefined}))
-%% 3) {node, Info} where Info can be {subagent, Pid}, {variable, Id},
-%% {table_column, Id}
-%% Id is {MibName, MibEntry}
-%% The over all root is represented as {tree, Tree, internal}.
-%%
-%% tree() = {tree, nodes(), tree_info()}
-%% nodes() = {tree() | node() | undefined_node, ...}
-%% node() = {node, node_info()}
-%% tree_info() = {table, Id} | {table_entry, Id} | internal
-%% node_info() = {subagent, Pid} | {variable, Id} | {table_colum, Id}
-%%-----------------------------------------------------------------
-
-%% This record is what is stored in the database. The 'tree' part
-%% is described above...
--record(tree,{generation = ?DUMMY_TREE_GENERATION, root = ?DEFAULT_TREE}).
-
-
-%%%======================================================================
-%%% 1. Interface
-%%%======================================================================
-
-%%-----------------------------------------------------------------
-%% Func: new/0, new/1
-%% Returns: A representation of mib data.
-%%-----------------------------------------------------------------
-new() ->
- new(ets).
-
-%% Where -> A list of nodes where the tables will be created
-new(Storage) ->
- %% First we must check if there is already something to read
- %% If a database already exists, then the tree structure has to be read
- ?vtrace("open (mib) database",[]),
- MibDb = snmpa_general_db:open(Storage, ?MIB_DATA,
- mib_info,
- record_info(fields,mib_info), set),
- ?vtrace("open (mib) node database",[]),
- NodeDb = snmpa_general_db:open(Storage, ?MIB_NODE,
- node_info,
- record_info(fields,node_info), set),
- ?vtrace("open (mib) tree database",[]),
- TreeDb = snmpa_general_db:open(Storage, ?MIB_TREE,
- tree,
- record_info(fields,tree), set),
- Tree =
- case snmpa_general_db:read(TreeDb, ?DUMMY_TREE_GENERATION) of
- false ->
- T = #tree{},
- snmpa_general_db:write(TreeDb, T),
- T;
- {value, T} ->
- T
- end,
- install_mibs(MibDb, NodeDb),
- #mib_data{mib_db = MibDb,
- node_db = NodeDb,
- tree_db = TreeDb,
- tree = Tree}.
-
-
-%%----------------------------------------------------------------------
-%% Returns: new mib data | {error, Reason}
-%%----------------------------------------------------------------------
-load_mib(MibData,FileName,MeOverride,TeOverride)
- when is_record(MibData,mib_data) andalso is_list(FileName) ->
- ?vlog("load mib file: ~p",[FileName]),
- ActualFileName = filename:rootname(FileName, ".bin") ++ ".bin",
- MibName = list_to_atom(filename:basename(FileName, ".bin")),
- (catch do_load_mib(MibData, ActualFileName, MibName,
- MeOverride, TeOverride)).
-
-do_load_mib(MibData, ActualFileName, MibName, MeOverride, TeOverride) ->
- ?vtrace("do_load_mib -> entry with"
- "~n ActualFileName: ~s"
- "~n MibName: ~p",[ActualFileName, MibName]),
- #mib_data{mib_db = MibDb,
- node_db = NodeDb,
- %% tree_db = TreeDb,
- tree = Tree} = MibData,
- verify_not_loaded(MibDb, MibName),
- ?vtrace("do_load_mib -> already loaded mibs:"
- "~n ~p",[loaded(MibDb)]),
- Mib = do_read_mib(ActualFileName),
- ?vtrace("do_load_mib -> read mib ~s",[Mib#mib.name]),
- NonInternalMes =
- lists:filter(fun(ME) -> maybe_drop_me(ME) end, Mib#mib.mes),
- OldRoot = Tree#tree.root,
- T = build_tree(NonInternalMes, MibName),
- ?d("load_mib -> "
- "~n OldRoot: ~p"
- "~n T: ~p", [OldRoot, T]),
- case (catch merge_nodes(T, OldRoot)) of
- {error_merge_nodes, Node1, Node2} ->
- ?vlog("error merging nodes:"
- "~n~p~nand~n~p", [Node1,Node2]),
- {error, oid_conflict};
- NewRoot when is_tuple(NewRoot) andalso (element(1,NewRoot) =:= tree) ->
- ?d("load_mib -> "
- "~n NewRoot: ~p", [NewRoot]),
- Symbolic = not lists:member(no_symbolic_info, Mib#mib.misc),
- case (catch check_notif_and_mes(TeOverride, MeOverride, Symbolic,
- Mib#mib.traps, NonInternalMes)) of
- true ->
- install_mes(NodeDb, MibName, NonInternalMes),
- install_mib(MibDb, Symbolic, Mib,
- MibName, ActualFileName, NonInternalMes),
- ?vtrace("installed mib ~s", [Mib#mib.name]),
- Tree2 = Tree#tree{root = NewRoot},
- %% snmpa_general_db:write(TreeDb, Tree2), %% Store later?
- {ok, MibData#mib_data{tree = Tree2}};
- Else ->
- Else
- end
- end.
-
-
-verify_not_loaded(Db, Name) ->
- case snmpa_general_db:read(Db, Name) of
- {value, #mib_info{name = Name}} ->
- throw({error, 'already loaded'});
- false ->
- ok
- end.
-
-do_read_mib(ActualFileName) ->
- case snmp_misc:read_mib(ActualFileName) of
- {error, Reason} ->
- ?vlog("Failed reading mib file ~p with reason: ~p",
- [ActualFileName,Reason]),
- throw({error, Reason});
- {ok, Mib} ->
- Mib
- end.
-
-%% The Tree DB is handled in a special way since it can be very large.
-sync(#mib_data{mib_db = M,
- node_db = N,
- tree_db = T, tree = Tree, subagents = []}) ->
- snmpa_general_db:sync(M),
- snmpa_general_db:sync(N),
- snmpa_general_db:write(T, Tree),
- snmpa_general_db:sync(T);
-sync(#mib_data{mib_db = M,
- node_db = N,
- tree_db = T, tree = Tree, subagents = SAs}) ->
-
- snmpa_general_db:sync(M),
- snmpa_general_db:sync(N),
-
- %% Ouch. Since the subagent info is dynamic we do not
- %% want to store the tree containing subagent info. So, we
- %% have to create a tmp tree without those and store it.
-
- case delete_subagents(Tree, SAs) of
- {ok, TreeWithoutSAs} ->
- snmpa_general_db:write(T, TreeWithoutSAs),
- snmpa_general_db:sync(T);
- Error ->
- Error
- end.
-
-delete_subagents(Tree, []) ->
- {ok, Tree};
-delete_subagents(Tree0, [{_, Oid}|SAs]) ->
- case (catch delete_subagent(Tree0, Oid)) of
- {tree, _Tree, _Info} = Tree1 ->
- delete_subagents(Tree1, SAs);
- _Error ->
- {error, {'invalid oid', Oid}}
- end.
-
-%%----------------------------------------------------------------------
-%% (OTP-3601)
-%%----------------------------------------------------------------------
-check_notif_and_mes(TeOverride,MeOverride,Symbolic,Traps,MEs) ->
- ?vtrace("check notifications and mib entries",[]),
- check_notifications(TeOverride,Symbolic,Traps),
- check_mes(MeOverride,MEs).
-
-check_notifications(true, _Symbolic, _Traps) ->
- ?vtrace("trapentry override = true => skip check",[]),
- true;
-check_notifications(_, Symbolic, Traps) ->
- check_notifications(Symbolic, Traps).
-
-check_notifications(true, Traps) ->
- check_notifications(Traps);
-check_notifications(_, _) -> true.
-
-check_notifications([]) -> true;
-check_notifications([#trap{trapname = Key} = Trap | Traps]) ->
- ?vtrace("check notification [trap] with Key: ~p",[Key]),
- case snmpa_symbolic_store:get_notification(Key) of
- {value, Trap} -> check_notifications(Traps);
- {value, _} -> throw({error, {'trap already defined', Key}});
- undefined -> check_notifications(Traps)
- end;
-check_notifications([#notification{trapname = Key} = Notif | Traps]) ->
- ?vtrace("check notification [notification] with Key: ~p",[Key]),
- case snmpa_symbolic_store:get_notification(Key) of
- {value, Notif} ->
- check_notifications(Traps);
- {value, _} ->
- throw({error, {'notification already defined', Key}});
- undefined ->
- check_notifications(Traps)
- end;
-check_notifications([Crap | Traps]) ->
- ?vlog("skipped check of: ~n~p",[Crap]),
- check_notifications(Traps).
-
-check_mes(true,_) ->
- ?vtrace("mibentry override = true => skip check",[]),
- true;
-check_mes(_,MEs) ->
- check_mes(MEs).
-
-check_mes([]) -> true;
-check_mes([#me{aliasname = Name, oid = Oid1} | MEs]) ->
- ?vtrace("check mib entries with aliasname: ~p",[Name]),
- case snmpa_symbolic_store:aliasname_to_oid(Name) of
- {value, Oid1} ->
- check_mes(MEs);
- {value, Oid2} ->
- ?vinfo("~n expecting '~p'~n but found '~p'",[Oid1, Oid2]),
- throw({error, {'mibentry already defined', Name}});
- false ->
- check_mes(MEs)
- end;
-check_mes([Crap | MEs]) ->
- ?vlog("skipped check of: ~n~p",[Crap]),
- check_mes(MEs).
-
-
-
-%%----------------------------------------------------------------------
-%% Returns: new mib data | {error, Reason}
-%%----------------------------------------------------------------------
-unload_mib(MibData, FileName, _, _) when is_list(FileName) ->
- MibName = list_to_atom(filename:basename(FileName, ".bin")),
- (catch do_unload_mib(MibData, MibName)).
-
-do_unload_mib(MibData, MibName) ->
- ?vtrace("do_unload_mib -> entry with"
- "~n MibName: ~p", [MibName]),
- #mib_data{mib_db = MibDb,
- node_db = NodeDb,
- %% tree_db = TreeDb,
- tree = Tree} = MibData,
- #mib_info{symbolic = Symbolic} = verify_loaded(MibDb, MibName),
- NewRoot = delete_mib_from_tree(MibName, Tree#tree.root),
- MEs = uninstall_mes(NodeDb, MibName),
- uninstall_mib(MibDb, Symbolic, MibName, MEs),
- NewMibData = MibData#mib_data{tree = Tree#tree{root = NewRoot}},
- {ok, NewMibData}.
-
-verify_loaded(Db, Name) ->
- case snmpa_general_db:read(Db, Name) of
- {value, MibInfo} ->
- MibInfo;
- false ->
- throw({error, 'not loaded'})
- end.
-
-
-close(#mib_data{mib_db = MibDb, node_db = NodeDb, tree_db = TreeDb}) ->
- snmpa_general_db:close(MibDb),
- snmpa_general_db:close(NodeDb),
- snmpa_general_db:close(TreeDb),
- ok.
-
-register_subagent(#mib_data{tree = T} = MibData, Oid, Pid) ->
- case insert_subagent(Oid, T#tree.root) of
- {error, Reason} ->
- {error, Reason};
- NewRootTree ->
- SAs = [{Pid, Oid} | MibData#mib_data.subagents],
- T2 = T#tree{root = NewRootTree},
- MibData#mib_data{tree = T2, subagents = SAs}
- end.
-
-
-%%----------------------------------------------------------------------
-%% Purpose: Get a list of all loaded mibs
-%% Returns: [{Name, File}]
-%%----------------------------------------------------------------------
-
-which_mibs(#mib_data{mib_db = Db}) ->
- Mibs = snmpa_general_db:tab2list(Db),
- [{Name, File} || #mib_info{name = Name, file_name = File} <- Mibs].
-
-
-%%----------------------------------------------------------------------
-%% Purpose: Get a list of all loaded mibs
-%% Returns: [{Name, File}]
-%%----------------------------------------------------------------------
-
-whereis_mib(#mib_data{mib_db = Db}, Name) ->
- case snmpa_general_db:read(Db, Name) of
- {value, #mib_info{file_name = File}} ->
- {ok, File};
- false ->
- {error, not_found}
- end.
-
-
-%%----------------------------------------------------------------------
-%% Purpose: Deletes SA with Pid from all subtrees it handles.
-%% Returns: NewMibData.
-%%----------------------------------------------------------------------
-unregister_subagent(MibData, Pid) when is_pid(Pid) ->
- SAs = MibData#mib_data.subagents,
- case lists:keysearch(Pid, 1, SAs) of
- false -> MibData;
- {value, {Pid, Oid}} ->
- % we should never get an error since Oid is found in MibData.
- {ok, NewMibData, _DeletedSA} = unregister_subagent(MibData, Oid),
- % continue if the same Pid handles other mib subtrees.
- unregister_subagent(NewMibData, Pid)
- end;
-
-%%----------------------------------------------------------------------
-%% Purpose: Deletes one unique subagent.
-%% Returns: {error, Reason} | {ok, NewMibData, DeletedSubagentPid}
-%%----------------------------------------------------------------------
-unregister_subagent(#mib_data{tree = T} = MibData, Oid) when is_list(Oid) ->
- case catch delete_subagent(T#tree.root, Oid) of
- {tree, Tree, Info} ->
- OldSAs = MibData#mib_data.subagents,
- {value, {Pid, _Oid}} = lists:keysearch(Oid, 2, OldSAs),
- SAs = lists:keydelete(Oid, 2, OldSAs),
- T2 = T#tree{root = {tree, Tree, Info}},
- {ok,
- MibData#mib_data{tree = T2, subagents = SAs},
- Pid};
- _ ->
- {error, {'invalid oid', Oid}}
- end.
-
-%%----------------------------------------------------------------------
-%% Purpose: To inpect memory usage, loaded mibs, registered subagents
-%%----------------------------------------------------------------------
-info(MibData) ->
- ?vtrace("retrieve info",[]),
- #mib_data{mib_db = MibDb, node_db = NodeDb, tree_db = TreeDb,
- tree = Tree, subagents = SAs} = MibData,
- LoadedMibs = old_format(snmpa_general_db:tab2list(MibDb)),
- TreeSize = snmp_misc:mem_size(Tree),
- {memory, ProcSize} = erlang:process_info(self(),memory),
- MibDbSize = snmpa_general_db:info(MibDb, memory),
- NodeDbSize = snmpa_general_db:info(NodeDb, memory),
- TreeDbSize = snmpa_general_db:info(TreeDb, memory),
- [{loaded_mibs, LoadedMibs}, {subagents, SAs}, {tree_size_bytes, TreeSize},
- {process_memory, ProcSize},
- {db_memory, [{mib,MibDbSize},{node,NodeDbSize},{tree,TreeDbSize}]}].
-
-info(#mib_data{mib_db = MibDb}, loaded_mibs) ->
- Mibs = snmpa_general_db:tab2list(MibDb),
- [filename:rootname(FN, ".bin") || #mib_info{file_name = FN} <- Mibs];
-info(#mib_data{tree = Tree}, tree_size_bytes) ->
- snmp_misc:mem_size(Tree);
-info(_, process_memory) ->
- {memory, ProcSize} = erlang:process_info(self(),memory),
- ProcSize;
-info(#mib_data{mib_db = MibDb, node_db = NodeDb, tree_db = TreeDb},
- db_memory) ->
- MibDbSize = snmpa_general_db:info(MibDb, memory),
- NodeDbSize = snmpa_general_db:info(NodeDb, memory),
- TreeDbSize = snmpa_general_db:info(TreeDb, memory),
- [{mib,MibDbSize},{node,NodeDbSize},{tree,TreeDbSize}];
-info(#mib_data{subagents = SAs}, subagents) ->
- SAs.
-
-old_format(LoadedMibs) ->
- ?vtrace("convert mib info to old format",[]),
- [{N,S,F} || #mib_info{name=N,symbolic=S,file_name=F} <- LoadedMibs].
-
-
-%%----------------------------------------------------------------------
-%% A total dump for debugging.
-%%----------------------------------------------------------------------
-dump(#mib_data{mib_db = MibDb, node_db = NodeDb, tree = Tree}) ->
- (catch io:format("MIB-tables:~n~p~n~n",
- [snmpa_general_db:tab2list(MibDb)])),
- (catch io:format("MIB-entries:~n~p~n~n",
- [snmpa_general_db:tab2list(NodeDb)])),
- (catch io:format("Tree:~n~p~n", [Tree])), % good luck reading it!
- ok.
-
-dump(#mib_data{mib_db = MibDb, node_db = NodeDb, tree = Tree}, File) ->
- case file:open(File,[write]) of
- {ok, Fd} ->
- io:format(Fd,"~s~n",
- [snmp:date_and_time_to_string(snmp:date_and_time())]),
- (catch io:format(Fd,"MIB-tables:~n~p~n~n",
- [snmpa_general_db:tab2list(MibDb)])),
- (catch io:format(Fd, "MIB-entries:~n~p~n~n",
- [snmpa_general_db:tab2list(NodeDb)])),
- io:format(Fd,"Tree:~n~p~n", [Tree]), % good luck reading it!
- file:close(Fd),
- ok;
- {error,Reason} ->
- ?vinfo("~n Failed opening file '~s' for reason ~p",
- [File,Reason]),
- {error,Reason}
- end.
-
-
-backup(#mib_data{mib_db = M, node_db = N, tree_db = T}, BackupDir) ->
- MRes = snmpa_general_db:backup(M, BackupDir),
- NRes = snmpa_general_db:backup(N, BackupDir),
- TRes = snmpa_general_db:backup(T, BackupDir),
- handle_backup_res([{mib_db, MRes}, {node_db, NRes}, {tree_db, TRes}]).
-
-handle_backup_res(Res) ->
- handle_backup_res(Res, []).
-
-handle_backup_res([], []) ->
- ok;
-handle_backup_res([], Err) ->
- {error, lists:reverse(Err)};
-handle_backup_res([{_, ok}|Res], Err) ->
- handle_backup_res(Res, Err);
-handle_backup_res([{Tag, {error, Reason}}|Res], Err) ->
- handle_backup_res(Res, [{Tag, Reason}|Err]);
-handle_backup_res([{Tag, Error}|Res], Err) ->
- handle_backup_res(Res, [{Tag, Error}|Err]).
-
-
-%%%======================================================================
-%%% 2. Implementation of tree access
-%%% lookup and next.
-%%%======================================================================
-
-
-which_mib(#mib_data{tree = T} = D, Oid) ->
- ?vtrace("which_mib -> entry with"
- "~n Oid: ~p",[Oid]),
- case (catch find_node(D, T#tree.root, Oid, [])) of
- {variable, _ME, Mib} ->
- ?vtrace("which_mib -> variable:"
- "~n Mib: ~p", [Mib]),
- {ok, Mib};
- {table, _EntryME, _, Mib} ->
- ?vtrace("which_mib -> table:"
- "~n Mib: ~p", [Mib]),
- {ok, Mib};
- {subagent, SubAgentPid, _SANextOid} ->
- ?vtrace("which_mib -> subagent:"
- "~n SubAgentPid: ~p", [SubAgentPid]),
- {error, {subagent, SubAgentPid}};
- {false, ErrorCode} ->
- ?vtrace("which_mib -> false:"
- "~n ErrorCode: ~p",[ErrorCode]),
- {error, ErrorCode};
- false ->
- ?vtrace("which_mib -> false",[]),
- {error, noSuchObject};
- {'EXIT', R} ->
- ?vtrace("which_mib -> exit:"
- "~n R: ~p",[R]),
- {error, noSuchObject}
- end.
-
-
-%%-----------------------------------------------------------------
-%% Func: lookup/2
-%% Purpose: Finds the mib entry corresponding to the Oid. If it is a
-%% variable, the Oid must be <Oid for var>.0 and if it is
-%% a table, Oid must be <table>.<entry>.<col>.<any>
-%% Returns: {variable, MibEntry} |
-%% {table_column, MibEntry, TableEntryOid} |
-%% {subagent, SubAgentPid, SAOid} |
-%% {false, Reason}
-%%-----------------------------------------------------------------
-lookup(#mib_data{tree = T} = D, Oid) ->
- ?vtrace("lookup -> entry with"
- "~n Oid: ~p",[Oid]),
- case (catch find_node(D, T#tree.root, Oid, [])) of
- {variable, ME, _Mib} when is_record(ME, me) ->
- ?vtrace("lookup -> variable:"
- "~n ME: ~p",[ME]),
- {variable, ME};
- {table, EntryME, {ColME, TableEntryOid}, _Mib} ->
- ?vtrace("lookup -> table:"
- "~n EntryME: ~p"
- "~n ColME: ~p"
- "~n RevTableEntryOid: ~p",
- [EntryME, ColME, TableEntryOid]),
- MFA = EntryME#me.mfa,
- RetME = ColME#me{mfa = MFA},
- {table_column, RetME, TableEntryOid};
- {subagent, SubAgentPid, SANextOid} ->
- ?vtrace("lookup -> subagent:"
- "~n SubAgentPid: ~p"
- "~n SANextOid: ~p", [SubAgentPid, SANextOid]),
- {subagent, SubAgentPid, SANextOid};
- {false, ErrorCode} ->
- ?vtrace("lookup -> false:"
- "~n ErrorCode: ~p",[ErrorCode]),
- {false, ErrorCode};
- false ->
- ?vtrace("lookup -> false",[]),
- {false, noSuchObject};
- {'EXIT', R} ->
- ?vtrace("lookup -> exit:"
- "~n R: ~p",[R]),
- {false, noSuchObject}
- end.
-
-
-find_node(D, {tree, Tree, {table, _}}, RestOfOid, RevOid) ->
- ?vtrace("find_node(tree,table) -> entry with"
- "~n RestOfOid: ~p"
- "~n RevOid: ~p",[RestOfOid, RevOid]),
- find_node(D, {tree, Tree, internal}, RestOfOid, RevOid);
-find_node(D, {tree, Tree, {table_entry, _}}, RestOfOid, RevOid) ->
- ?vtrace("find_node(tree,table_entry) -> entry with"
- "~n RestOfOid: ~p"
- "~n RevOid: ~p",[RestOfOid, RevOid]),
- #mib_data{node_db = Db} = D,
- Oid = lists:reverse(RevOid),
- case snmpa_general_db:read(Db, Oid) of
- {value, #node_info{me = ME, mib_name = Mib}} ->
- case find_node(D, {tree, Tree, internal}, RestOfOid, RevOid) of
- {false, ErrorCode} -> {false, ErrorCode};
- Val -> {table, ME, Val, Mib}
- end;
- false ->
- ?vinfo("find_node -> could not find table_entry ME with"
- "~n RevOid: ~p"
- "~n when"
- "~n RestOfOid: ~p",
- [RevOid, RestOfOid]),
- false
- end;
-find_node(D, {tree, Tree, _Internal}, [Int | RestOfOid], RevOid) ->
- ?vtrace("find_node(tree) -> entry with"
- "~n Int: ~p"
- "~n RestOfOid: ~p"
- "~n RevOid: ~p",[Int, RestOfOid, RevOid]),
- find_node(D, element(Int+1, Tree), RestOfOid, [Int | RevOid]);
-find_node(D, {node, {table_column, _}}, RestOfOid, [ColInt | RevOid]) ->
- ?vtrace("find_node(tree,table_column) -> entry with"
- "~n RestOfOid: ~p"
- "~n ColInt: ~p"
- "~n RevOid: ~p",[RestOfOid, ColInt, RevOid]),
- #mib_data{node_db = Db} = D,
- Oid = lists:reverse([ColInt | RevOid]),
- case snmpa_general_db:read(Db, Oid) of
- {value, #node_info{me = ME}} ->
- {ME, lists:reverse(RevOid)};
- false ->
- X = snmpa_general_db:read(Db, lists:reverse([ColInt | RevOid])),
- ?vinfo("find_node -> could not find table_column ME with"
- "~n RevOid: ~p"
- "~n trying [~p|~p]"
- "~n X: ~p",
- [RevOid, [ColInt | RevOid], X]),
- false
- end;
-find_node(D, {node, {variable, _MibName}}, [0], RevOid) ->
- ?vtrace("find_node(tree,variable,[0]) -> entry with"
- "~n RevOid: ~p",[RevOid]),
- #mib_data{node_db = Db} = D,
- Oid = lists:reverse(RevOid),
- %% {value, #node_info{me = ME}} = snmpa_general_db:read(Db, Oid),
- case snmpa_general_db:read(Db, Oid) of
- {value, #node_info{me = ME, mib_name = Mib}} ->
- {variable, ME, Mib};
- false ->
- ?vinfo("find_node -> could not find variable ME with"
- "~n RevOid: ~p", [RevOid]),
- false
- end;
-find_node(_D, {node, {variable, _MibName}}, [], _RevOid) ->
- ?vtrace("find_node(tree,variable,[]) -> entry",[]),
- {false, noSuchObject};
-find_node(_D, {node, {variable, _MibName}}, _, _RevOid) ->
- ?vtrace("find_node(tree,variable) -> entry",[]),
- {false, noSuchInstance};
-find_node(D, {node, subagent}, _RestOfOid, SARevOid) ->
- ?vtrace("find_node(tree,subagent) -> entry with"
- "~n SARevOid: ~p",[SARevOid]),
- #mib_data{subagents = SAs} = D,
- SAOid = lists:reverse(SARevOid),
- case lists:keysearch(SAOid, 2, SAs) of
- {value, {SubAgentPid, SAOid}} ->
- {subagent, SubAgentPid, SAOid};
- false ->
- ?vinfo("find_node -> could not find subagent with"
- "~n SAOid: ~p"
- "~n SAs: ~p", [SAOid, SAs]),
- false
- end;
-find_node(_D, Node, _RestOfOid, _RevOid) ->
- ?vtrace("find_node -> failed:~n~p",[Node]),
- {false, noSuchObject}.
-
-
-%%-----------------------------------------------------------------
-%% Func: next/3
-%% Purpose: Finds the lexicographically next oid.
-%% Returns: endOfMibView |
-%% {subagent, SubAgentPid, SAOid} |
-%% {variable, MibEntry, VarOid} |
-%% {table, TableOid, TableRestOid, MibEntry}
-%% If a variable is returnes, it is in the MibView.
-%% If a table or subagent is returned, it *may* be in the MibView.
-%%-----------------------------------------------------------------
-next(#mib_data{tree = T} = D, Oid, MibView) ->
- case catch next_node(D, T#tree.root, Oid, [], MibView) of
- false -> endOfMibView;
- Else -> Else
- end.
-
-%%-----------------------------------------------------------------
-%% This function is used as long as we have any Oid left. Take
-%% one integer at a time from the Oid, and traverse the tree
-%% accordingly. When the Oid is empty, call find_next.
-%% Returns: {subagent, SubAgentPid, SAOid} |
-%% false |
-%% {variable, MibEntry, VarOid} |
-%% {table, TableOid, TableRestOid, MibEntry}
-%%-----------------------------------------------------------------
-next_node(_D, undefined_node, _Oid, _RevOidSoFar, _MibView) ->
- ?vtrace("next_node(undefined_node) -> entry", []),
- false;
-
-next_node(_D, {tree, Tree, {table_entry, _Id}}, [Int | _Oid],
- _RevOidSoFar, _MibView)
- when Int+1 > size(Tree) ->
- ?vtrace("next_node(tree,table_entry) -> entry when not found whith"
- "~n Int: ~p"
- "~n size(Tree): ~p", [Int, size(Tree)]),
- false;
-next_node(D, {tree, Tree, {table_entry, _MibName}},
- Oid, RevOidSoFar, MibView) ->
- ?vtrace("next_node(tree,table_entry) -> entry when"
- "~n size(Tree): ~p"
- "~n Oid: ~p"
- "~n RevOidSoFar: ~p"
- "~n MibView: ~p", [size(Tree), Oid, RevOidSoFar, MibView]),
- OidSoFar = lists:reverse(RevOidSoFar),
- case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
- true ->
- ?vdebug("next_node(tree,table_entry) -> not in mib view",[]),
- false;
- _ ->
- #mib_data{node_db = Db} = D,
- case snmpa_general_db:read(Db, OidSoFar) of
- false ->
- ?vinfo("next_node -> could not find table_entry with"
- "~n OidSoFar: ~p", [OidSoFar]),
- false;
- {value, #node_info{me = ME}} ->
- ?vtrace("next_node(tree,table_entry) -> found: ~n ~p",
- [ME]),
- {table, OidSoFar, Oid, ME}
- end
- end;
-
-next_node(D, {tree, Tree, _Info}, [Int | RestOfOid], RevOidSoFar, MibView)
- when (Int < size(Tree)) andalso (Int >= 0) ->
- ?vtrace("next_node(tree) -> entry when"
- "~n size(Tree): ~p"
- "~n Int: ~p"
- "~n RestOfOid: ~p"
- "~n RevOidSoFar: ~p"
- "~n MibView: ~p",
- [size(Tree), Int, RestOfOid, RevOidSoFar, MibView]),
- case next_node(D, element(Int+1,Tree),
- RestOfOid, [Int|RevOidSoFar], MibView) of
- false ->
- find_next(D, {tree, Tree, _Info}, Int+1, RevOidSoFar, MibView);
- Else ->
- Else
- end;
-%% no solution
-next_node(D, {tree, Tree, _Info}, [], RevOidSoFar, MibView) ->
- ?vtrace("next_node(tree,[]) -> entry when"
- "~n size(Tree): ~p"
- "~n RevOidSoFar: ~p"
- "~n MibView: ~p",
- [size(Tree), RevOidSoFar, MibView]),
- find_next(D, {tree, Tree, _Info}, 0, RevOidSoFar, MibView);
-next_node(_D, {tree, Tree, _Info}, _RestOfOid, _RevOidSoFar, _MibView) ->
- ?vtrace("next_node(tree) -> entry when"
- "~n size(Tree): ~p", [size(Tree)]),
- false;
-
-next_node(D, {node, subagent}, Oid, RevOidSoFar, MibView) ->
- ?vtrace("next_node(node,subagent) -> entry when"
- "~n Oid: ~p"
- "~n RevOidSoFar: ~p"
- "~n MibView: ~p",
- [Oid, RevOidSoFar, MibView]),
- OidSoFar = lists:reverse(RevOidSoFar),
- case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
- true ->
- false;
- _ ->
- #mib_data{subagents = SAs} = D,
- case lists:keysearch(OidSoFar, 2, SAs) of
- {value, {SubAgentPid, OidSoFar}} ->
- {subagent, SubAgentPid, OidSoFar};
- _ ->
- ?vinfo("next_node -> could not find subagent with"
- "~n OidSoFar: ~p"
- "~n SAs: ~p", [OidSoFar, SAs]),
- false
- end
- end;
-
-next_node(D, {node, {variable, _MibName}}, [], RevOidSoFar, MibView) ->
- ?vtrace("next_node(node,variable,[]) -> entry when"
- "~n RevOidSoFar: ~p"
- "~n MibView: ~p",
- [RevOidSoFar, MibView]),
- OidSoFar = lists:reverse([0 | RevOidSoFar]),
- case snmpa_acm:validate_mib_view(OidSoFar, MibView) of
- true ->
- #mib_data{node_db = Db} = D,
- case snmpa_general_db:read(Db, lists:reverse(RevOidSoFar)) of
- false ->
- ?vinfo("next_node -> could not find variable with"
- "~n RevOidSoFar: ~p", [RevOidSoFar]),
- false;
- {value, #node_info{me = ME}} ->
- {variable, ME, OidSoFar}
- end;
- _ ->
- false
- end;
-
-next_node(_D, {node, {variable, _MibName}}, _Oid, _RevOidSoFar, _MibView) ->
- ?vtrace("next_node(node,variable) -> entry", []),
- false.
-
-%%-----------------------------------------------------------------
-%% This function is used to find the first leaf from where we
-%% are.
-%% Returns: {subagent, SubAgentPid, SAOid} |
-%% false |
-%% {variable, MibEntry, VarOid} |
-%% {table, TableOid, TableRestOid, MibEntry}
-%% PRE: This function must always be called with a {internal, Tree}
-%% node.
-%%-----------------------------------------------------------------
-find_next(D, {tree, Tree, internal}, Idx, RevOidSoFar, MibView)
- when Idx < size(Tree) ->
- case find_next(D, element(Idx+1, Tree), 0, [Idx| RevOidSoFar], MibView) of
- false ->
- find_next(D, {tree, Tree, internal}, Idx+1, RevOidSoFar, MibView);
- Other ->
- Other
- end;
-find_next(_D, {tree, _Tree, internal}, _Idx, _RevOidSoFar, _MibView) ->
- false;
-find_next(_D, undefined_node, _Idx, _RevOidSoFar, _MibView) ->
- false;
-find_next(D, {tree, Tree, {table, _MibName}}, Idx, RevOidSoFar, MibView) ->
- find_next(D, {tree, Tree, internal}, Idx, RevOidSoFar, MibView);
-find_next(D, {tree, _Tree, {table_entry, _MibName}}, _Index,
- RevOidSoFar, MibView) ->
- OidSoFar = lists:reverse(RevOidSoFar),
- case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
- true ->
- false;
- _ ->
- #mib_data{node_db = Db} = D,
- case snmpa_general_db:read(Db, OidSoFar) of
- false ->
- ?vinfo("find_next -> could not find table_entry ME with"
- "~n OidSoFar: ~p", [OidSoFar]),
- false;
- {value, #node_info{me = ME}} ->
- {table, OidSoFar, [], ME}
- end
- end;
-find_next(D, {node, {variable, _MibName}}, _Idx, RevOidSoFar, MibView) ->
- OidSoFar = lists:reverse([0 | RevOidSoFar]),
- case snmpa_acm:validate_mib_view(OidSoFar, MibView) of
- true ->
- #mib_data{node_db = Db} = D,
- case snmpa_general_db:read(Db, lists:reverse(RevOidSoFar)) of
- false ->
- ?vinfo("find_next -> could not find variable with"
- "~n RevOidSoFar: ~p", [RevOidSoFar]),
- false;
- {value, #node_info{me = ME}} ->
- {variable, ME, OidSoFar}
- end;
- _ ->
- false
- end;
-find_next(D, {node, subagent}, _Idx, RevOidSoFar, MibView) ->
- OidSoFar = lists:reverse(RevOidSoFar),
- case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
- true ->
- false;
- _ ->
- #mib_data{subagents = SAs} = D,
- case lists:keysearch(OidSoFar, 2, SAs) of
- {value, {SubAgentPid, OidSoFar}} ->
- {subagent, SubAgentPid, OidSoFar};
- false ->
- ?vinfo("find_node -> could not find subagent with"
- "~n OidSoFar: ~p"
- "~n SAs: ~p", [OidSoFar, SAs]),
- false
- end
- end.
-
-%%%======================================================================
-%%% 3. Tree building functions
-%%% Used when loading mibs.
-%%%======================================================================
-
-build_tree(Mes, MibName) ->
- ?d("build_tree -> "
- "~n Mes: ~p", [Mes]),
- {ListTree, []} = build_subtree([], Mes, MibName),
- {tree, convert_tree(ListTree), internal}.
-
-%%----------------------------------------------------------------------
-%% Purpose: Builds the tree where all oids have prefix equal to LevelPrefix.
-%% Returns: {Tree, RestMes}
-%% RestMes are Mes that should not be in this subtree.
-%% The Tree is a temporary and simplified data structure that is easy to
-%% convert to the final tuple tree used by the MIB process.
-%% A Node is represented as in the final tree.
-%% The tree is not represented as a N-tuple, but as an Index-list.
-%% Example: Temporary: [{1, Node1}, {3, Node3}]
-%% Final: {Node1, undefined_node, Node3}
-%% Pre: Mes are sorted on oid.
-%%----------------------------------------------------------------------
-build_subtree(LevelPrefix, [Me | Mes], MibName) ->
- ?vtrace("build subtree -> ~n"
- " oid: ~p~n"
- " LevelPrefix: ~p~n"
- " MibName: ~p", [Me#me.oid, LevelPrefix, MibName]),
- EType = Me#me.entrytype,
- ?vtrace("build subtree -> EType = ~p",[EType]),
- case in_subtree(LevelPrefix, Me) of
- above ->
- ?vtrace("build subtree -> above",[]),
- {[], [Me|Mes]};
- {node, Index} ->
- ?vtrace("build subtree -> node at ~p",[Index]),
- {Tree, RestMes} = build_subtree(LevelPrefix, Mes, MibName),
- {[{Index, {node, {EType, MibName}}} | Tree], RestMes};
- {subtree, Index, NewLevelPrefix} ->
- ?vtrace("build subtree -> subtree at"
- "~n ~w with ~w",
- [Index, NewLevelPrefix]),
- {BelowTree, RestMes} =
- build_subtree(NewLevelPrefix, Mes, MibName),
- {CurTree, RestMes2} =
- build_subtree(LevelPrefix, RestMes, MibName),
- {[{Index, {tree, BelowTree, {EType,MibName}}}| CurTree], RestMes2};
- {internal_subtree, Index, NewLevelPrefix} ->
- ?vtrace("build subtree -> internal_subtree at"
- "~n ~w with ~w",
- [Index,NewLevelPrefix]),
- {BelowTree, RestMes} =
- build_subtree(NewLevelPrefix, [Me | Mes], MibName),
- {CurTree, RestMes2} =
- build_subtree(LevelPrefix, RestMes, MibName),
- {[{Index, {tree, BelowTree, internal}} | CurTree], RestMes2}
- end;
-
-build_subtree(_LevelPrefix, [], _MibName) ->
- ?vtrace("build subtree -> done", []),
- {[], []}.
-
-%%--------------------------------------------------
-%% Purpose: Determine how/if/where Me should be inserted in subtree
-%% with LevelPrefix. This function does not build any tree, only
-%% determinses what should be done (by build subtree).
-%% Returns:
-%% above - Indicating that this ME should _not_ be in this subtree.
-%% {node, Index} - yes, construct a node with index Index on this level
-%% {internal_subtree, Index, NewLevelPrefix} - yes, there should be an
-%% internal subtree at this index.
-%% {subtree, Index, NewLevelPrefix} - yes, construct a subtree with
-%% NewLevelPrefix and insert this on current level in position Index.
-%%--------------------------------------------------
-in_subtree(LevelPrefix, Me) ->
- case lists:prefix(LevelPrefix, Me#me.oid) of
- true when length(Me#me.oid) > length(LevelPrefix) ->
- classify_how_in_subtree(LevelPrefix, Me);
- _ ->
- above
- end.
-
-%%--------------------------------------------------
-%% See comment about in_subtree/2. This function takes care of all cases
-%% where the ME really should be in _this_ subtree (not above).
-%%--------------------------------------------------
-classify_how_in_subtree(LevelPrefix, Me)
- when (length(Me#me.oid) =:= (length(LevelPrefix) + 1)) ->
- Oid = Me#me.oid,
- case node_or_subtree(Me#me.entrytype) of
- subtree ->
- {subtree, lists:last(Oid), Oid};
- node ->
- {node, lists:last(Oid)}
- end;
-
-classify_how_in_subtree(LevelPrefix, Me)
- when (length(Me#me.oid) > (length(LevelPrefix) + 1)) ->
- L1 = length(LevelPrefix) + 1,
- Oid = Me#me.oid,
- {internal_subtree, lists:nth(L1, Oid), lists:sublist(Oid, 1, L1)}.
-
-%%--------------------------------------------------
-%% Determines how to treat different kinds om MEs in the tree building process.
-%% Pre: all internal nodes have been removed.
-%%--------------------------------------------------
-node_or_subtree(table) -> subtree;
-node_or_subtree(table_entry) -> subtree;
-node_or_subtree(variable) -> node;
-node_or_subtree(table_column) -> node.
-
-%%--------------------------------------------------
-%% Purpose: (Recursively) Converts a temporary tree (see above) to a final tree.
-%% If input is a ListTree, output is a TupleTree.
-%% If input is a Node, output is the same Node.
-%% Pre: All Indexes are >= 0.
-%%--------------------------------------------------
-convert_tree({Index, {tree, Tree, Info}}) when Index >= 0 ->
- L = lists:map(fun convert_tree/1, Tree),
- {Index, {tree, dict_list_to_tuple(L), Info}};
-convert_tree({Index, {node, Info}}) when Index >= 0 ->
- {Index, {node, Info}};
-convert_tree(Tree) when is_list(Tree) ->
- L = lists:map(fun convert_tree/1, Tree),
- dict_list_to_tuple(L).
-
-%%----------------------------------------------------------------------
-%% Purpose: Converts a single level (that is non-recursively) from
-%% the temporary indexlist to the N-tuple.
-%% Input: A list of {Index, Data}.
-%% Output: A tuple where element Index is Data.
-%%----------------------------------------------------------------------
-dict_list_to_tuple(L) ->
- L2 = lists:keysort(1, L),
- list_to_tuple(integrate_indexes(0, L2)).
-
-%%----------------------------------------------------------------------
-%% Purpose: Helper function for dict_list_to_tuple/1.
-%% Converts an indexlist to a N-list.
-%% Input: A list of {Index, Data}.
-%% Output: A (usually longer, never shorter) list where element Index is Data.
-%% Example: [{1,hej}, {3, sven}] will give output
-%% [undefined_node, hej, undefined_node, sven].
-%% Initially CurIndex should be 0.
-%%----------------------------------------------------------------------
-integrate_indexes(CurIndex, [{CurIndex, Data} | T]) ->
- [Data | integrate_indexes(CurIndex + 1, T)];
-integrate_indexes(_Index, []) ->
- [];
-integrate_indexes(CurIndex, L) ->
- [undefined_node | integrate_indexes(CurIndex + 1, L)].
-
-%%%======================================================================
-%%% 4. Tree merging
-%%% Used by: load mib, insert subagent.
-%%%======================================================================
-
-%%----------------------------------------------------------------------
-%% Arg: Two root nodes (that is to be merged).
-%% Returns: A new root node where the nodes have been merger to one.
-%%----------------------------------------------------------------------
-merge_nodes(Same, Same) ->
- Same;
-merge_nodes(Node, undefined_node) ->
- Node;
-merge_nodes(undefined_node, Node) ->
- Node;
-merge_nodes({tree, Tree1, internal}, {tree, Tree2, internal}) ->
- {tree, merge_levels(tuple_to_list(Tree1),tuple_to_list(Tree2)), internal};
-merge_nodes(Node1, Node2) ->
- throw({error_merge_nodes, Node1, Node2}).
-
-%%----------------------------------------------------------------------
-%% Arg: Two levels to be merged.
-%% Here, a level is represented as a list of nodes. A list is easier
-%% to extend than a tuple.
-%% Returns: The resulting, merged level tuple.
-%%----------------------------------------------------------------------
-merge_levels(Level1, Level2) when length(Level1) =:= length(Level2) ->
- MergeNodes = fun(N1, N2) -> merge_nodes(N1, N2) end,
- list_to_tuple(snmp_misc:multi_map(MergeNodes, [Level1, Level2]));
-merge_levels(Level1, Level2) when length(Level1) > length(Level2) ->
- merge_levels(Level1, Level2 ++
- undefined_nodes_list(length(Level1) - length(Level2)));
-merge_levels(Level1, Level2) when length(Level1) < length(Level2) ->
- merge_levels(Level2, Level1).
-
-undefined_nodes_list(N) -> lists:duplicate(N, undefined_node).
-
-
-%%%======================================================================
-%%% 5. Tree deletion routines
-%%% (for unload mib)
-%%%======================================================================
-
-%%----------------------------------------------------------------------
-%% Purpose: Actually kicks of the tree reconstruction.
-%% Returns: {list of removed MEs, NewTree}
-%%----------------------------------------------------------------------
-delete_mib_from_tree(MibName, {tree, Tree, internal}) ->
- case delete_tree(Tree, MibName) of
- [] ->
- {tree, {undefined_node}, internal}; % reduce
- LevelList ->
- {tree, list_to_tuple(LevelList), internal}
- end.
-
-%%----------------------------------------------------------------------
-%% Purpose: Deletes all nodes associated to MibName from this level and
-%% all levels below.
-%% If the new level does not contain information (that is, no
-%% other mibs use it) anymore the empty list is returned.
-%% Returns: {MEs, The new level represented as a list}
-%%----------------------------------------------------------------------
-delete_tree(Tree, MibName) when is_tuple(Tree) ->
- NewLevel = delete_nodes(tuple_to_list(Tree), MibName, []),
- case lists:filter(fun drop_undefined_nodes/1,NewLevel) of
- [] -> [];
- _A_perhaps_shorted_list ->
- NewLevel % some other mib needs this level
- end.
-
-%%----------------------------------------------------------------------
-%% Purpose: Nodes belonging to MibName are removed from the tree.
-%% Recursively deletes sub trees to this node.
-%% Returns: {MEs, NewNodesList}
-%%----------------------------------------------------------------------
-delete_nodes([], _MibName, AccNodes) ->
- lists:reverse(AccNodes);
-
-delete_nodes([{node, {variable, MibName}}|T], MibName, AccNodes) ->
- delete_nodes(T, MibName, [undefined_node | AccNodes]);
-
-delete_nodes([{node, {table_column, MibName}}|T], MibName, AccNodes) ->
- delete_nodes(T, MibName, [undefined_node | AccNodes]);
-
-delete_nodes([{tree, _Tree, {table, MibName}}|T], MibName, AccNodes) ->
- delete_nodes(T, MibName, [undefined_node | AccNodes]);
-
-delete_nodes([{tree, _Tree, {table_entry, MibName}}|T], MibName, AccNodes) ->
- delete_nodes(T, MibName, [undefined_node | AccNodes]);
-
-delete_nodes([{tree, Tree, Info}|T], MibName, AccNodes) ->
- case delete_tree(Tree, MibName) of
- [] -> % tree completely deleted
- delete_nodes(T, MibName, [undefined_node | AccNodes]);
- LevelList ->
- delete_nodes(T, MibName,
- [{tree, list_to_tuple(LevelList), Info} | AccNodes])
- end;
-
-delete_nodes([NodeToKeep|T], MibName, AccNodes) ->
- delete_nodes(T, MibName, [NodeToKeep | AccNodes]).
-
-drop_undefined_nodes(undefined_node) -> false;
-drop_undefined_nodes(_) -> true.
-
-
-%%%======================================================================
-%%% 6. Functions for subagent handling
-%%%======================================================================
-
-%%----------------------------------------------------------------------
-%% Returns: A new Root|{error, reason}
-%%----------------------------------------------------------------------
-insert_subagent(Oid, OldRoot) ->
- ListTree = build_tree_for_subagent(Oid),
- case catch convert_tree(ListTree) of
- {'EXIT', _Reason} ->
- {error, 'cannot construct tree from oid'};
- Level when is_tuple(Level) ->
- T = {tree, Level, internal},
- case catch merge_nodes(T, OldRoot) of
- {error_merge_nodes, _Node1, _Node2} ->
- {error, oid_conflict};
- NewRoot when is_tuple(NewRoot) andalso
- (element(1, NewRoot) =:= tree) ->
- NewRoot
- end
- end.
-
-build_tree_for_subagent([Index]) ->
- [{Index, {node, subagent}}];
-
-build_tree_for_subagent([Index | T]) ->
- [{Index, {tree, build_tree_for_subagent(T), internal}}].
+-type mib_view() :: [mib_view_elem()].
+-type mib_view_elem() :: {SubTree :: snmp:oid(),
+ Mask :: [non_neg_integer()],
+ Inclusion :: mib_view_inclusion()}.
+-type mib_view_mask() :: [non_neg_integer()].
+-type mib_view_inclusion() :: 1 | 2. % 1 = included, 2 = excluded
-%%----------------------------------------------------------------------
-%% Returns: A new tree where the subagent at Oid (2nd arg) has been deleted.
-%%----------------------------------------------------------------------
-delete_subagent({tree, Tree, Info}, [Index]) ->
- {node, subagent} = element(Index+1, Tree),
- {tree, setelement(Index+1, Tree, undefined_node), Info};
-delete_subagent({tree, Tree, Info}, [Index | TI]) ->
- {tree, setelement(Index+1, Tree,
- delete_subagent(element(Index+1, Tree), TI)), Info}.
+-type filename() :: file:filename().
-%%%======================================================================
-%%% 7. Misc functions
-%%%======================================================================
-%%----------------------------------------------------------------------
-%% Installs the mibs found in the database when starting the agent.
-%% Basically calls the instrumentation functions for all non-internal
-%% mib-entries
-%%----------------------------------------------------------------------
-install_mibs(MibDb, NodeDb) ->
- MibNames = loaded(MibDb),
- ?vtrace("install_mibs -> found following mibs in database: ~n"
- "~p", [MibNames]),
- install_mibs2(NodeDb, MibNames).
+-callback new(MibStorage :: snmpa:mib_storage()) -> State :: term().
-install_mibs2(_, []) ->
- ok;
-install_mibs2(NodeDb, [MibName|MibNames]) ->
- Pattern = #node_info{oid = '_', mib_name = MibName, me = '_'},
- Nodes = snmpa_general_db:match_object(NodeDb, Pattern),
- MEs = [ME || #node_info{me = ME} <- Nodes],
- ?vtrace("install_mibs2 -> installing ~p MEs for mib ~p",
- [length(MEs),MibName]),
- NewF = fun(ME) -> call_instrumentation(ME, new) end,
- lists:foreach(NewF, MEs),
- install_mibs2(NodeDb, MibNames).
-
-
-%%----------------------------------------------------------------------
-%% Does all side effect stuff during load_mib.
-%%----------------------------------------------------------------------
-install_mib(Db, Symbolic, Mib, MibName, FileName, NonInternalMes) ->
- ?vdebug("install_mib -> entry with"
- "~n Symbolic: ~p"
- "~n MibName: ~p"
- "~n FileName: ~p", [Symbolic, MibName, FileName]),
- Rec = #mib_info{name = MibName, symbolic = Symbolic, file_name = FileName},
- snmpa_general_db:write(Db, Rec),
- install_mib2(Symbolic, MibName, Mib),
- NewF = fun(ME) -> call_instrumentation(ME, new) end,
- lists:foreach(NewF, NonInternalMes).
+-callback close(State :: term()) -> ok.
-install_mib2(true, MibName, Mib) ->
- #mib{table_infos = TabInfos,
- variable_infos = VarInfos,
- mes = MEs,
- asn1_types = ASN1Types,
- traps = Traps} = Mib,
- snmpa_symbolic_store:add_table_infos(MibName, TabInfos),
- snmpa_symbolic_store:add_variable_infos(MibName, VarInfos),
- snmpa_symbolic_store:add_aliasnames(MibName, MEs),
- snmpa_symbolic_store:add_types(MibName, ASN1Types),
- SetF = fun(Trap) ->
- snmpa_symbolic_store:set_notification(Trap, MibName)
- end,
- lists:foreach(SetF, Traps);
-install_mib2(_, _, _) ->
- ok.
+-callback sync(State :: term()) -> ok.
-install_mes(_Db, _MibName, []) ->
- ok;
-install_mes(Db, MibName, [ME|MEs]) ->
- Node = #node_info{oid = ME#me.oid, mib_name = MibName, me = ME},
- snmpa_general_db:write(Db, Node),
- install_mes(Db, MibName, MEs).
+-callback load_mib(State :: term(), FileName :: string(),
+ MeOverride :: boolean(),
+ TeOverride :: boolean()) ->
+ {ok, NewState :: term()} | {error, Reason :: already_loaded | term()}.
+-callback unload_mib(State :: term(), FileName :: string(),
+ MeOverride :: boolean(),
+ TeOverride :: boolean()) ->
+ {ok, NewState :: term()} | {error, Reason :: not_loaded | term()}.
-%%----------------------------------------------------------------------
-%% Does all side effect stuff during unload_mib.
-%%----------------------------------------------------------------------
-uninstall_mib(Db, Symbolic, MibName, MEs) ->
- ?vtrace("uninstall_mib -> entry with"
- "~n Db: ~p"
- "~n Symbolic: ~p"
- "~n MibName: ~p", [Db, Symbolic, MibName]),
- Res = snmpa_general_db:delete(Db, MibName),
- ?vtrace("uninstall_mib -> (mib) db delete result: ~p", [Res]),
- uninstall_mib2(Symbolic, MibName),
- DelF = fun(ME) -> call_instrumentation(ME, delete) end,
- lists:foreach(DelF, MEs).
+-callback lookup(State :: term(), Oid :: snmp:oid()) ->
+ {false, Reason :: term()} |
+ {variable, MibEntry :: snmpa:me()} |
+ {table_column, MibEntry :: snmpa:me(), TableEntryOid :: snmp:oid()} |
+ {subagent, SubAgentPid :: pid(), SAOid :: snmp:oid()}.
-uninstall_mib2(true, MibName) ->
- snmpa_symbolic_store:delete_table_infos(MibName),
- snmpa_symbolic_store:delete_variable_infos(MibName),
- snmpa_symbolic_store:delete_aliasnames(MibName),
- snmpa_symbolic_store:delete_types(MibName),
- snmpa_symbolic_store:delete_notifications(MibName);
-uninstall_mib2(_, _) ->
- ok.
+-callback next(State :: term(), Oid :: snmp:oid(), MibView :: mib_view()) ->
+ endOfView | false |
+ {subagent, SubAgentPid :: pid(), SAOid :: snmp:oid()} |
+ {variable, MibEntry :: snmpa:me(), VarOid :: snmp:oid()} |
+ {table, TableOid :: snmp:oid(), TableRestOid :: snmp:oid(), MibEntry :: snmpa:me()}.
-uninstall_mes(Db, MibName) ->
- Pattern = #node_info{oid = '_', mib_name = MibName, me = '_'},
- snmpa_general_db:match_delete(Db, Pattern).
+-callback register_subagent(State :: term(),
+ Oid :: snmp:oid(),
+ Pid :: pid()) ->
+ {ok, NewState :: term()} | {error, Reason :: term()}.
+-callback unregister_subagent(State :: term(),
+ PidOrOid :: pid() | snmp:oid()) ->
+ {ok, NewState :: term()} | % When second arg was a pid()
+ {ok, NewState :: term(), Pid :: pid()} | % When second arg was a oid()
+ {error, Reason :: term()}.
-%%----------------------------------------------------------------------
-%% Create a list of the names of all the loaded mibs
-%%----------------------------------------------------------------------
-loaded(Db) ->
- [N || #mib_info{name = N} <- snmpa_general_db:tab2list(Db)].
-
+-callback dump(State :: term(), Destination :: io | filename()) ->
+ ok | {error, Reason :: term()}.
-%%----------------------------------------------------------------------
-%% Calls MFA-instrumentation with 'new' or 'delete' operation.
-%%----------------------------------------------------------------------
-call_instrumentation(#me{entrytype = variable, mfa={M,F,A}}, Operation) ->
- ?vtrace("call instrumentation with"
- "~n entrytype: variable"
- "~n MFA: {~p,~p,~p}"
- "~n Operation: ~p",
- [M,F,A,Operation]),
- catch apply(M, F, [Operation | A]);
-call_instrumentation(#me{entrytype = table_entry, mfa={M,F,A}}, Operation) ->
- ?vtrace("call instrumentation with"
- "~n entrytype: table_entry"
- "~n MFA: {~p,~p,~p}"
- "~n Operation: ~p",
- [M,F,A,Operation]),
- catch apply(M, F, [Operation | A]);
-call_instrumentation(_ShitME, _Operation) ->
- done.
+-callback which_mib(State :: term(), Oid :: snmp:oid()) ->
+ {ok, Mib :: string()} | {error, Reason :: term()}.
+-callback which_mibs(State :: term()) ->
+ [{MibName :: atom(), Filename :: string()}].
-maybe_drop_me(#me{entrytype = internal}) -> false;
-maybe_drop_me(#me{entrytype = group}) -> false;
-maybe_drop_me(#me{imported = true}) -> false;
-maybe_drop_me(_) -> true.
+-callback whereis_mib(State :: term(), MibName :: atom()) ->
+ {ok, Filename :: string()} | {error, Reason :: term()}.
+-callback info(State :: term()) -> list().
-%%----------------------------------------------------------------------
-%% Code change functions
-%%----------------------------------------------------------------------
+-callback backup(State :: term(), BackupDir :: string()) ->
+ ok | {error, Reason :: term()}.
-code_change(down, State) ->
- ?d("code_change(down) -> entry",[]),
- State;
+-callback code_change(Direction :: up | down,
+ Vsn :: term(),
+ Extra :: term(),
+ State :: term()) ->
+ NewState :: term().
-code_change(up, State) ->
- ?d("code_change(up)",[]),
- State;
-code_change(_Vsn, State) ->
- State.
diff --git a/lib/snmp/src/agent/snmpa_mib_data_ttln.erl b/lib/snmp/src/agent/snmpa_mib_data_ttln.erl
new file mode 100644
index 0000000000..959230b1dd
--- /dev/null
+++ b/lib/snmp/src/agent/snmpa_mib_data_ttln.erl
@@ -0,0 +1,1403 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(snmpa_mib_data_ttln).
+
+%%%-----------------------------------------------------------------
+%%%
+%%% THIS FILE IS JUST A PLACE HOLDER - IGNORE
+%%%
+%%%-----------------------------------------------------------------
+
+
+%%%-----------------------------------------------------------------
+%%%
+%%% TTLN - TupleTreeListNodes
+%%%
+%%% This module implements the MIB internal data structures.
+%%% An MIB Data Structure consists of three items; an ets-table,
+%%% a tree and a list of registered subagents.
+%%% The subagent information is consequently duplicated. It resides
+%%% both in the tree and in the list.
+%%% The ets-table contains all data associated with each variable,
+%%% table, tableentry and tablecolumn in the MIB.
+%%% The tree contains information of the Oids in the MIB.
+%%%
+%%% When a mib is loaded, the tree is built from the plain list
+%%% in the binary file.
+%%%
+%%%-----------------------------------------------------------------
+
+-include("snmp_types.hrl").
+-include("snmp_debug.hrl").
+
+-define(VMODULE,"MDATA_TTLN").
+-include("snmp_verbosity.hrl").
+
+-behaviour(snmpa_mib_data).
+
+-define(MIB_DATA, snmpa_mib_data).
+-define(MIB_NODE, snmpa_mib_node).
+-define(MIB_TREE, snmpa_mib_tree).
+-define(DUMMY_TREE_GENERATION, 1).
+-define(DEFAULT_TREE, {tree,{undefined_node},internal}).
+
+
+%%%-----------------------------------------------------------------
+%%% Table of contents
+%%% =================
+%%% 1. Interface
+%%% 2. Implementation of tree access
+%%% 3. Tree building functions
+%%% 4. Tree merging
+%%% 5. Tree deletion routines
+%%% 6. Functions for subagent handling
+%%% 7. Misc functions
+%%%-----------------------------------------------------------------
+
+
+%%----------------------------------------------------------------------
+%% data_db is an database containing loaded mibs as:
+%% {MibName = atom(), Symbolic = ?, FullFileName = string()}
+%% it is either ets or mnesia
+%% tree_db is a database containing _one_ record with the tree!
+%% (the reason for this is part to get replication and part out of convenience)
+%% ref_tree is the root node, without any subagent.
+%% tree is the root node (same as ref_tree but with the subagents added).
+%% subagents is a list of {SAPid, Oid}
+%%----------------------------------------------------------------------
+-record(mib_data, {mib_db, % table of #mib_info
+ node_db, % table of #node_info
+ tree_db, % table of #tree
+ tree, % The actual tree
+ subagents = []}).
+
+-record(mib_info, {name, symbolic, file_name}).
+-record(node_info, {oid, mib_name, me}).
+
+
+%% API
+-export([new/0, new/1, sync/1, close/1,
+ load_mib/4, unload_mib/4, which_mibs/1, whereis_mib/2,
+ info/1, info/2,
+ dump/1, dump/2,
+ backup/2,
+ lookup/2, next/3, which_mib/2,
+ register_subagent/3, unregister_subagent/2]).
+
+%% Internal exports
+-export([code_change/2]).
+
+
+%%-----------------------------------------------------------------
+%% A tree is represented as a N-tuple, where each element is a
+%% node. A node is:
+%% 1) {tree, Tree, Info} where Info can be {table, Id}, {table_entry, Id}
+%% or perhaps 'internal'
+%% 2) undefined_node (memory optimization (instead of {node, undefined}))
+%% 3) {node, Info} where Info can be {subagent, Pid}, {variable, Id},
+%% {table_column, Id}
+%% Id is {MibName, MibEntry}
+%% The over all root is represented as {tree, Tree, internal}.
+%%
+%% tree() = {tree, nodes(), tree_info()}
+%% nodes() = [tree() | node() | undefined_node]
+%% node() = {node, node_info()}
+%% tree_info() = {table, Id} | {table_entry, Id} | internal
+%% node_info() = {subagent, Pid} | {variable, Id} | {table_colum, Id}
+%%-----------------------------------------------------------------
+
+-type tree_generation() :: non_neg_integer().
+-type tree() :: #tree{}.
+-type tree_nodes() :: [tree_node()].
+-type tree_node() :: tree() |
+ tree_node_elem() |
+ tree_node_empty().
+-type tree_node_elem() :: {node, tree_node_info()}.
+-type tree_node_info() :: {subagent, Pid :: pid()} |
+ {variable, Id :: non_neg_integer()} |
+ {table_column, Id :: non_neg_integer()}.
+-type tree_node_empty() :: {undefined_node, N :: pos_integer()}.
+-type tree_info() :: {table, Id :: non_neg_integer()} |
+ {table_entry, Id :: non_neg_integer()} |
+ internal.
+
+
+%% This record is what is stored in the database. The 'tree' part
+%% is described above...
+-record(mtree,
+ {
+ generation = ?DUMMY_TREE_GENERATION :: tree_generation(),
+ root = ?DEFAULT_TREE :: tree()
+ }).
+
+-record(tree,
+ {
+ %% The number of nodes is *not* actually the length of the
+ %% nodes list. Since the undefined-node(s) can be collapsed
+ %% into {undefined_node, N} we need to keep track of the
+ %% actual size some other way (so that we dont have the
+ %% traverse the nodes every time we want to check an index).
+ num_nodes :: non_neg_integer(),
+ nodes :: tree_nodes(),
+ tree_info :: tree_info()
+ }).
+
+
+
+
+%%%======================================================================
+%%% 1. Interface
+%%%======================================================================
+
+%%-----------------------------------------------------------------
+%% Func: new/0, new/1
+%% Returns: A representation of mib data.
+%%-----------------------------------------------------------------
+new() ->
+ new(ets).
+
+%% Where -> A list of nodes where the tables will be created
+new(Storage) ->
+ %% First we must check if there is already something to read
+ %% If a database already exists, then the tree structure has to be read
+ ?vtrace("open (mib) database",[]),
+ MibDb = snmpa_general_db:open(Storage, ?MIB_DATA,
+ mib_info,
+ record_info(fields, mib_info), set),
+ ?vtrace("open (mib) node database",[]),
+ NodeDb = snmpa_general_db:open(Storage, ?MIB_NODE,
+ node_info,
+ record_info(fields, node_info), set),
+ ?vtrace("open (mib) tree database",[]),
+ TreeDb = snmpa_general_db:open(Storage, ?MIB_TREE,
+ tree,
+ record_info(fields, mtree), set),
+ MTree =
+ case snmpa_general_db:read(TreeDb, ?DUMMY_TREE_GENERATION) of
+ false ->
+ T = #mtree{},
+ snmpa_general_db:write(TreeDb, T),
+ T;
+ {value, T} ->
+ T
+ end,
+ install_mibs(MibDb, NodeDb),
+ #mib_data{mib_db = MibDb,
+ node_db = NodeDb,
+ tree_db = TreeDb,
+ mtree = MTree}.
+
+
+%%----------------------------------------------------------------------
+%% Returns: new mib data | {error, Reason}
+%%----------------------------------------------------------------------
+load_mib(MibData,FileName,MeOverride,TeOverride)
+ when is_record(MibData,mib_data) andalso is_list(FileName) ->
+ ?vlog("load mib file: ~p",[FileName]),
+ ActualFileName = filename:rootname(FileName, ".bin") ++ ".bin",
+ MibName = list_to_atom(filename:basename(FileName, ".bin")),
+ (catch do_load_mib(MibData, ActualFileName, MibName,
+ MeOverride, TeOverride)).
+
+do_load_mib(MibData, ActualFileName, MibName, MeOverride, TeOverride) ->
+ ?vtrace("do_load_mib -> entry with"
+ "~n ActualFileName: ~s"
+ "~n MibName: ~p",[ActualFileName, MibName]),
+ #mib_data{mib_db = MibDb,
+ node_db = NodeDb,
+ %% tree_db = TreeDb,
+ tree = Tree} = MibData,
+ verify_not_loaded(MibDb, MibName),
+ ?vtrace("do_load_mib -> already loaded mibs:"
+ "~n ~p",[loaded(MibDb)]),
+ Mib = do_read_mib(ActualFileName),
+ ?vtrace("do_load_mib -> read mib ~s",[Mib#mib.name]),
+ NonInternalMes =
+ lists:filter(fun(ME) -> maybe_drop_me(ME) end, Mib#mib.mes),
+ OldRoot = Tree#tree.root,
+ T = build_tree(NonInternalMes, MibName),
+ ?d("load_mib -> "
+ "~n OldRoot: ~p"
+ "~n T: ~p", [OldRoot, T]),
+ case (catch merge_nodes(T, OldRoot)) of
+ {error_merge_nodes, Node1, Node2} ->
+ ?vlog("error merging nodes:"
+ "~n~p~nand~n~p", [Node1,Node2]),
+ {error, oid_conflict};
+ NewRoot when is_tuple(NewRoot) andalso (element(1,NewRoot) =:= tree) ->
+ ?d("load_mib -> "
+ "~n NewRoot: ~p", [NewRoot]),
+ Symbolic = not lists:member(no_symbolic_info, Mib#mib.misc),
+ case (catch check_notif_and_mes(TeOverride, MeOverride, Symbolic,
+ Mib#mib.traps, NonInternalMes)) of
+ true ->
+ install_mes(NodeDb, MibName, NonInternalMes),
+ install_mib(MibDb, Symbolic, Mib,
+ MibName, ActualFileName, NonInternalMes),
+ ?vtrace("installed mib ~s", [Mib#mib.name]),
+ Tree2 = Tree#tree{root = NewRoot},
+ %% snmpa_general_db:write(TreeDb, Tree2), %% Store later?
+ {ok, MibData#mib_data{tree = Tree2}};
+ Else ->
+ Else
+ end
+ end.
+
+
+verify_not_loaded(Db, Name) ->
+ case snmpa_general_db:read(Db, Name) of
+ {value, #mib_info{name = Name}} ->
+ throw({error, 'already loaded'});
+ false ->
+ ok
+ end.
+
+do_read_mib(ActualFileName) ->
+ case snmp_misc:read_mib(ActualFileName) of
+ {error, Reason} ->
+ ?vlog("Failed reading mib file ~p with reason: ~p",
+ [ActualFileName,Reason]),
+ throw({error, Reason});
+ {ok, Mib} ->
+ Mib
+ end.
+
+%% The Tree DB is handled in a special way since it can be very large.
+sync(#mib_data{mib_db = M,
+ node_db = N,
+ tree_db = T, tree = Tree, subagents = []}) ->
+ snmpa_general_db:sync(M),
+ snmpa_general_db:sync(N),
+ snmpa_general_db:write(T, Tree),
+ snmpa_general_db:sync(T);
+sync(#mib_data{mib_db = M,
+ node_db = N,
+ tree_db = T, tree = Tree, subagents = SAs}) ->
+
+ snmpa_general_db:sync(M),
+ snmpa_general_db:sync(N),
+
+ %% Ouch. Since the subagent info is dynamic we do not
+ %% want to store the tree containing subagent info. So, we
+ %% have to create a tmp tree without those and store it.
+
+ case delete_subagents(Tree, SAs) of
+ {ok, TreeWithoutSAs} ->
+ snmpa_general_db:write(T, TreeWithoutSAs),
+ snmpa_general_db:sync(T);
+ Error ->
+ Error
+ end.
+
+delete_subagents(Tree, []) ->
+ {ok, Tree};
+delete_subagents(Tree0, [{_, Oid}|SAs]) ->
+ case (catch delete_subagent(Tree0, Oid)) of
+ {tree, _Tree, _Info} = Tree1 ->
+ delete_subagents(Tree1, SAs);
+ _Error ->
+ {error, {'invalid oid', Oid}}
+ end.
+
+%%----------------------------------------------------------------------
+%% (OTP-3601)
+%%----------------------------------------------------------------------
+check_notif_and_mes(TeOverride,MeOverride,Symbolic,Traps,MEs) ->
+ ?vtrace("check notifications and mib entries",[]),
+ check_notifications(TeOverride,Symbolic,Traps),
+ check_mes(MeOverride,MEs).
+
+check_notifications(true, _Symbolic, _Traps) ->
+ ?vtrace("trapentry override = true => skip check",[]),
+ true;
+check_notifications(_, Symbolic, Traps) ->
+ check_notifications(Symbolic, Traps).
+
+check_notifications(true, Traps) ->
+ check_notifications(Traps);
+check_notifications(_, _) -> true.
+
+check_notifications([]) -> true;
+check_notifications([#trap{trapname = Key} = Trap | Traps]) ->
+ ?vtrace("check notification [trap] with Key: ~p",[Key]),
+ case snmpa_symbolic_store:get_notification(Key) of
+ {value, Trap} -> check_notifications(Traps);
+ {value, _} -> throw({error, {'trap already defined', Key}});
+ undefined -> check_notifications(Traps)
+ end;
+check_notifications([#notification{trapname = Key} = Notif | Traps]) ->
+ ?vtrace("check notification [notification] with Key: ~p",[Key]),
+ case snmpa_symbolic_store:get_notification(Key) of
+ {value, Notif} ->
+ check_notifications(Traps);
+ {value, _} ->
+ throw({error, {'notification already defined', Key}});
+ undefined ->
+ check_notifications(Traps)
+ end;
+check_notifications([Crap | Traps]) ->
+ ?vlog("skipped check of: ~n~p",[Crap]),
+ check_notifications(Traps).
+
+check_mes(true,_) ->
+ ?vtrace("mibentry override = true => skip check",[]),
+ true;
+check_mes(_,MEs) ->
+ check_mes(MEs).
+
+check_mes([]) -> true;
+check_mes([#me{aliasname = Name, oid = Oid1} | MEs]) ->
+ ?vtrace("check mib entries with aliasname: ~p",[Name]),
+ case snmpa_symbolic_store:aliasname_to_oid(Name) of
+ {value, Oid1} ->
+ check_mes(MEs);
+ {value, Oid2} ->
+ ?vinfo("~n expecting '~p'~n but found '~p'",[Oid1, Oid2]),
+ throw({error, {'mibentry already defined', Name}});
+ false ->
+ check_mes(MEs)
+ end;
+check_mes([Crap | MEs]) ->
+ ?vlog("skipped check of: ~n~p",[Crap]),
+ check_mes(MEs).
+
+
+
+%%----------------------------------------------------------------------
+%% Returns: new mib data | {error, Reason}
+%%----------------------------------------------------------------------
+unload_mib(MibData, FileName, _, _) when is_list(FileName) ->
+ MibName = list_to_atom(filename:basename(FileName, ".bin")),
+ (catch do_unload_mib(MibData, MibName)).
+
+do_unload_mib(MibData, MibName) ->
+ ?vtrace("do_unload_mib -> entry with"
+ "~n MibName: ~p", [MibName]),
+ #mib_data{mib_db = MibDb,
+ node_db = NodeDb,
+ %% tree_db = TreeDb,
+ tree = Tree} = MibData,
+ #mib_info{symbolic = Symbolic} = verify_loaded(MibDb, MibName),
+ NewRoot = delete_mib_from_tree(MibName, Tree#tree.root),
+ MEs = uninstall_mes(NodeDb, MibName),
+ uninstall_mib(MibDb, Symbolic, MibName, MEs),
+ NewMibData = MibData#mib_data{tree = Tree#tree{root = NewRoot}},
+ {ok, NewMibData}.
+
+verify_loaded(Db, Name) ->
+ case snmpa_general_db:read(Db, Name) of
+ {value, MibInfo} ->
+ MibInfo;
+ false ->
+ throw({error, 'not loaded'})
+ end.
+
+
+close(#mib_data{mib_db = MibDb, node_db = NodeDb, tree_db = TreeDb}) ->
+ snmpa_general_db:close(MibDb),
+ snmpa_general_db:close(NodeDb),
+ snmpa_general_db:close(TreeDb),
+ ok.
+
+register_subagent(#mib_data{tree = T} = MibData, Oid, Pid) ->
+ case insert_subagent(Oid, T#tree.root) of
+ {error, Reason} ->
+ {error, Reason};
+ NewRootTree ->
+ SAs = [{Pid, Oid} | MibData#mib_data.subagents],
+ T2 = T#tree{root = NewRootTree},
+ MibData#mib_data{tree = T2, subagents = SAs}
+ end.
+
+
+%%----------------------------------------------------------------------
+%% Purpose: Get a list of all loaded mibs
+%% Returns: [{Name, File}]
+%%----------------------------------------------------------------------
+
+which_mibs(#mib_data{mib_db = Db}) ->
+ Mibs = snmpa_general_db:tab2list(Db),
+ [{Name, File} || #mib_info{name = Name, file_name = File} <- Mibs].
+
+
+%%----------------------------------------------------------------------
+%% Purpose: Get a list of all loaded mibs
+%% Returns: [{Name, File}]
+%%----------------------------------------------------------------------
+
+whereis_mib(#mib_data{mib_db = Db}, Name) ->
+ case snmpa_general_db:read(Db, Name) of
+ {value, #mib_info{file_name = File}} ->
+ {ok, File};
+ false ->
+ {error, not_found}
+ end.
+
+
+%%----------------------------------------------------------------------
+%% Purpose: Deletes SA with Pid from all subtrees it handles.
+%% Returns: NewMibData.
+%%----------------------------------------------------------------------
+unregister_subagent(MibData, Pid) when is_pid(Pid) ->
+ SAs = MibData#mib_data.subagents,
+ case lists:keysearch(Pid, 1, SAs) of
+ false -> MibData;
+ {value, {Pid, Oid}} ->
+ % we should never get an error since Oid is found in MibData.
+ {ok, NewMibData, _DeletedSA} = unregister_subagent(MibData, Oid),
+ % continue if the same Pid handles other mib subtrees.
+ unregister_subagent(NewMibData, Pid)
+ end;
+
+%%----------------------------------------------------------------------
+%% Purpose: Deletes one unique subagent.
+%% Returns: {error, Reason} | {ok, NewMibData, DeletedSubagentPid}
+%%----------------------------------------------------------------------
+unregister_subagent(#mib_data{tree = T} = MibData, Oid) when is_list(Oid) ->
+ case catch delete_subagent(T#tree.root, Oid) of
+ {tree, Tree, Info} ->
+ OldSAs = MibData#mib_data.subagents,
+ {value, {Pid, _Oid}} = lists:keysearch(Oid, 2, OldSAs),
+ SAs = lists:keydelete(Oid, 2, OldSAs),
+ T2 = T#tree{root = {tree, Tree, Info}},
+ {ok,
+ MibData#mib_data{tree = T2, subagents = SAs},
+ Pid};
+ _ ->
+ {error, {'invalid oid', Oid}}
+ end.
+
+%%----------------------------------------------------------------------
+%% Purpose: To inpect memory usage, loaded mibs, registered subagents
+%%----------------------------------------------------------------------
+info(MibData) ->
+ ?vtrace("retrieve info",[]),
+ #mib_data{mib_db = MibDb, node_db = NodeDb, tree_db = TreeDb,
+ tree = Tree, subagents = SAs} = MibData,
+ LoadedMibs = old_format(snmpa_general_db:tab2list(MibDb)),
+ TreeSize = snmp_misc:mem_size(Tree),
+ {memory, ProcSize} = erlang:process_info(self(),memory),
+ MibDbSize = snmpa_general_db:info(MibDb, memory),
+ NodeDbSize = snmpa_general_db:info(NodeDb, memory),
+ TreeDbSize = snmpa_general_db:info(TreeDb, memory),
+ [{loaded_mibs, LoadedMibs}, {subagents, SAs}, {tree_size_bytes, TreeSize},
+ {process_memory, ProcSize},
+ {db_memory, [{mib,MibDbSize},{node,NodeDbSize},{tree,TreeDbSize}]}].
+
+info(#mib_data{mib_db = MibDb}, loaded_mibs) ->
+ Mibs = snmpa_general_db:tab2list(MibDb),
+ [filename:rootname(FN, ".bin") || #mib_info{file_name = FN} <- Mibs];
+info(#mib_data{tree = Tree}, tree_size_bytes) ->
+ snmp_misc:mem_size(Tree);
+info(_, process_memory) ->
+ {memory, ProcSize} = erlang:process_info(self(),memory),
+ ProcSize;
+info(#mib_data{mib_db = MibDb, node_db = NodeDb, tree_db = TreeDb},
+ db_memory) ->
+ MibDbSize = snmpa_general_db:info(MibDb, memory),
+ NodeDbSize = snmpa_general_db:info(NodeDb, memory),
+ TreeDbSize = snmpa_general_db:info(TreeDb, memory),
+ [{mib,MibDbSize},{node,NodeDbSize},{tree,TreeDbSize}];
+info(#mib_data{subagents = SAs}, subagents) ->
+ SAs.
+
+old_format(LoadedMibs) ->
+ ?vtrace("convert mib info to old format",[]),
+ [{N,S,F} || #mib_info{name=N,symbolic=S,file_name=F} <- LoadedMibs].
+
+
+%%----------------------------------------------------------------------
+%% A total dump for debugging.
+%%----------------------------------------------------------------------
+dump(#mib_data{mib_db = MibDb, node_db = NodeDb, tree = Tree}) ->
+ (catch io:format("MIB-tables:~n~p~n~n",
+ [snmpa_general_db:tab2list(MibDb)])),
+ (catch io:format("MIB-entries:~n~p~n~n",
+ [snmpa_general_db:tab2list(NodeDb)])),
+ (catch io:format("Tree:~n~p~n", [Tree])), % good luck reading it!
+ ok.
+
+dump(#mib_data{mib_db = MibDb, node_db = NodeDb, tree = Tree}, File) ->
+ case file:open(File,[write]) of
+ {ok, Fd} ->
+ io:format(Fd,"~s~n",
+ [snmp:date_and_time_to_string(snmp:date_and_time())]),
+ (catch io:format(Fd,"MIB-tables:~n~p~n~n",
+ [snmpa_general_db:tab2list(MibDb)])),
+ (catch io:format(Fd, "MIB-entries:~n~p~n~n",
+ [snmpa_general_db:tab2list(NodeDb)])),
+ io:format(Fd,"Tree:~n~p~n", [Tree]), % good luck reading it!
+ file:close(Fd),
+ ok;
+ {error,Reason} ->
+ ?vinfo("~n Failed opening file '~s' for reason ~p",
+ [File,Reason]),
+ {error,Reason}
+ end.
+
+
+backup(#mib_data{mib_db = M, node_db = N, tree_db = T}, BackupDir) ->
+ MRes = snmpa_general_db:backup(M, BackupDir),
+ NRes = snmpa_general_db:backup(N, BackupDir),
+ TRes = snmpa_general_db:backup(T, BackupDir),
+ handle_backup_res([{mib_db, MRes}, {node_db, NRes}, {tree_db, TRes}]).
+
+handle_backup_res(Res) ->
+ handle_backup_res(Res, []).
+
+handle_backup_res([], []) ->
+ ok;
+handle_backup_res([], Err) ->
+ {error, lists:reverse(Err)};
+handle_backup_res([{_, ok}|Res], Err) ->
+ handle_backup_res(Res, Err);
+handle_backup_res([{Tag, {error, Reason}}|Res], Err) ->
+ handle_backup_res(Res, [{Tag, Reason}|Err]);
+handle_backup_res([{Tag, Error}|Res], Err) ->
+ handle_backup_res(Res, [{Tag, Error}|Err]).
+
+
+%%%======================================================================
+%%% 2. Implementation of tree access
+%%% lookup and next.
+%%%======================================================================
+
+
+which_mib(#mib_data{tree = T} = D, Oid) ->
+ ?vtrace("which_mib -> entry with"
+ "~n Oid: ~p",[Oid]),
+ case (catch find_node(D, T#tree.root, Oid, [])) of
+ {variable, _ME, Mib} ->
+ ?vtrace("which_mib -> variable:"
+ "~n Mib: ~p", [Mib]),
+ {ok, Mib};
+ {table, _EntryME, _, Mib} ->
+ ?vtrace("which_mib -> table:"
+ "~n Mib: ~p", [Mib]),
+ {ok, Mib};
+ {subagent, SubAgentPid, _SANextOid} ->
+ ?vtrace("which_mib -> subagent:"
+ "~n SubAgentPid: ~p", [SubAgentPid]),
+ {error, {subagent, SubAgentPid}};
+ {false, ErrorCode} ->
+ ?vtrace("which_mib -> false:"
+ "~n ErrorCode: ~p",[ErrorCode]),
+ {error, ErrorCode};
+ false ->
+ ?vtrace("which_mib -> false",[]),
+ {error, noSuchObject};
+ {'EXIT', R} ->
+ ?vtrace("which_mib -> exit:"
+ "~n R: ~p",[R]),
+ {error, noSuchObject}
+ end.
+
+
+%%-----------------------------------------------------------------
+%% Func: lookup/2
+%% Purpose: Finds the mib entry corresponding to the Oid. If it is a
+%% variable, the Oid must be <Oid for var>.0 and if it is
+%% a table, Oid must be <table>.<entry>.<col>.<any>
+%% Returns: {variable, MibEntry} |
+%% {table_column, MibEntry, TableEntryOid} |
+%% {subagent, SubAgentPid, SAOid} |
+%% {false, Reason}
+%%-----------------------------------------------------------------
+lookup(#mib_data{tree = T} = D, Oid) ->
+ ?vtrace("lookup -> entry with"
+ "~n Oid: ~p",[Oid]),
+ case (catch find_node(D, T#tree.root, Oid, [])) of
+ {variable, ME, _Mib} when is_record(ME, me) ->
+ ?vtrace("lookup -> variable:"
+ "~n ME: ~p",[ME]),
+ {variable, ME};
+ {table, EntryME, {ColME, TableEntryOid}, _Mib} ->
+ ?vtrace("lookup -> table:"
+ "~n EntryME: ~p"
+ "~n ColME: ~p"
+ "~n RevTableEntryOid: ~p",
+ [EntryME, ColME, TableEntryOid]),
+ MFA = EntryME#me.mfa,
+ RetME = ColME#me{mfa = MFA},
+ {table_column, RetME, TableEntryOid};
+ {subagent, SubAgentPid, SANextOid} ->
+ ?vtrace("lookup -> subagent:"
+ "~n SubAgentPid: ~p"
+ "~n SANextOid: ~p", [SubAgentPid, SANextOid]),
+ {subagent, SubAgentPid, SANextOid};
+ {false, ErrorCode} ->
+ ?vtrace("lookup -> false:"
+ "~n ErrorCode: ~p",[ErrorCode]),
+ {false, ErrorCode};
+ false ->
+ ?vtrace("lookup -> false",[]),
+ {false, noSuchObject};
+ {'EXIT', R} ->
+ ?vtrace("lookup -> exit:"
+ "~n R: ~p",[R]),
+ {false, noSuchObject}
+ end.
+
+
+find_node(D, {tree, Tree, {table, _}}, RestOfOid, RevOid) ->
+ ?vtrace("find_node(tree,table) -> entry with"
+ "~n RestOfOid: ~p"
+ "~n RevOid: ~p",[RestOfOid, RevOid]),
+ find_node(D, {tree, Tree, internal}, RestOfOid, RevOid);
+find_node(D, {tree, Tree, {table_entry, _}}, RestOfOid, RevOid) ->
+ ?vtrace("find_node(tree,table_entry) -> entry with"
+ "~n RestOfOid: ~p"
+ "~n RevOid: ~p",[RestOfOid, RevOid]),
+ #mib_data{node_db = Db} = D,
+ Oid = lists:reverse(RevOid),
+ case snmpa_general_db:read(Db, Oid) of
+ {value, #node_info{me = ME, mib_name = Mib}} ->
+ case find_node(D, {tree, Tree, internal}, RestOfOid, RevOid) of
+ {false, ErrorCode} -> {false, ErrorCode};
+ Val -> {table, ME, Val, Mib}
+ end;
+ false ->
+ ?vinfo("find_node -> could not find table_entry ME with"
+ "~n RevOid: ~p"
+ "~n when"
+ "~n RestOfOid: ~p",
+ [RevOid, RestOfOid]),
+ false
+ end;
+find_node(D, {tree, Tree, _Internal}, [Int | RestOfOid], RevOid) ->
+ ?vtrace("find_node(tree) -> entry with"
+ "~n Int: ~p"
+ "~n RestOfOid: ~p"
+ "~n RevOid: ~p",[Int, RestOfOid, RevOid]),
+ find_node(D, element(Int+1, Tree), RestOfOid, [Int | RevOid]);
+find_node(D, {node, {table_column, _}}, RestOfOid, [ColInt | RevOid]) ->
+ ?vtrace("find_node(tree,table_column) -> entry with"
+ "~n RestOfOid: ~p"
+ "~n ColInt: ~p"
+ "~n RevOid: ~p",[RestOfOid, ColInt, RevOid]),
+ #mib_data{node_db = Db} = D,
+ Oid = lists:reverse([ColInt | RevOid]),
+ case snmpa_general_db:read(Db, Oid) of
+ {value, #node_info{me = ME}} ->
+ {ME, lists:reverse(RevOid)};
+ false ->
+ X = snmpa_general_db:read(Db, lists:reverse([ColInt | RevOid])),
+ ?vinfo("find_node -> could not find table_column ME with"
+ "~n RevOid: ~p"
+ "~n trying [~p|~p]"
+ "~n X: ~p",
+ [RevOid, [ColInt | RevOid], X]),
+ false
+ end;
+find_node(D, {node, {variable, _MibName}}, [0], RevOid) ->
+ ?vtrace("find_node(tree,variable,[0]) -> entry with"
+ "~n RevOid: ~p",[RevOid]),
+ #mib_data{node_db = Db} = D,
+ Oid = lists:reverse(RevOid),
+ %% {value, #node_info{me = ME}} = snmpa_general_db:read(Db, Oid),
+ case snmpa_general_db:read(Db, Oid) of
+ {value, #node_info{me = ME, mib_name = Mib}} ->
+ {variable, ME, Mib};
+ false ->
+ ?vinfo("find_node -> could not find variable ME with"
+ "~n RevOid: ~p", [RevOid]),
+ false
+ end;
+find_node(_D, {node, {variable, _MibName}}, [], _RevOid) ->
+ ?vtrace("find_node(tree,variable,[]) -> entry",[]),
+ {false, noSuchObject};
+find_node(_D, {node, {variable, _MibName}}, _, _RevOid) ->
+ ?vtrace("find_node(tree,variable) -> entry",[]),
+ {false, noSuchInstance};
+find_node(D, {node, subagent}, _RestOfOid, SARevOid) ->
+ ?vtrace("find_node(tree,subagent) -> entry with"
+ "~n SARevOid: ~p",[SARevOid]),
+ #mib_data{subagents = SAs} = D,
+ SAOid = lists:reverse(SARevOid),
+ case lists:keysearch(SAOid, 2, SAs) of
+ {value, {SubAgentPid, SAOid}} ->
+ {subagent, SubAgentPid, SAOid};
+ false ->
+ ?vinfo("find_node -> could not find subagent with"
+ "~n SAOid: ~p"
+ "~n SAs: ~p", [SAOid, SAs]),
+ false
+ end;
+find_node(_D, Node, _RestOfOid, _RevOid) ->
+ ?vtrace("find_node -> failed:~n~p",[Node]),
+ {false, noSuchObject}.
+
+
+%%-----------------------------------------------------------------
+%% Func: next/3
+%% Purpose: Finds the lexicographically next oid.
+%% Returns: endOfMibView |
+%% {subagent, SubAgentPid, SAOid} |
+%% {variable, MibEntry, VarOid} |
+%% {table, TableOid, TableRestOid, MibEntry}
+%% If a variable is returnes, it is in the MibView.
+%% If a table or subagent is returned, it *may* be in the MibView.
+%%-----------------------------------------------------------------
+next(#mib_data{tree = T} = D, Oid, MibView) ->
+ case catch next_node(D, T#tree.root, Oid, [], MibView) of
+ false -> endOfMibView;
+ Else -> Else
+ end.
+
+%%-----------------------------------------------------------------
+%% This function is used as long as we have any Oid left. Take
+%% one integer at a time from the Oid, and traverse the tree
+%% accordingly. When the Oid is empty, call find_next.
+%% Returns: {subagent, SubAgentPid, SAOid} |
+%% false |
+%% {variable, MibEntry, VarOid} |
+%% {table, TableOid, TableRestOid, MibEntry}
+%%-----------------------------------------------------------------
+next_node(_D, undefined_node, _Oid, _RevOidSoFar, _MibView) ->
+ ?vtrace("next_node(undefined_node) -> entry", []),
+ false;
+
+next_node(_D, {tree, Tree, {table_entry, _Id}}, [Int | _Oid],
+ _RevOidSoFar, _MibView)
+ when Int+1 > size(Tree) ->
+ ?vtrace("next_node(tree,table_entry) -> entry when not found whith"
+ "~n Int: ~p"
+ "~n size(Tree): ~p", [Int, size(Tree)]),
+ false;
+next_node(D, {tree, Tree, {table_entry, _MibName}},
+ Oid, RevOidSoFar, MibView) ->
+ ?vtrace("next_node(tree,table_entry) -> entry when"
+ "~n size(Tree): ~p"
+ "~n Oid: ~p"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p", [size(Tree), Oid, RevOidSoFar, MibView]),
+ OidSoFar = lists:reverse(RevOidSoFar),
+ case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
+ true ->
+ ?vdebug("next_node(tree,table_entry) -> not in mib view",[]),
+ false;
+ _ ->
+ #mib_data{node_db = Db} = D,
+ case snmpa_general_db:read(Db, OidSoFar) of
+ false ->
+ ?vinfo("next_node -> could not find table_entry with"
+ "~n OidSoFar: ~p", [OidSoFar]),
+ false;
+ {value, #node_info{me = ME}} ->
+ ?vtrace("next_node(tree,table_entry) -> found: ~n ~p",
+ [ME]),
+ {table, OidSoFar, Oid, ME}
+ end
+ end;
+
+next_node(D, {tree, Tree, _Info}, [Int | RestOfOid], RevOidSoFar, MibView)
+ when (Int < size(Tree)) andalso (Int >= 0) ->
+ ?vtrace("next_node(tree) -> entry when"
+ "~n size(Tree): ~p"
+ "~n Int: ~p"
+ "~n RestOfOid: ~p"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p",
+ [size(Tree), Int, RestOfOid, RevOidSoFar, MibView]),
+ case next_node(D, element(Int+1,Tree),
+ RestOfOid, [Int|RevOidSoFar], MibView) of
+ false ->
+ find_next(D, {tree, Tree, _Info}, Int+1, RevOidSoFar, MibView);
+ Else ->
+ Else
+ end;
+%% no solution
+next_node(D, {tree, Tree, _Info}, [], RevOidSoFar, MibView) ->
+ ?vtrace("next_node(tree,[]) -> entry when"
+ "~n size(Tree): ~p"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p",
+ [size(Tree), RevOidSoFar, MibView]),
+ find_next(D, {tree, Tree, _Info}, 0, RevOidSoFar, MibView);
+next_node(_D, {tree, Tree, _Info}, _RestOfOid, _RevOidSoFar, _MibView) ->
+ ?vtrace("next_node(tree) -> entry when"
+ "~n size(Tree): ~p", [size(Tree)]),
+ false;
+
+next_node(D, {node, subagent}, Oid, RevOidSoFar, MibView) ->
+ ?vtrace("next_node(node,subagent) -> entry when"
+ "~n Oid: ~p"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p",
+ [Oid, RevOidSoFar, MibView]),
+ OidSoFar = lists:reverse(RevOidSoFar),
+ case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
+ true ->
+ false;
+ _ ->
+ #mib_data{subagents = SAs} = D,
+ case lists:keysearch(OidSoFar, 2, SAs) of
+ {value, {SubAgentPid, OidSoFar}} ->
+ {subagent, SubAgentPid, OidSoFar};
+ _ ->
+ ?vinfo("next_node -> could not find subagent with"
+ "~n OidSoFar: ~p"
+ "~n SAs: ~p", [OidSoFar, SAs]),
+ false
+ end
+ end;
+
+next_node(D, {node, {variable, _MibName}}, [], RevOidSoFar, MibView) ->
+ ?vtrace("next_node(node,variable,[]) -> entry when"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p",
+ [RevOidSoFar, MibView]),
+ OidSoFar = lists:reverse([0 | RevOidSoFar]),
+ case snmpa_acm:validate_mib_view(OidSoFar, MibView) of
+ true ->
+ #mib_data{node_db = Db} = D,
+ case snmpa_general_db:read(Db, lists:reverse(RevOidSoFar)) of
+ false ->
+ ?vinfo("next_node -> could not find variable with"
+ "~n RevOidSoFar: ~p", [RevOidSoFar]),
+ false;
+ {value, #node_info{me = ME}} ->
+ {variable, ME, OidSoFar}
+ end;
+ _ ->
+ false
+ end;
+
+next_node(_D, {node, {variable, _MibName}}, _Oid, _RevOidSoFar, _MibView) ->
+ ?vtrace("next_node(node,variable) -> entry", []),
+ false.
+
+%%-----------------------------------------------------------------
+%% This function is used to find the first leaf from where we
+%% are.
+%% Returns: {subagent, SubAgentPid, SAOid} |
+%% false |
+%% {variable, MibEntry, VarOid} |
+%% {table, TableOid, TableRestOid, MibEntry}
+%% PRE: This function must always be called with a {internal, Tree}
+%% node.
+%%-----------------------------------------------------------------
+find_next(D, {tree, Tree, internal}, Idx, RevOidSoFar, MibView)
+ when Idx < size(Tree) ->
+ case find_next(D, element(Idx+1, Tree), 0, [Idx| RevOidSoFar], MibView) of
+ false ->
+ find_next(D, {tree, Tree, internal}, Idx+1, RevOidSoFar, MibView);
+ Other ->
+ Other
+ end;
+find_next(_D, {tree, _Tree, internal}, _Idx, _RevOidSoFar, _MibView) ->
+ false;
+find_next(_D, undefined_node, _Idx, _RevOidSoFar, _MibView) ->
+ false;
+find_next(D, {tree, Tree, {table, _MibName}}, Idx, RevOidSoFar, MibView) ->
+ find_next(D, {tree, Tree, internal}, Idx, RevOidSoFar, MibView);
+find_next(D, {tree, _Tree, {table_entry, _MibName}}, _Index,
+ RevOidSoFar, MibView) ->
+ OidSoFar = lists:reverse(RevOidSoFar),
+ case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
+ true ->
+ false;
+ _ ->
+ #mib_data{node_db = Db} = D,
+ case snmpa_general_db:read(Db, OidSoFar) of
+ false ->
+ ?vinfo("find_next -> could not find table_entry ME with"
+ "~n OidSoFar: ~p", [OidSoFar]),
+ false;
+ {value, #node_info{me = ME}} ->
+ {table, OidSoFar, [], ME}
+ end
+ end;
+find_next(D, {node, {variable, _MibName}}, _Idx, RevOidSoFar, MibView) ->
+ OidSoFar = lists:reverse([0 | RevOidSoFar]),
+ case snmpa_acm:validate_mib_view(OidSoFar, MibView) of
+ true ->
+ #mib_data{node_db = Db} = D,
+ case snmpa_general_db:read(Db, lists:reverse(RevOidSoFar)) of
+ false ->
+ ?vinfo("find_next -> could not find variable with"
+ "~n RevOidSoFar: ~p", [RevOidSoFar]),
+ false;
+ {value, #node_info{me = ME}} ->
+ {variable, ME, OidSoFar}
+ end;
+ _ ->
+ false
+ end;
+find_next(D, {node, subagent}, _Idx, RevOidSoFar, MibView) ->
+ OidSoFar = lists:reverse(RevOidSoFar),
+ case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
+ true ->
+ false;
+ _ ->
+ #mib_data{subagents = SAs} = D,
+ case lists:keysearch(OidSoFar, 2, SAs) of
+ {value, {SubAgentPid, OidSoFar}} ->
+ {subagent, SubAgentPid, OidSoFar};
+ false ->
+ ?vinfo("find_node -> could not find subagent with"
+ "~n OidSoFar: ~p"
+ "~n SAs: ~p", [OidSoFar, SAs]),
+ false
+ end
+ end.
+
+%%%======================================================================
+%%% 3. Tree building functions
+%%% Used when loading mibs.
+%%%======================================================================
+
+build_tree(Mes, MibName) ->
+ ?d("build_tree -> "
+ "~n Mes: ~p", [Mes]),
+ {ListTree, []} = build_subtree([], Mes, MibName),
+ {tree, convert_tree(ListTree), internal}.
+
+%%----------------------------------------------------------------------
+%% Purpose: Builds the tree where all oids have prefix equal to LevelPrefix.
+%% Returns: {Tree, RestMes}
+%% RestMes are Mes that should not be in this subtree.
+%% The Tree is a temporary and simplified data structure that is easy to
+%% convert to the final tuple tree used by the MIB process.
+%% A Node is represented as in the final tree.
+%% The tree is not represented as a N-tuple, but as an Index-list.
+%% Example: Temporary: [{1, Node1}, {3, Node3}]
+%% Final: {Node1, undefined_node, Node3}
+%% Pre: Mes are sorted on oid.
+%%----------------------------------------------------------------------
+build_subtree(LevelPrefix, [Me | Mes], MibName) ->
+ ?vtrace("build subtree -> ~n"
+ " oid: ~p~n"
+ " LevelPrefix: ~p~n"
+ " MibName: ~p", [Me#me.oid, LevelPrefix, MibName]),
+ EType = Me#me.entrytype,
+ ?vtrace("build subtree -> EType = ~p",[EType]),
+ case in_subtree(LevelPrefix, Me) of
+ above ->
+ ?vtrace("build subtree -> above",[]),
+ {[], [Me|Mes]};
+ {node, Index} ->
+ ?vtrace("build subtree -> node at ~p",[Index]),
+ {Tree, RestMes} = build_subtree(LevelPrefix, Mes, MibName),
+ {[{Index, {node, {EType, MibName}}} | Tree], RestMes};
+ {subtree, Index, NewLevelPrefix} ->
+ ?vtrace("build subtree -> subtree at"
+ "~n ~w with ~w",
+ [Index, NewLevelPrefix]),
+ {BelowTree, RestMes} =
+ build_subtree(NewLevelPrefix, Mes, MibName),
+ {CurTree, RestMes2} =
+ build_subtree(LevelPrefix, RestMes, MibName),
+ {[{Index, {tree, BelowTree, {EType,MibName}}}| CurTree], RestMes2};
+ {internal_subtree, Index, NewLevelPrefix} ->
+ ?vtrace("build subtree -> internal_subtree at"
+ "~n ~w with ~w",
+ [Index,NewLevelPrefix]),
+ {BelowTree, RestMes} =
+ build_subtree(NewLevelPrefix, [Me | Mes], MibName),
+ {CurTree, RestMes2} =
+ build_subtree(LevelPrefix, RestMes, MibName),
+ {[{Index, {tree, BelowTree, internal}} | CurTree], RestMes2}
+ end;
+
+build_subtree(_LevelPrefix, [], _MibName) ->
+ ?vtrace("build subtree -> done", []),
+ {[], []}.
+
+%%--------------------------------------------------
+%% Purpose: Determine how/if/where Me should be inserted in subtree
+%% with LevelPrefix. This function does not build any tree, only
+%% determinses what should be done (by build subtree).
+%% Returns:
+%% above - Indicating that this ME should _not_ be in this subtree.
+%% {node, Index} - yes, construct a node with index Index on this level
+%% {internal_subtree, Index, NewLevelPrefix} - yes, there should be an
+%% internal subtree at this index.
+%% {subtree, Index, NewLevelPrefix} - yes, construct a subtree with
+%% NewLevelPrefix and insert this on current level in position Index.
+%%--------------------------------------------------
+in_subtree(LevelPrefix, Me) ->
+ case lists:prefix(LevelPrefix, Me#me.oid) of
+ true when length(Me#me.oid) > length(LevelPrefix) ->
+ classify_how_in_subtree(LevelPrefix, Me);
+ _ ->
+ above
+ end.
+
+%%--------------------------------------------------
+%% See comment about in_subtree/2. This function takes care of all cases
+%% where the ME really should be in _this_ subtree (not above).
+%%--------------------------------------------------
+classify_how_in_subtree(LevelPrefix, Me)
+ when (length(Me#me.oid) =:= (length(LevelPrefix) + 1)) ->
+ Oid = Me#me.oid,
+ case node_or_subtree(Me#me.entrytype) of
+ subtree ->
+ {subtree, lists:last(Oid), Oid};
+ node ->
+ {node, lists:last(Oid)}
+ end;
+
+classify_how_in_subtree(LevelPrefix, Me)
+ when (length(Me#me.oid) > (length(LevelPrefix) + 1)) ->
+ L1 = length(LevelPrefix) + 1,
+ Oid = Me#me.oid,
+ {internal_subtree, lists:nth(L1, Oid), lists:sublist(Oid, 1, L1)}.
+
+%%--------------------------------------------------
+%% Determines how to treat different kinds om MEs in the tree building process.
+%% Pre: all internal nodes have been removed.
+%%--------------------------------------------------
+node_or_subtree(table) -> subtree;
+node_or_subtree(table_entry) -> subtree;
+node_or_subtree(variable) -> node;
+node_or_subtree(table_column) -> node.
+
+%%--------------------------------------------------
+%% Purpose: (Recursively) Converts a temporary tree (see above) to a final tree.
+%% If input is a ListTree, output is a TupleTree.
+%% If input is a Node, output is the same Node.
+%% Pre: All Indexes are >= 0.
+%%--------------------------------------------------
+convert_tree({Index, {tree, Tree, Info}}) when Index >= 0 ->
+ L = lists:map(fun convert_tree/1, Tree),
+ {Index, {tree, dict_list_to_tuple(L), Info}};
+convert_tree({Index, {node, Info}}) when Index >= 0 ->
+ {Index, {node, Info}};
+convert_tree(Tree) when is_list(Tree) ->
+ L = lists:map(fun convert_tree/1, Tree),
+ dict_list_to_tuple(L).
+
+%%----------------------------------------------------------------------
+%% Purpose: Converts a single level (that is non-recursively) from
+%% the temporary indexlist to the N-tuple.
+%% Input: A list of {Index, Data}.
+%% Output: A tuple where element Index is Data.
+%%----------------------------------------------------------------------
+dict_list_to_tuple(L) ->
+ L2 = lists:keysort(1, L),
+ list_to_tuple(integrate_indexes(0, L2)).
+
+%%----------------------------------------------------------------------
+%% Purpose: Helper function for dict_list_to_tuple/1.
+%% Converts an indexlist to a N-list.
+%% Input: A list of {Index, Data}.
+%% Output: A (usually longer, never shorter) list where element Index is Data.
+%% Example: [{1,hej}, {3, sven}] will give output
+%% [undefined_node, hej, undefined_node, sven].
+%% Initially CurIndex should be 0.
+%%----------------------------------------------------------------------
+integrate_indexes(CurIndex, [{CurIndex, Data} | T]) ->
+ [Data | integrate_indexes(CurIndex + 1, T)];
+integrate_indexes(_Index, []) ->
+ [];
+integrate_indexes(CurIndex, L) ->
+ [undefined_node | integrate_indexes(CurIndex + 1, L)].
+
+%%%======================================================================
+%%% 4. Tree merging
+%%% Used by: load mib, insert subagent.
+%%%======================================================================
+
+%%----------------------------------------------------------------------
+%% Arg: Two root nodes (that is to be merged).
+%% Returns: A new root node where the nodes have been merger to one.
+%%----------------------------------------------------------------------
+merge_nodes(Same, Same) ->
+ Same;
+merge_nodes(Node, undefined_node) ->
+ Node;
+merge_nodes(undefined_node, Node) ->
+ Node;
+merge_nodes({tree, Tree1, internal}, {tree, Tree2, internal}) ->
+ {tree, merge_levels(tuple_to_list(Tree1),tuple_to_list(Tree2)), internal};
+merge_nodes(Node1, Node2) ->
+ throw({error_merge_nodes, Node1, Node2}).
+
+%%----------------------------------------------------------------------
+%% Arg: Two levels to be merged.
+%% Here, a level is represented as a list of nodes. A list is easier
+%% to extend than a tuple.
+%% Returns: The resulting, merged level tuple.
+%%----------------------------------------------------------------------
+merge_levels(Level1, Level2) when length(Level1) =:= length(Level2) ->
+ MergeNodes = fun(N1, N2) -> merge_nodes(N1, N2) end,
+ list_to_tuple(snmp_misc:multi_map(MergeNodes, [Level1, Level2]));
+merge_levels(Level1, Level2) when length(Level1) > length(Level2) ->
+ merge_levels(Level1, Level2 ++
+ undefined_nodes_list(length(Level1) - length(Level2)));
+merge_levels(Level1, Level2) when length(Level1) < length(Level2) ->
+ merge_levels(Level2, Level1).
+
+undefined_nodes_list(N) -> lists:duplicate(N, undefined_node).
+
+
+%%%======================================================================
+%%% 5. Tree deletion routines
+%%% (for unload mib)
+%%%======================================================================
+
+%%----------------------------------------------------------------------
+%% Purpose: Actually kicks of the tree reconstruction.
+%% Returns: {list of removed MEs, NewTree}
+%%----------------------------------------------------------------------
+delete_mib_from_tree(MibName, {tree, Tree, internal}) ->
+ case delete_tree(Tree, MibName) of
+ [] ->
+ {tree, {undefined_node}, internal}; % reduce
+ LevelList ->
+ {tree, list_to_tuple(LevelList), internal}
+ end.
+
+%%----------------------------------------------------------------------
+%% Purpose: Deletes all nodes associated to MibName from this level and
+%% all levels below.
+%% If the new level does not contain information (that is, no
+%% other mibs use it) anymore the empty list is returned.
+%% Returns: {MEs, The new level represented as a list}
+%%----------------------------------------------------------------------
+delete_tree(Tree, MibName) when is_tuple(Tree) ->
+ NewLevel = delete_nodes(tuple_to_list(Tree), MibName, []),
+ case lists:filter(fun drop_undefined_nodes/1,NewLevel) of
+ [] -> [];
+ _A_perhaps_shorted_list ->
+ NewLevel % some other mib needs this level
+ end.
+
+%%----------------------------------------------------------------------
+%% Purpose: Nodes belonging to MibName are removed from the tree.
+%% Recursively deletes sub trees to this node.
+%% Returns: {MEs, NewNodesList}
+%%----------------------------------------------------------------------
+delete_nodes([], _MibName, AccNodes) ->
+ lists:reverse(AccNodes);
+
+delete_nodes([{node, {variable, MibName}}|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+
+delete_nodes([{node, {table_column, MibName}}|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+
+delete_nodes([{tree, _Tree, {table, MibName}}|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+
+delete_nodes([{tree, _Tree, {table_entry, MibName}}|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+
+delete_nodes([{tree, Tree, Info}|T], MibName, AccNodes) ->
+ case delete_tree(Tree, MibName) of
+ [] -> % tree completely deleted
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+ LevelList ->
+ delete_nodes(T, MibName,
+ [{tree, list_to_tuple(LevelList), Info} | AccNodes])
+ end;
+
+delete_nodes([NodeToKeep|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [NodeToKeep | AccNodes]).
+
+drop_undefined_nodes(undefined_node) -> false;
+drop_undefined_nodes(_) -> true.
+
+
+%%%======================================================================
+%%% 6. Functions for subagent handling
+%%%======================================================================
+
+%%----------------------------------------------------------------------
+%% Returns: A new Root|{error, reason}
+%%----------------------------------------------------------------------
+insert_subagent(Oid, OldRoot) ->
+ ListTree = build_tree_for_subagent(Oid),
+ case catch convert_tree(ListTree) of
+ {'EXIT', _Reason} ->
+ {error, 'cannot construct tree from oid'};
+ Level when is_tuple(Level) ->
+ T = {tree, Level, internal},
+ case catch merge_nodes(T, OldRoot) of
+ {error_merge_nodes, _Node1, _Node2} ->
+ {error, oid_conflict};
+ NewRoot when is_tuple(NewRoot) andalso
+ (element(1, NewRoot) =:= tree) ->
+ NewRoot
+ end
+ end.
+
+build_tree_for_subagent([Index]) ->
+ [{Index, {node, subagent}}];
+
+build_tree_for_subagent([Index | T]) ->
+ [{Index, {tree, build_tree_for_subagent(T), internal}}].
+
+%%----------------------------------------------------------------------
+%% Returns: A new tree where the subagent at Oid (2nd arg) has been deleted.
+%%----------------------------------------------------------------------
+delete_subagent({tree, Tree, Info}, [Index]) ->
+ {node, subagent} = element(Index+1, Tree),
+ {tree, setelement(Index+1, Tree, undefined_node), Info};
+delete_subagent({tree, Tree, Info}, [Index | TI]) ->
+ {tree, setelement(Index+1, Tree,
+ delete_subagent(element(Index+1, Tree), TI)), Info}.
+
+%%%======================================================================
+%%% 7. Misc functions
+%%%======================================================================
+
+%%----------------------------------------------------------------------
+%% Installs the mibs found in the database when starting the agent.
+%% Basically calls the instrumentation functions for all non-internal
+%% mib-entries
+%%----------------------------------------------------------------------
+install_mibs(MibDb, NodeDb) ->
+ MibNames = loaded(MibDb),
+ ?vtrace("install_mibs -> found following mibs in database: ~n"
+ "~p", [MibNames]),
+ install_mibs2(NodeDb, MibNames).
+
+install_mibs2(_, []) ->
+ ok;
+install_mibs2(NodeDb, [MibName|MibNames]) ->
+ Pattern = #node_info{oid = '_', mib_name = MibName, me = '_'},
+ Nodes = snmpa_general_db:match_object(NodeDb, Pattern),
+ MEs = [ME || #node_info{me = ME} <- Nodes],
+ ?vtrace("install_mibs2 -> installing ~p MEs for mib ~p",
+ [length(MEs),MibName]),
+ NewF = fun(ME) -> call_instrumentation(ME, new) end,
+ lists:foreach(NewF, MEs),
+ install_mibs2(NodeDb, MibNames).
+
+
+%%----------------------------------------------------------------------
+%% Does all side effect stuff during load_mib.
+%%----------------------------------------------------------------------
+install_mib(Db, Symbolic, Mib, MibName, FileName, NonInternalMes) ->
+ ?vdebug("install_mib -> entry with"
+ "~n Symbolic: ~p"
+ "~n MibName: ~p"
+ "~n FileName: ~p", [Symbolic, MibName, FileName]),
+ Rec = #mib_info{name = MibName, symbolic = Symbolic, file_name = FileName},
+ snmpa_general_db:write(Db, Rec),
+ install_mib2(Symbolic, MibName, Mib),
+ NewF = fun(ME) -> call_instrumentation(ME, new) end,
+ lists:foreach(NewF, NonInternalMes).
+
+install_mib2(true, MibName, Mib) ->
+ #mib{table_infos = TabInfos,
+ variable_infos = VarInfos,
+ mes = MEs,
+ asn1_types = ASN1Types,
+ traps = Traps} = Mib,
+ snmpa_symbolic_store:add_table_infos(MibName, TabInfos),
+ snmpa_symbolic_store:add_variable_infos(MibName, VarInfos),
+ snmpa_symbolic_store:add_aliasnames(MibName, MEs),
+ snmpa_symbolic_store:add_types(MibName, ASN1Types),
+ SetF = fun(Trap) ->
+ snmpa_symbolic_store:set_notification(Trap, MibName)
+ end,
+ lists:foreach(SetF, Traps);
+install_mib2(_, _, _) ->
+ ok.
+
+install_mes(_Db, _MibName, []) ->
+ ok;
+install_mes(Db, MibName, [ME|MEs]) ->
+ Node = #node_info{oid = ME#me.oid, mib_name = MibName, me = ME},
+ snmpa_general_db:write(Db, Node),
+ install_mes(Db, MibName, MEs).
+
+
+%%----------------------------------------------------------------------
+%% Does all side effect stuff during unload_mib.
+%%----------------------------------------------------------------------
+uninstall_mib(Db, Symbolic, MibName, MEs) ->
+ ?vtrace("uninstall_mib -> entry with"
+ "~n Db: ~p"
+ "~n Symbolic: ~p"
+ "~n MibName: ~p", [Db, Symbolic, MibName]),
+ Res = snmpa_general_db:delete(Db, MibName),
+ ?vtrace("uninstall_mib -> (mib) db delete result: ~p", [Res]),
+ uninstall_mib2(Symbolic, MibName),
+ DelF = fun(ME) -> call_instrumentation(ME, delete) end,
+ lists:foreach(DelF, MEs).
+
+uninstall_mib2(true, MibName) ->
+ snmpa_symbolic_store:delete_table_infos(MibName),
+ snmpa_symbolic_store:delete_variable_infos(MibName),
+ snmpa_symbolic_store:delete_aliasnames(MibName),
+ snmpa_symbolic_store:delete_types(MibName),
+ snmpa_symbolic_store:delete_notifications(MibName);
+uninstall_mib2(_, _) ->
+ ok.
+
+uninstall_mes(Db, MibName) ->
+ Pattern = #node_info{oid = '_', mib_name = MibName, me = '_'},
+ snmpa_general_db:match_delete(Db, Pattern).
+
+
+%%----------------------------------------------------------------------
+%% Create a list of the names of all the loaded mibs
+%%----------------------------------------------------------------------
+loaded(Db) ->
+ [N || #mib_info{name = N} <- snmpa_general_db:tab2list(Db)].
+
+
+%%----------------------------------------------------------------------
+%% Calls MFA-instrumentation with 'new' or 'delete' operation.
+%%----------------------------------------------------------------------
+call_instrumentation(#me{entrytype = variable, mfa={M,F,A}}, Operation) ->
+ ?vtrace("call instrumentation with"
+ "~n entrytype: variable"
+ "~n MFA: {~p,~p,~p}"
+ "~n Operation: ~p",
+ [M,F,A,Operation]),
+ catch apply(M, F, [Operation | A]);
+call_instrumentation(#me{entrytype = table_entry, mfa={M,F,A}}, Operation) ->
+ ?vtrace("call instrumentation with"
+ "~n entrytype: table_entry"
+ "~n MFA: {~p,~p,~p}"
+ "~n Operation: ~p",
+ [M,F,A,Operation]),
+ catch apply(M, F, [Operation | A]);
+call_instrumentation(_ShitME, _Operation) ->
+ done.
+
+
+maybe_drop_me(#me{entrytype = internal}) -> false;
+maybe_drop_me(#me{entrytype = group}) -> false;
+maybe_drop_me(#me{imported = true}) -> false;
+maybe_drop_me(_) -> true.
+
+
+%%----------------------------------------------------------------------
+%% Code change functions
+%%----------------------------------------------------------------------
+
+code_change(down, State) ->
+ ?d("code_change(down) -> entry",[]),
+ State;
+
+code_change(up, State) ->
+ ?d("code_change(up)",[]),
+ State;
+
+code_change(_Vsn, State) ->
+ State.
+
diff --git a/lib/snmp/src/agent/snmpa_mib_data_tttn.erl b/lib/snmp/src/agent/snmpa_mib_data_tttn.erl
new file mode 100644
index 0000000000..9b4493a03f
--- /dev/null
+++ b/lib/snmp/src/agent/snmpa_mib_data_tttn.erl
@@ -0,0 +1,1444 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(snmpa_mib_data_tttn).
+
+
+%%%-----------------------------------------------------------------
+%%%
+%%% TTTN - TupleTreeTupleNodes
+%%%
+%%% This module implements the MIB (internal) data structures.
+%%% The TTTN MIB Data structure consists of three items:
+%%%
+%%% 1) A mib-storage (as specified when new is called) for
+%%% the data associated with each variable, table,
+%%% table-entry and table-column in the MIB.
+%%% 2) A tree contains information of the Oids in the MIB.
+%%% 3) A list of registered subagents.
+%%%
+%%% The subagent information is consequently duplicated. It resides
+%%% both in the tree and in the list.
+%%%
+%%% When a mib is loaded, the tree is built from the plain list
+%%% in the binary file.
+%%%
+%%%-----------------------------------------------------------------
+
+-include_lib("snmp/include/snmp_types.hrl").
+-include_lib("snmp/src/misc/snmp_debug.hrl").
+
+-define(VMODULE,"MDATA_TTTN").
+-include_lib("snmp/src/misc/snmp_verbosity.hrl").
+
+-behaviour(snmpa_mib_data).
+
+-define(MIB_DATA, snmpa_mib_data).
+-define(MIB_NODE, snmpa_mib_node).
+-define(MIB_TREE, snmpa_mib_tree).
+-define(DUMMY_TREE_GENERATION, 1).
+-define(DEFAULT_TREE, {tree,{undefined_node},internal}).
+
+
+%%%-----------------------------------------------------------------
+%%% Table of contents
+%%% =================
+%%% 1. Interface
+%%% 2. Implementation of tree access
+%%% 3. Tree building functions
+%%% 4. Tree merging
+%%% 5. Tree deletion routines
+%%% 6. Functions for subagent handling
+%%% 7. Misc functions
+%%%-----------------------------------------------------------------
+
+-record(mib_data,
+ {
+ %% Mib storage module
+ module :: snmpa:mib_storage_module(),
+
+ %% A database of loaded mibs
+ %% #mib_info{}
+ mib_db,
+
+ %% A database with information about each node in the tree
+ %% #node_info{}
+ node_db,
+
+ %% A database containing _one_ record with the tree
+ %% without the subagent(s).
+ %% (the reason for this is part to get replication
+ %% and part out of convenience)
+ %% #tree{}
+ tree_db,
+
+ %% The root node (same as the tree part of the tree_db
+ %% but with the subagents added).
+ tree,
+
+ %% A list of {SAPid, Oid}
+ subagents = []
+ }).
+
+-record(mib_info, {name, symbolic, file_name}).
+-record(node_info, {oid, mib_name, me}).
+
+
+%% (behaviour) API
+-export([new/1,
+ close/1,
+ sync/1,
+ load_mib/4,
+ unload_mib/4,
+ lookup/2,
+ next/3,
+ register_subagent/3,
+ unregister_subagent/2,
+ dump/2,
+ which_mib/2, which_mibs/1,
+ whereis_mib/2,
+ info/1, info/2,
+ backup/2,
+ code_change/4]).
+
+
+%%-----------------------------------------------------------------
+%% A tree is represented as a N-tuple, where each element is a
+%% node. A node is:
+%% 1) {tree, Tree, Info} where Info can be {table, Id}, {table_entry, Id}
+%% or perhaps 'internal'
+%% 2) undefined_node (memory optimization (instead of {node, undefined}))
+%% 3) {node, Info} where Info can be {subagent, Pid}, {variable, Id},
+%% {table_column, Id}
+%% Id is {MibName, MibEntry}
+%% The over all root is represented as {tree, Tree, internal}.
+%%
+%% tree() = {tree, nodes(), tree_info()}
+%% nodes() = {tree() | node() | undefined_node, ...}
+%% node() = {node, node_info()}
+%% tree_info() = {table, Id} | {table_entry, Id} | internal
+%% node_info() = {subagent, Pid} | {variable, Id} | {table_colum, Id}
+%%-----------------------------------------------------------------
+
+%% This record is what is stored in the database. The 'tree' part
+%% is described above...
+-record(tree, {generation = ?DUMMY_TREE_GENERATION, root = ?DEFAULT_TREE}).
+
+
+%%%======================================================================
+%%% 1. Interface
+%%%======================================================================
+
+%%-----------------------------------------------------------------
+%% Func: new/1
+%% Returns: A representation of mib data.
+%%-----------------------------------------------------------------
+
+%% Where -> A list of nodes where the tables will be created
+new(MibStorage) ->
+ Mod = snmp_misc:get_option(module, MibStorage),
+ Opts = snmp_misc:get_option(options, MibStorage, []),
+
+ %% First we must check if there is already something to read
+ %% If a database already exists, then the tree structure has to be read
+ ?vdebug("open (mib) database",[]),
+ MibDb =
+ case Mod:open(?MIB_DATA, mib_info, record_info(fields, mib_info),
+ set, Opts) of
+ {ok, T1} ->
+ T1;
+ {error, Reason1} ->
+ throw({error, {open, mib_data, Reason1}})
+ end,
+
+ ?vdebug("open (mib) node database",[]),
+ NodeDb =
+ case Mod:open(?MIB_NODE, node_info, record_info(fields, node_info),
+ set, Opts) of
+ {ok, T2} ->
+ T2;
+ {error, Reason2} ->
+ throw({error, {open, mib_node, Reason2}})
+ end,
+
+ ?vdebug("open (mib) tree database",[]),
+ TreeDb =
+ case Mod:open(?MIB_TREE, tree, record_info(fields, tree),
+ set, Opts) of
+ {ok, T3} ->
+ T3;
+ {error, Reason3} ->
+ throw({error, {open, mib_tree, Reason3}})
+ end,
+
+ ?vdebug("write the default (mib) tree",[]),
+ Tree =
+ case Mod:read(TreeDb, ?DUMMY_TREE_GENERATION) of
+ false ->
+ T = #tree{},
+ Mod:write(TreeDb, T),
+ T;
+ {value, T} ->
+ T
+ end,
+ ?vdebug("install (existing) mibs",[]),
+ install_mibs(Mod, MibDb, NodeDb),
+ ?vdebug("done",[]),
+ #mib_data{module = Mod,
+ mib_db = MibDb,
+ node_db = NodeDb,
+ tree_db = TreeDb,
+ tree = Tree}.
+
+
+%%----------------------------------------------------------------------
+%% Returns: new mib data | {error, Reason}
+%%----------------------------------------------------------------------
+load_mib(MibData, FileName, MeOverride, TeOverride)
+ when is_record(MibData,mib_data) andalso is_list(FileName) ->
+ ?vlog("load mib file: ~p",[FileName]),
+ ActualFileName = filename:rootname(FileName, ".bin") ++ ".bin",
+ MibName = list_to_atom(filename:basename(FileName, ".bin")),
+ (catch do_load_mib(MibData, ActualFileName, MibName,
+ MeOverride, TeOverride)).
+
+do_load_mib(MibData, ActualFileName, MibName, MeOverride, TeOverride) ->
+ ?vtrace("do_load_mib -> entry with"
+ "~n ActualFileName: ~s"
+ "~n MibName: ~p",[ActualFileName, MibName]),
+ #mib_data{module = Mod,
+ mib_db = MibDb,
+ node_db = NodeDb,
+ %% tree_db = TreeDb,
+ tree = Tree} = MibData,
+ verify_not_loaded(Mod, MibDb, MibName),
+ ?vtrace("do_load_mib -> already loaded mibs:"
+ "~n ~p", [loaded(Mod, MibDb)]),
+ Mib = do_read_mib(ActualFileName),
+ ?vtrace("do_load_mib -> read mib ~s",[Mib#mib.name]),
+ NonInternalMes =
+ lists:filter(fun(ME) -> maybe_drop_me(ME) end, Mib#mib.mes),
+ OldRoot = Tree#tree.root,
+ T = build_tree(NonInternalMes, MibName),
+ ?d("load_mib -> "
+ "~n OldRoot: ~p"
+ "~n T: ~p", [OldRoot, T]),
+ case (catch merge_nodes(T, OldRoot)) of
+ {error_merge_nodes, Node1, Node2} ->
+ ?vlog("error merging nodes:"
+ "~n~p~nand~n~p", [Node1,Node2]),
+ {error, oid_conflict};
+ NewRoot when is_tuple(NewRoot) andalso (element(1,NewRoot) =:= tree) ->
+ ?d("load_mib -> "
+ "~n NewRoot: ~p", [NewRoot]),
+ Symbolic = not lists:member(no_symbolic_info, Mib#mib.misc),
+ case (catch check_notif_and_mes(TeOverride, MeOverride, Symbolic,
+ Mib#mib.traps, NonInternalMes)) of
+ true ->
+ install_mes(Mod, NodeDb, MibName, NonInternalMes),
+ install_mib(Mod,
+ MibDb, Symbolic, Mib,
+ MibName, ActualFileName, NonInternalMes),
+ ?vtrace("installed mib ~s", [Mib#mib.name]),
+ Tree2 = Tree#tree{root = NewRoot},
+ {ok, MibData#mib_data{tree = Tree2}};
+ Else ->
+ Else
+ end
+ end.
+
+
+verify_not_loaded(Mod, Tab, Name) ->
+ case Mod:read(Tab, Name) of
+ {value, #mib_info{name = Name}} ->
+ throw({error, already_loaded});
+ false ->
+ ok
+ end.
+
+do_read_mib(ActualFileName) ->
+ case snmp_misc:read_mib(ActualFileName) of
+ {error, Reason} ->
+ ?vlog("Failed reading mib file ~p with reason: ~p",
+ [ActualFileName, Reason]),
+ throw({error, Reason});
+ {ok, Mib} ->
+ Mib
+ end.
+
+%% The Tree DB is handled in a special way since it can be very large.
+sync(#mib_data{module = Mod,
+ mib_db = M,
+ node_db = N,
+ tree_db = T, tree = Tree, subagents = []}) ->
+ Mod:sync(M),
+ Mod:sync(N),
+ Mod:write(T, Tree),
+ Mod:sync(T);
+sync(#mib_data{module = Mod,
+ mib_db = M,
+ node_db = N,
+ tree_db = T, tree = Tree, subagents = SAs}) ->
+
+ Mod:sync(M),
+ Mod:sync(N),
+
+ %% Ouch. Since the subagent info is dynamic we do not
+ %% want to store the tree containing subagent info. So, we
+ %% have to create a tmp tree without those and store it.
+
+ case delete_subagents(Tree, SAs) of
+ {ok, TreeWithoutSAs} ->
+ Mod:write(T, TreeWithoutSAs),
+ Mod:sync(T);
+ Error ->
+ Error
+ end.
+
+delete_subagents(Tree, []) ->
+ {ok, Tree};
+delete_subagents(Tree0, [{_, Oid}|SAs]) ->
+ case (catch delete_subagent(Tree0, Oid)) of
+ {tree, _Tree, _Info} = Tree1 ->
+ delete_subagents(Tree1, SAs);
+ _Error ->
+ {error, {'invalid oid', Oid}}
+ end.
+
+%%----------------------------------------------------------------------
+%% (OTP-3601)
+%%----------------------------------------------------------------------
+check_notif_and_mes(TeOverride,MeOverride,Symbolic,Traps,MEs) ->
+ ?vtrace("check notifications and mib entries",[]),
+ check_notifications(TeOverride,Symbolic,Traps),
+ check_mes(MeOverride,MEs).
+
+check_notifications(true, _Symbolic, _Traps) ->
+ ?vtrace("trapentry override = true => skip check",[]),
+ true;
+check_notifications(_, Symbolic, Traps) ->
+ check_notifications(Symbolic, Traps).
+
+check_notifications(true, Traps) ->
+ check_notifications(Traps);
+check_notifications(_, _) -> true.
+
+check_notifications([]) -> true;
+check_notifications([#trap{trapname = Key} = Trap | Traps]) ->
+ ?vtrace("check notification [trap] with Key: ~p",[Key]),
+ case snmpa_symbolic_store:get_notification(Key) of
+ {value, Trap} -> check_notifications(Traps);
+ {value, _} -> throw({error, {'trap already defined', Key}});
+ undefined -> check_notifications(Traps)
+ end;
+check_notifications([#notification{trapname = Key} = Notif | Traps]) ->
+ ?vtrace("check notification [notification] with Key: ~p",[Key]),
+ case snmpa_symbolic_store:get_notification(Key) of
+ {value, Notif} ->
+ check_notifications(Traps);
+ {value, _} ->
+ throw({error, {'notification already defined', Key}});
+ undefined ->
+ check_notifications(Traps)
+ end;
+check_notifications([Crap | Traps]) ->
+ ?vlog("skipped check of: ~n~p",[Crap]),
+ check_notifications(Traps).
+
+check_mes(true,_) ->
+ ?vtrace("mibentry override = true => skip check",[]),
+ true;
+check_mes(_,MEs) ->
+ check_mes(MEs).
+
+check_mes([]) -> true;
+check_mes([#me{aliasname = Name, oid = Oid1} | MEs]) ->
+ ?vtrace("check mib entries with aliasname: ~p",[Name]),
+ case snmpa_symbolic_store:aliasname_to_oid(Name) of
+ {value, Oid1} ->
+ check_mes(MEs);
+ {value, Oid2} ->
+ ?vinfo("~n expecting '~p'~n but found '~p'",[Oid1, Oid2]),
+ throw({error, {'mibentry already defined', Name}});
+ false ->
+ check_mes(MEs)
+ end;
+check_mes([Crap | MEs]) ->
+ ?vlog("skipped check of: ~n~p",[Crap]),
+ check_mes(MEs).
+
+
+
+%%----------------------------------------------------------------------
+%% Returns: new mib data | {error, Reason}
+%%----------------------------------------------------------------------
+unload_mib(MibData, FileName, _, _) when is_list(FileName) ->
+ MibName = list_to_atom(filename:basename(FileName, ".bin")),
+ (catch do_unload_mib(MibData, MibName)).
+
+do_unload_mib(MibData, MibName) ->
+ ?vtrace("do_unload_mib -> entry with"
+ "~n MibName: ~p", [MibName]),
+ #mib_data{module = Mod,
+ mib_db = MibDb,
+ node_db = NodeDb,
+ %% tree_db = TreeDb,
+ tree = Tree} = MibData,
+ #mib_info{symbolic = Symbolic} = verify_loaded(Mod, MibDb, MibName),
+ NewRoot = delete_mib_from_tree(MibName, Tree#tree.root),
+ MEs = uninstall_mes(Mod, NodeDb, MibName),
+ uninstall_mib(Mod, MibDb, Symbolic, MibName, MEs),
+ NewMibData = MibData#mib_data{tree = Tree#tree{root = NewRoot}},
+ {ok, NewMibData}.
+
+verify_loaded(Mod, Tab, Name) ->
+ case Mod:read(Tab, Name) of
+ {value, MibInfo} ->
+ MibInfo;
+ false ->
+ throw({error, not_loaded})
+ end.
+
+
+close(#mib_data{module = Mod,
+ mib_db = MibDb,
+ node_db = NodeDb,
+ tree_db = TreeDb}) ->
+ Mod:close(MibDb),
+ Mod:close(NodeDb),
+ Mod:close(TreeDb),
+ ok.
+
+register_subagent(#mib_data{tree = T} = MibData, Oid, Pid) ->
+ case insert_subagent(Oid, T#tree.root) of
+ {error, Reason} ->
+ {error, Reason};
+ NewRootTree ->
+ SAs = [{Pid, Oid} | MibData#mib_data.subagents],
+ T2 = T#tree{root = NewRootTree},
+ {ok, MibData#mib_data{tree = T2, subagents = SAs}}
+ end.
+
+
+%%----------------------------------------------------------------------
+%% Purpose: Get a list of all loaded mibs
+%% Returns: [{Name, File}]
+%%----------------------------------------------------------------------
+
+which_mibs(#mib_data{module = Mod, mib_db = Db}) ->
+ Mibs = Mod:tab2list(Db),
+ [{Name, File} || #mib_info{name = Name, file_name = File} <- Mibs].
+
+
+%%----------------------------------------------------------------------
+%% Purpose: Get a list of all loaded mibs
+%% Returns: [{Name, File}]
+%%----------------------------------------------------------------------
+
+whereis_mib(#mib_data{module = Mod, mib_db = Db}, Name) ->
+ case Mod:read(Db, Name) of
+ {value, #mib_info{file_name = File}} ->
+ {ok, File};
+ false ->
+ {error, not_found}
+ end.
+
+
+%%----------------------------------------------------------------------
+%% Purpose: Deletes SA with Pid from all subtrees it handles.
+%% Returns: NewMibData.
+%%----------------------------------------------------------------------
+unregister_subagent(#mib_data{subagents = SAs} = MibData, Pid)
+ when is_pid(Pid) ->
+ SAs = MibData#mib_data.subagents,
+ case lists:keysearch(Pid, 1, SAs) of
+ false ->
+ {ok, MibData};
+ {value, {Pid, Oid}} ->
+ % we should never get an error since Oid is found in MibData.
+ {ok, NewMibData, _DeletedSA} = unregister_subagent(MibData, Oid),
+ % continue if the same Pid handles other mib subtrees.
+ unregister_subagent(NewMibData, Pid)
+ end;
+
+%%----------------------------------------------------------------------
+%% Purpose: Deletes one unique subagent.
+%% Returns: {error, Reason} | {ok, NewMibData, DeletedSubagentPid}
+%%----------------------------------------------------------------------
+unregister_subagent(#mib_data{tree = T} = MibData, Oid) when is_list(Oid) ->
+ case (catch delete_subagent(T#tree.root, Oid)) of
+ {tree, Tree, Info} ->
+ OldSAs = MibData#mib_data.subagents,
+ {value, {Pid, _Oid}} = lists:keysearch(Oid, 2, OldSAs),
+ SAs = lists:keydelete(Oid, 2, OldSAs),
+ T2 = T#tree{root = {tree, Tree, Info}},
+ {ok,
+ MibData#mib_data{tree = T2, subagents = SAs},
+ Pid};
+ _ ->
+ {error, {invalid_oid, Oid}}
+ end.
+
+%%----------------------------------------------------------------------
+%% Purpose: To inpect memory usage, loaded mibs, registered subagents
+%%----------------------------------------------------------------------
+info(MibData) ->
+ ?vtrace("retrieve info",[]),
+ #mib_data{module = Mod,
+ mib_db = MibDb,
+ node_db = NodeDb,
+ tree_db = TreeDb,
+ tree = Tree,
+ subagents = SAs} = MibData,
+ LoadedMibs = old_format(Mod:tab2list(MibDb)),
+ TreeSize = snmp_misc:mem_size(Tree),
+ {memory, ProcSize} = erlang:process_info(self(), memory),
+ MibDbSize = Mod:info(MibDb, memory),
+ NodeDbSize = Mod:info(NodeDb, memory),
+ TreeDbSize = Mod:info(TreeDb, memory),
+ [{loaded_mibs, LoadedMibs}, {subagents, SAs}, {tree_size_bytes, TreeSize},
+ {process_memory, ProcSize},
+ {db_memory, [{mib,MibDbSize},{node,NodeDbSize},{tree,TreeDbSize}]}].
+
+info(#mib_data{module = Mod, mib_db = MibDb}, loaded_mibs) ->
+ Mibs = Mod:tab2list(MibDb),
+ [filename:rootname(FN, ".bin") || #mib_info{file_name = FN} <- Mibs];
+info(#mib_data{tree = Tree}, tree_size_bytes) ->
+ snmp_misc:mem_size(Tree);
+info(_, process_memory) ->
+ {memory, ProcSize} = erlang:process_info(self(),memory),
+ ProcSize;
+info(#mib_data{module = Mod,
+ mib_db = MibDb,
+ node_db = NodeDb,
+ tree_db = TreeDb},
+ db_memory) ->
+ MibDbSize = Mod:info(MibDb, memory),
+ NodeDbSize = Mod:info(NodeDb, memory),
+ TreeDbSize = Mod:info(TreeDb, memory),
+ [{mib, MibDbSize}, {node, NodeDbSize}, {tree, TreeDbSize}];
+info(#mib_data{subagents = SAs}, subagents) ->
+ SAs.
+
+old_format(LoadedMibs) ->
+ ?vtrace("convert mib info to old format",[]),
+ [{N,S,F} || #mib_info{name=N,symbolic=S,file_name=F} <- LoadedMibs].
+
+
+%%----------------------------------------------------------------------
+%% A total dump for debugging.
+%%----------------------------------------------------------------------
+
+dump(#mib_data{module = Mod,
+ mib_db = MibDb,
+ node_db = NodeDb,
+ tree = Tree}, io) ->
+ (catch io:format("MIB-tables:~n~p~n~n",
+ [Mod:tab2list(MibDb)])),
+ (catch io:format("MIB-entries:~n~p~n~n",
+ [Mod:tab2list(NodeDb)])),
+ (catch io:format("Tree:~n~p~n", [Tree])), % good luck reading it!
+ ok;
+
+dump(#mib_data{module = Mod,
+ mib_db = MibDb,
+ node_db = NodeDb,
+ tree = Tree}, File) ->
+ case file:open(File, [write]) of
+ {ok, Fd} ->
+ io:format(Fd,"~s~n",
+ [snmp:date_and_time_to_string(snmp:date_and_time())]),
+ (catch io:format(Fd,"MIB-tables:~n~p~n~n",
+ [Mod:tab2list(MibDb)])),
+ (catch io:format(Fd, "MIB-entries:~n~p~n~n",
+ [Mod:tab2list(NodeDb)])),
+ io:format(Fd,"Tree:~n~p~n", [Tree]), % good luck reading it!
+ file:close(Fd),
+ ok;
+ {error, Reason} ->
+ ?vinfo("~n Failed opening file '~s' for reason ~p",
+ [File, Reason]),
+ {error, Reason}
+ end.
+
+
+backup(#mib_data{module = Mod,
+ mib_db = M,
+ node_db = N,
+ tree_db = T}, BackupDir) ->
+ MRes = Mod:backup(M, BackupDir),
+ NRes = Mod:backup(N, BackupDir),
+ TRes = Mod:backup(T, BackupDir),
+ handle_backup_res([{mib_db, MRes}, {node_db, NRes}, {tree_db, TRes}]).
+
+handle_backup_res(Res) ->
+ handle_backup_res(Res, []).
+
+handle_backup_res([], []) ->
+ ok;
+handle_backup_res([], Err) ->
+ {error, lists:reverse(Err)};
+handle_backup_res([{_, ok}|Res], Err) ->
+ handle_backup_res(Res, Err);
+handle_backup_res([{Tag, {error, Reason}}|Res], Err) ->
+ handle_backup_res(Res, [{Tag, Reason}|Err]);
+handle_backup_res([{Tag, Error}|Res], Err) ->
+ handle_backup_res(Res, [{Tag, Error}|Err]).
+
+
+%%%======================================================================
+%%% 2. Implementation of tree access
+%%% lookup and next.
+%%%======================================================================
+
+
+which_mib(#mib_data{tree = T} = D, Oid) ->
+ ?vtrace("which_mib -> entry with"
+ "~n Oid: ~p",[Oid]),
+ case (catch find_node(D, T#tree.root, Oid, [])) of
+ {variable, _ME, Mib} ->
+ ?vtrace("which_mib -> variable:"
+ "~n Mib: ~p", [Mib]),
+ {ok, Mib};
+ {table, _EntryME, _, Mib} ->
+ ?vtrace("which_mib -> table:"
+ "~n Mib: ~p", [Mib]),
+ {ok, Mib};
+ {subagent, SubAgentPid, _SANextOid} ->
+ ?vtrace("which_mib -> subagent:"
+ "~n SubAgentPid: ~p", [SubAgentPid]),
+ {error, {subagent, SubAgentPid}};
+ {false, ErrorCode} ->
+ ?vtrace("which_mib -> false:"
+ "~n ErrorCode: ~p",[ErrorCode]),
+ {error, ErrorCode};
+ false ->
+ ?vtrace("which_mib -> false",[]),
+ {error, noSuchObject};
+ {'EXIT', R} ->
+ ?vtrace("which_mib -> exit:"
+ "~n R: ~p",[R]),
+ {error, noSuchObject}
+ end.
+
+
+%%-----------------------------------------------------------------
+%% Func: lookup/2
+%% Purpose: Finds the mib entry corresponding to the Oid. If it is a
+%% variable, the Oid must be <Oid for var>.0 and if it is
+%% a table, Oid must be <table>.<entry>.<col>.<any>
+%% Returns: {variable, MibEntry} |
+%% {table_column, MibEntry, TableEntryOid} |
+%% {subagent, SubAgentPid, SAOid} |
+%% {false, Reason}
+%%-----------------------------------------------------------------
+lookup(#mib_data{tree = T} = D, Oid) ->
+ ?vtrace("lookup -> entry with"
+ "~n Oid: ~p",[Oid]),
+ case (catch find_node(D, T#tree.root, Oid, [])) of
+ {variable, ME, _Mib} when is_record(ME, me) ->
+ ?vtrace("lookup -> variable:"
+ "~n ME: ~p",[ME]),
+ {variable, ME};
+ {table, EntryME, {ColME, TableEntryOid}, _Mib} ->
+ ?vtrace("lookup -> table:"
+ "~n EntryME: ~p"
+ "~n ColME: ~p"
+ "~n RevTableEntryOid: ~p",
+ [EntryME, ColME, TableEntryOid]),
+ MFA = EntryME#me.mfa,
+ RetME = ColME#me{mfa = MFA},
+ {table_column, RetME, TableEntryOid};
+ {subagent, SubAgentPid, SANextOid} ->
+ ?vtrace("lookup -> subagent:"
+ "~n SubAgentPid: ~p"
+ "~n SANextOid: ~p", [SubAgentPid, SANextOid]),
+ {subagent, SubAgentPid, SANextOid};
+ {false, ErrorCode} ->
+ ?vtrace("lookup -> false:"
+ "~n ErrorCode: ~p",[ErrorCode]),
+ {false, ErrorCode};
+ false ->
+ ?vtrace("lookup -> false",[]),
+ {false, noSuchObject};
+ {'EXIT', R} ->
+ ?vtrace("lookup -> exit:"
+ "~n R: ~p",[R]),
+ {false, noSuchObject}
+ end.
+
+
+find_node(D, {tree, Tree, {table, _}}, RestOfOid, RevOid) ->
+ ?vtrace("find_node(tree,table) -> entry with"
+ "~n RestOfOid: ~p"
+ "~n RevOid: ~p",[RestOfOid, RevOid]),
+ find_node(D, {tree, Tree, internal}, RestOfOid, RevOid);
+find_node(D, {tree, Tree, {table_entry, _}}, RestOfOid, RevOid) ->
+ ?vtrace("find_node(tree,table_entry) -> entry with"
+ "~n RestOfOid: ~p"
+ "~n RevOid: ~p",[RestOfOid, RevOid]),
+ #mib_data{module = Mod, node_db = Db} = D,
+ Oid = lists:reverse(RevOid),
+ case Mod:read(Db, Oid) of
+ {value, #node_info{me = ME, mib_name = Mib}} ->
+ case find_node(D, {tree, Tree, internal}, RestOfOid, RevOid) of
+ {false, ErrorCode} -> {false, ErrorCode};
+ Val -> {table, ME, Val, Mib}
+ end;
+ false ->
+ ?vinfo("find_node -> could not find table_entry ME with"
+ "~n RevOid: ~p"
+ "~n when"
+ "~n RestOfOid: ~p",
+ [RevOid, RestOfOid]),
+ false
+ end;
+find_node(D, {tree, Tree, _Internal}, [Int | RestOfOid], RevOid) ->
+ ?vtrace("find_node(tree) -> entry with"
+ "~n Int: ~p"
+ "~n RestOfOid: ~p"
+ "~n RevOid: ~p",[Int, RestOfOid, RevOid]),
+ find_node(D, element(Int+1, Tree), RestOfOid, [Int | RevOid]);
+find_node(D, {node, {table_column, _}}, RestOfOid, [ColInt | RevOid]) ->
+ ?vtrace("find_node(tree,table_column) -> entry with"
+ "~n RestOfOid: ~p"
+ "~n ColInt: ~p"
+ "~n RevOid: ~p",[RestOfOid, ColInt, RevOid]),
+ #mib_data{module = Mod, node_db = Db} = D,
+ Oid = lists:reverse([ColInt | RevOid]),
+ case Mod:read(Db, Oid) of
+ {value, #node_info{me = ME}} ->
+ {ME, lists:reverse(RevOid)};
+ false ->
+ X = Mod:read(Db, lists:reverse([ColInt | RevOid])),
+ ?vinfo("find_node -> could not find table_column ME with"
+ "~n RevOid: ~p"
+ "~n trying [~p|~p]"
+ "~n X: ~p",
+ [RevOid, [ColInt | RevOid], X]),
+ false
+ end;
+find_node(D, {node, {variable, _MibName}}, [0], RevOid) ->
+ ?vtrace("find_node(tree,variable,[0]) -> entry with"
+ "~n RevOid: ~p",[RevOid]),
+ #mib_data{module = Mod, node_db = Db} = D,
+ Oid = lists:reverse(RevOid),
+ case Mod:read(Db, Oid) of
+ {value, #node_info{me = ME, mib_name = Mib}} ->
+ {variable, ME, Mib};
+ false ->
+ ?vinfo("find_node -> could not find variable ME with"
+ "~n RevOid: ~p", [RevOid]),
+ false
+ end;
+find_node(_D, {node, {variable, _MibName}}, [], _RevOid) ->
+ ?vtrace("find_node(tree,variable,[]) -> entry",[]),
+ {false, noSuchObject};
+find_node(_D, {node, {variable, _MibName}}, _, _RevOid) ->
+ ?vtrace("find_node(tree,variable) -> entry",[]),
+ {false, noSuchInstance};
+find_node(D, {node, subagent}, _RestOfOid, SARevOid) ->
+ ?vtrace("find_node(tree,subagent) -> entry with"
+ "~n SARevOid: ~p",[SARevOid]),
+ #mib_data{subagents = SAs} = D,
+ SAOid = lists:reverse(SARevOid),
+ case lists:keysearch(SAOid, 2, SAs) of
+ {value, {SubAgentPid, SAOid}} ->
+ {subagent, SubAgentPid, SAOid};
+ false ->
+ ?vinfo("find_node -> could not find subagent with"
+ "~n SAOid: ~p"
+ "~n SAs: ~p", [SAOid, SAs]),
+ false
+ end;
+find_node(_D, Node, _RestOfOid, _RevOid) ->
+ ?vtrace("find_node -> failed:~n~p",[Node]),
+ {false, noSuchObject}.
+
+
+%%-----------------------------------------------------------------
+%% Func: next/3
+%% Purpose: Finds the lexicographically next oid.
+%% Returns: endOfMibView |
+%% {subagent, SubAgentPid, SAOid} |
+%% {variable, MibEntry, VarOid} |
+%% {table, TableOid, TableRestOid, MibEntry}
+%% If a variable is returnes, it is in the MibView.
+%% If a table or subagent is returned, it *may* be in the MibView.
+%%-----------------------------------------------------------------
+next(#mib_data{tree = T} = D, Oid, MibView) ->
+ case catch next_node(D, T#tree.root, Oid, [], MibView) of
+ false -> endOfMibView;
+ Else -> Else
+ end.
+
+%%-----------------------------------------------------------------
+%% This function is used as long as we have any Oid left. Take
+%% one integer at a time from the Oid, and traverse the tree
+%% accordingly. When the Oid is empty, call find_next.
+%% Returns: {subagent, SubAgentPid, SAOid} |
+%% false |
+%% {variable, MibEntry, VarOid} |
+%% {table, TableOid, TableRestOid, MibEntry}
+%%-----------------------------------------------------------------
+next_node(_D, undefined_node, _Oid, _RevOidSoFar, _MibView) ->
+ ?vtrace("next_node(undefined_node) -> entry", []),
+ false;
+
+next_node(_D, {tree, Tree, {table_entry, _Id}}, [Int | _Oid],
+ _RevOidSoFar, _MibView)
+ when Int+1 > size(Tree) ->
+ ?vtrace("next_node(tree,table_entry) -> entry when not found whith"
+ "~n Int: ~p"
+ "~n size(Tree): ~p", [Int, size(Tree)]),
+ false;
+next_node(D, {tree, Tree, {table_entry, _MibName}},
+ Oid, RevOidSoFar, MibView) ->
+ ?vtrace("next_node(tree,table_entry) -> entry when"
+ "~n size(Tree): ~p"
+ "~n Oid: ~p"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p", [size(Tree), Oid, RevOidSoFar, MibView]),
+ OidSoFar = lists:reverse(RevOidSoFar),
+ case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
+ true ->
+ ?vdebug("next_node(tree,table_entry) -> not in mib view",[]),
+ false;
+ _ ->
+ #mib_data{module = Mod, node_db = Db} = D,
+ case Mod:read(Db, OidSoFar) of
+ false ->
+ ?vinfo("next_node -> could not find table_entry with"
+ "~n OidSoFar: ~p", [OidSoFar]),
+ false;
+ {value, #node_info{me = ME}} ->
+ ?vtrace("next_node(tree,table_entry) -> found: ~n ~p",
+ [ME]),
+ {table, OidSoFar, Oid, ME}
+ end
+ end;
+
+next_node(D, {tree, Tree, _Info}, [Int | RestOfOid], RevOidSoFar, MibView)
+ when (Int < size(Tree)) andalso (Int >= 0) ->
+ ?vtrace("next_node(tree) -> entry when"
+ "~n size(Tree): ~p"
+ "~n Int: ~p"
+ "~n RestOfOid: ~p"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p",
+ [size(Tree), Int, RestOfOid, RevOidSoFar, MibView]),
+ case next_node(D, element(Int+1,Tree),
+ RestOfOid, [Int|RevOidSoFar], MibView) of
+ false ->
+ find_next(D, {tree, Tree, _Info}, Int+1, RevOidSoFar, MibView);
+ Else ->
+ Else
+ end;
+%% no solution
+next_node(D, {tree, Tree, _Info}, [], RevOidSoFar, MibView) ->
+ ?vtrace("next_node(tree,[]) -> entry when"
+ "~n size(Tree): ~p"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p",
+ [size(Tree), RevOidSoFar, MibView]),
+ find_next(D, {tree, Tree, _Info}, 0, RevOidSoFar, MibView);
+next_node(_D, {tree, Tree, _Info}, _RestOfOid, _RevOidSoFar, _MibView) ->
+ ?vtrace("next_node(tree) -> entry when"
+ "~n size(Tree): ~p", [size(Tree)]),
+ false;
+
+next_node(D, {node, subagent}, Oid, RevOidSoFar, MibView) ->
+ ?vtrace("next_node(node,subagent) -> entry when"
+ "~n Oid: ~p"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p",
+ [Oid, RevOidSoFar, MibView]),
+ OidSoFar = lists:reverse(RevOidSoFar),
+ case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
+ true ->
+ false;
+ _ ->
+ #mib_data{subagents = SAs} = D,
+ case lists:keysearch(OidSoFar, 2, SAs) of
+ {value, {SubAgentPid, OidSoFar}} ->
+ {subagent, SubAgentPid, OidSoFar};
+ _ ->
+ ?vinfo("next_node -> could not find subagent with"
+ "~n OidSoFar: ~p"
+ "~n SAs: ~p", [OidSoFar, SAs]),
+ false
+ end
+ end;
+
+next_node(D, {node, {variable, _MibName}}, [], RevOidSoFar, MibView) ->
+ ?vtrace("next_node(node,variable,[]) -> entry when"
+ "~n RevOidSoFar: ~p"
+ "~n MibView: ~p",
+ [RevOidSoFar, MibView]),
+ OidSoFar = lists:reverse([0 | RevOidSoFar]),
+ case snmpa_acm:validate_mib_view(OidSoFar, MibView) of
+ true ->
+ #mib_data{module = Mod, node_db = Db} = D,
+ case Mod:read(Db, lists:reverse(RevOidSoFar)) of
+ false ->
+ ?vinfo("next_node -> could not find variable with"
+ "~n RevOidSoFar: ~p", [RevOidSoFar]),
+ false;
+ {value, #node_info{me = ME}} ->
+ {variable, ME, OidSoFar}
+ end;
+ _ ->
+ false
+ end;
+
+next_node(_D, {node, {variable, _MibName}}, _Oid, _RevOidSoFar, _MibView) ->
+ ?vtrace("next_node(node,variable) -> entry", []),
+ false.
+
+
+%%-----------------------------------------------------------------
+%% This function is used to find the first leaf from where we
+%% are.
+%% Returns: {subagent, SubAgentPid, SAOid} |
+%% false |
+%% {variable, MibEntry, VarOid} |
+%% {table, TableOid, TableRestOid, MibEntry}
+%% PRE: This function must always be called with a {internal, Tree}
+%% node.
+%%-----------------------------------------------------------------
+find_next(D, {tree, Tree, internal}, Idx, RevOidSoFar, MibView)
+ when Idx < size(Tree) ->
+ case find_next(D, element(Idx+1, Tree), 0, [Idx| RevOidSoFar], MibView) of
+ false ->
+ find_next(D, {tree, Tree, internal}, Idx+1, RevOidSoFar, MibView);
+ Other ->
+ Other
+ end;
+find_next(_D, {tree, _Tree, internal}, _Idx, _RevOidSoFar, _MibView) ->
+ false;
+find_next(_D, undefined_node, _Idx, _RevOidSoFar, _MibView) ->
+ false;
+find_next(D, {tree, Tree, {table, _MibName}}, Idx, RevOidSoFar, MibView) ->
+ find_next(D, {tree, Tree, internal}, Idx, RevOidSoFar, MibView);
+find_next(D, {tree, _Tree, {table_entry, _MibName}}, _Index,
+ RevOidSoFar, MibView) ->
+ OidSoFar = lists:reverse(RevOidSoFar),
+ case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
+ true ->
+ false;
+ _ ->
+ #mib_data{module = Mod, node_db = Db} = D,
+ case Mod:read(Db, OidSoFar) of
+ false ->
+ ?vinfo("find_next -> could not find table_entry ME with"
+ "~n OidSoFar: ~p", [OidSoFar]),
+ false;
+ {value, #node_info{me = ME}} ->
+ {table, OidSoFar, [], ME}
+ end
+ end;
+find_next(D, {node, {variable, _MibName}}, _Idx, RevOidSoFar, MibView) ->
+ OidSoFar = lists:reverse([0 | RevOidSoFar]),
+ case snmpa_acm:validate_mib_view(OidSoFar, MibView) of
+ true ->
+ #mib_data{module = Mod, node_db = Db} = D,
+ case Mod:read(Db, lists:reverse(RevOidSoFar)) of
+ false ->
+ ?vinfo("find_next -> could not find variable with"
+ "~n RevOidSoFar: ~p", [RevOidSoFar]),
+ false;
+ {value, #node_info{me = ME}} ->
+ {variable, ME, OidSoFar}
+ end;
+ _ ->
+ false
+ end;
+find_next(D, {node, subagent}, _Idx, RevOidSoFar, MibView) ->
+ OidSoFar = lists:reverse(RevOidSoFar),
+ case snmpa_acm:is_definitely_not_in_mib_view(OidSoFar, MibView) of
+ true ->
+ false;
+ _ ->
+ #mib_data{subagents = SAs} = D,
+ case lists:keysearch(OidSoFar, 2, SAs) of
+ {value, {SubAgentPid, OidSoFar}} ->
+ {subagent, SubAgentPid, OidSoFar};
+ false ->
+ ?vinfo("find_node -> could not find subagent with"
+ "~n OidSoFar: ~p"
+ "~n SAs: ~p", [OidSoFar, SAs]),
+ false
+ end
+ end.
+
+%%%======================================================================
+%%% 3. Tree building functions
+%%% Used when loading mibs.
+%%%======================================================================
+
+build_tree(Mes, MibName) ->
+ ?d("build_tree -> "
+ "~n Mes: ~p", [Mes]),
+ {ListTree, []} = build_subtree([], Mes, MibName),
+ {tree, convert_tree(ListTree), internal}.
+
+%%----------------------------------------------------------------------
+%% Purpose: Builds the tree where all oids have prefix equal to LevelPrefix.
+%% Returns: {Tree, RestMes}
+%% RestMes are Mes that should not be in this subtree.
+%% The Tree is a temporary and simplified data structure that is easy to
+%% convert to the final tuple tree used by the MIB process.
+%% A Node is represented as in the final tree.
+%% The tree is not represented as a N-tuple, but as an Index-list.
+%% Example: Temporary: [{1, Node1}, {3, Node3}]
+%% Final: {Node1, undefined_node, Node3}
+%% Pre: Mes are sorted on oid.
+%%----------------------------------------------------------------------
+build_subtree(LevelPrefix, [Me | Mes], MibName) ->
+ ?vtrace("build subtree -> ~n"
+ " oid: ~p~n"
+ " LevelPrefix: ~p~n"
+ " MibName: ~p", [Me#me.oid, LevelPrefix, MibName]),
+ EType = Me#me.entrytype,
+ ?vtrace("build subtree -> EType = ~p",[EType]),
+ case in_subtree(LevelPrefix, Me) of
+ above ->
+ ?vtrace("build subtree -> above",[]),
+ {[], [Me|Mes]};
+ {node, Index} ->
+ ?vtrace("build subtree -> node at ~p",[Index]),
+ {Tree, RestMes} = build_subtree(LevelPrefix, Mes, MibName),
+ {[{Index, {node, {EType, MibName}}} | Tree], RestMes};
+ {subtree, Index, NewLevelPrefix} ->
+ ?vtrace("build subtree -> subtree at"
+ "~n ~w with ~w",
+ [Index, NewLevelPrefix]),
+ {BelowTree, RestMes} =
+ build_subtree(NewLevelPrefix, Mes, MibName),
+ {CurTree, RestMes2} =
+ build_subtree(LevelPrefix, RestMes, MibName),
+ {[{Index, {tree, BelowTree, {EType,MibName}}}| CurTree], RestMes2};
+ {internal_subtree, Index, NewLevelPrefix} ->
+ ?vtrace("build subtree -> internal_subtree at"
+ "~n ~w with ~w",
+ [Index,NewLevelPrefix]),
+ {BelowTree, RestMes} =
+ build_subtree(NewLevelPrefix, [Me | Mes], MibName),
+ {CurTree, RestMes2} =
+ build_subtree(LevelPrefix, RestMes, MibName),
+ {[{Index, {tree, BelowTree, internal}} | CurTree], RestMes2}
+ end;
+
+build_subtree(_LevelPrefix, [], _MibName) ->
+ ?vtrace("build subtree -> done", []),
+ {[], []}.
+
+%%--------------------------------------------------
+%% Purpose: Determine how/if/where Me should be inserted in subtree
+%% with LevelPrefix. This function does not build any tree, only
+%% determinses what should be done (by build subtree).
+%% Returns:
+%% above - Indicating that this ME should _not_ be in this subtree.
+%% {node, Index} - yes, construct a node with index Index on this level
+%% {internal_subtree, Index, NewLevelPrefix} - yes, there should be an
+%% internal subtree at this index.
+%% {subtree, Index, NewLevelPrefix} - yes, construct a subtree with
+%% NewLevelPrefix and insert this on current level in position Index.
+%%--------------------------------------------------
+in_subtree(LevelPrefix, Me) ->
+ case lists:prefix(LevelPrefix, Me#me.oid) of
+ true when length(Me#me.oid) > length(LevelPrefix) ->
+ classify_how_in_subtree(LevelPrefix, Me);
+ _ ->
+ above
+ end.
+
+%%--------------------------------------------------
+%% See comment about in_subtree/2. This function takes care of all cases
+%% where the ME really should be in _this_ subtree (not above).
+%%--------------------------------------------------
+classify_how_in_subtree(LevelPrefix, Me)
+ when (length(Me#me.oid) =:= (length(LevelPrefix) + 1)) ->
+ Oid = Me#me.oid,
+ case node_or_subtree(Me#me.entrytype) of
+ subtree ->
+ {subtree, lists:last(Oid), Oid};
+ node ->
+ {node, lists:last(Oid)}
+ end;
+
+classify_how_in_subtree(LevelPrefix, Me)
+ when (length(Me#me.oid) > (length(LevelPrefix) + 1)) ->
+ L1 = length(LevelPrefix) + 1,
+ Oid = Me#me.oid,
+ {internal_subtree, lists:nth(L1, Oid), lists:sublist(Oid, 1, L1)}.
+
+%%--------------------------------------------------
+%% Determines how to treat different kinds om MEs in the tree building process.
+%% Pre: all internal nodes have been removed.
+%%--------------------------------------------------
+node_or_subtree(table) -> subtree;
+node_or_subtree(table_entry) -> subtree;
+node_or_subtree(variable) -> node;
+node_or_subtree(table_column) -> node.
+
+%%--------------------------------------------------
+%% Purpose: (Recursively) Converts a temporary tree (see above) to a final tree.
+%% If input is a ListTree, output is a TupleTree.
+%% If input is a Node, output is the same Node.
+%% Pre: All Indexes are >= 0.
+%%--------------------------------------------------
+convert_tree({Index, {tree, Tree, Info}}) when Index >= 0 ->
+ L = lists:map(fun convert_tree/1, Tree),
+ {Index, {tree, dict_list_to_tuple(L), Info}};
+convert_tree({Index, {node, Info}}) when Index >= 0 ->
+ {Index, {node, Info}};
+convert_tree(Tree) when is_list(Tree) ->
+ L = lists:map(fun convert_tree/1, Tree),
+ dict_list_to_tuple(L).
+
+%%----------------------------------------------------------------------
+%% Purpose: Converts a single level (that is non-recursively) from
+%% the temporary indexlist to the N-tuple.
+%% Input: A list of {Index, Data}.
+%% Output: A tuple where element Index is Data.
+%%----------------------------------------------------------------------
+dict_list_to_tuple(L) ->
+ L2 = lists:keysort(1, L),
+ list_to_tuple(integrate_indexes(0, L2)).
+
+%%----------------------------------------------------------------------
+%% Purpose: Helper function for dict_list_to_tuple/1.
+%% Converts an indexlist to a N-list.
+%% Input: A list of {Index, Data}.
+%% Output: A (usually longer, never shorter) list where element Index is Data.
+%% Example: [{1,hej}, {3, sven}] will give output
+%% [undefined_node, hej, undefined_node, sven].
+%% Initially CurIndex should be 0.
+%%----------------------------------------------------------------------
+integrate_indexes(CurIndex, [{CurIndex, Data} | T]) ->
+ [Data | integrate_indexes(CurIndex + 1, T)];
+integrate_indexes(_Index, []) ->
+ [];
+integrate_indexes(CurIndex, L) ->
+ [undefined_node | integrate_indexes(CurIndex + 1, L)].
+
+%%%======================================================================
+%%% 4. Tree merging
+%%% Used by: load mib, insert subagent.
+%%%======================================================================
+
+%%----------------------------------------------------------------------
+%% Arg: Two root nodes (that is to be merged).
+%% Returns: A new root node where the nodes have been merger to one.
+%%----------------------------------------------------------------------
+merge_nodes(Same, Same) ->
+ Same;
+merge_nodes(Node, undefined_node) ->
+ Node;
+merge_nodes(undefined_node, Node) ->
+ Node;
+merge_nodes({tree, Tree1, internal}, {tree, Tree2, internal}) ->
+ {tree, merge_levels(tuple_to_list(Tree1),tuple_to_list(Tree2)), internal};
+merge_nodes(Node1, Node2) ->
+ throw({error_merge_nodes, Node1, Node2}).
+
+%%----------------------------------------------------------------------
+%% Arg: Two levels to be merged.
+%% Here, a level is represented as a list of nodes. A list is easier
+%% to extend than a tuple.
+%% Returns: The resulting, merged level tuple.
+%%----------------------------------------------------------------------
+merge_levels(Level1, Level2) when length(Level1) =:= length(Level2) ->
+ MergeNodes = fun(N1, N2) -> merge_nodes(N1, N2) end,
+ list_to_tuple(snmp_misc:multi_map(MergeNodes, [Level1, Level2]));
+merge_levels(Level1, Level2) when length(Level1) > length(Level2) ->
+ merge_levels(Level1, Level2 ++
+ undefined_nodes_list(length(Level1) - length(Level2)));
+merge_levels(Level1, Level2) when length(Level1) < length(Level2) ->
+ merge_levels(Level2, Level1).
+
+undefined_nodes_list(N) -> lists:duplicate(N, undefined_node).
+
+
+%%%======================================================================
+%%% 5. Tree deletion routines
+%%% (for unload mib)
+%%%======================================================================
+
+%%----------------------------------------------------------------------
+%% Purpose: Actually kicks of the tree reconstruction.
+%% Returns: {list of removed MEs, NewTree}
+%%----------------------------------------------------------------------
+delete_mib_from_tree(MibName, {tree, Tree, internal}) ->
+ case delete_tree(Tree, MibName) of
+ [] ->
+ {tree, {undefined_node}, internal}; % reduce
+ LevelList ->
+ {tree, list_to_tuple(LevelList), internal}
+ end.
+
+%%----------------------------------------------------------------------
+%% Purpose: Deletes all nodes associated to MibName from this level and
+%% all levels below.
+%% If the new level does not contain information (that is, no
+%% other mibs use it) anymore the empty list is returned.
+%% Returns: {MEs, The new level represented as a list}
+%%----------------------------------------------------------------------
+delete_tree(Tree, MibName) when is_tuple(Tree) ->
+ NewLevel = delete_nodes(tuple_to_list(Tree), MibName, []),
+ case lists:filter(fun drop_undefined_nodes/1,NewLevel) of
+ [] -> [];
+ _A_perhaps_shorted_list ->
+ NewLevel % some other mib needs this level
+ end.
+
+%%----------------------------------------------------------------------
+%% Purpose: Nodes belonging to MibName are removed from the tree.
+%% Recursively deletes sub trees to this node.
+%% Returns: {MEs, NewNodesList}
+%%----------------------------------------------------------------------
+delete_nodes([], _MibName, AccNodes) ->
+ lists:reverse(AccNodes);
+
+delete_nodes([{node, {variable, MibName}}|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+
+delete_nodes([{node, {table_column, MibName}}|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+
+delete_nodes([{tree, _Tree, {table, MibName}}|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+
+delete_nodes([{tree, _Tree, {table_entry, MibName}}|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+
+delete_nodes([{tree, Tree, Info}|T], MibName, AccNodes) ->
+ case delete_tree(Tree, MibName) of
+ [] -> % tree completely deleted
+ delete_nodes(T, MibName, [undefined_node | AccNodes]);
+ LevelList ->
+ delete_nodes(T, MibName,
+ [{tree, list_to_tuple(LevelList), Info} | AccNodes])
+ end;
+
+delete_nodes([NodeToKeep|T], MibName, AccNodes) ->
+ delete_nodes(T, MibName, [NodeToKeep | AccNodes]).
+
+drop_undefined_nodes(undefined_node) -> false;
+drop_undefined_nodes(_) -> true.
+
+
+%%%======================================================================
+%%% 6. Functions for subagent handling
+%%%======================================================================
+
+%%----------------------------------------------------------------------
+%% Returns: A new Root|{error, reason}
+%%----------------------------------------------------------------------
+insert_subagent(Oid, OldRoot) ->
+ ListTree = build_tree_for_subagent(Oid),
+ case catch convert_tree(ListTree) of
+ {'EXIT', _Reason} ->
+ {error, 'cannot construct tree from oid'};
+ Level when is_tuple(Level) ->
+ T = {tree, Level, internal},
+ case catch merge_nodes(T, OldRoot) of
+ {error_merge_nodes, _Node1, _Node2} ->
+ {error, oid_conflict};
+ NewRoot when is_tuple(NewRoot) andalso
+ (element(1, NewRoot) =:= tree) ->
+ NewRoot
+ end
+ end.
+
+build_tree_for_subagent([Index]) ->
+ [{Index, {node, subagent}}];
+
+build_tree_for_subagent([Index | T]) ->
+ [{Index, {tree, build_tree_for_subagent(T), internal}}].
+
+
+%%----------------------------------------------------------------------
+%% Returns: A new tree where the subagent at Oid (2nd arg) has been deleted.
+%%----------------------------------------------------------------------
+
+delete_subagent({tree, Tree, Info}, [Index]) ->
+ {node, subagent} = element(Index+1, Tree),
+ {tree, setelement(Index+1, Tree, undefined_node), Info};
+delete_subagent({tree, Tree, Info}, [Index | TI]) ->
+ {tree, setelement(Index+1, Tree,
+ delete_subagent(element(Index+1, Tree), TI)), Info}.
+
+
+%%%======================================================================
+%%% 7. Misc functions
+%%%======================================================================
+
+%%----------------------------------------------------------------------
+%% Installs the mibs found in the database when starting the agent.
+%% Basically calls the instrumentation functions for all non-internal
+%% mib-entries
+%%----------------------------------------------------------------------
+install_mibs(Mod, MibDb, NodeDb) ->
+ MibNames = loaded(Mod, MibDb),
+ ?vtrace("install_mibs -> found following mibs in database: ~n"
+ "~p", [MibNames]),
+ install_mibs2(Mod, NodeDb, MibNames).
+
+install_mibs2(_, _, []) ->
+ ok;
+install_mibs2(Mod, NodeDb, [MibName|MibNames]) ->
+ Pattern = #node_info{oid = '_', mib_name = MibName, me = '_'},
+ Nodes = Mod:match_object(NodeDb, Pattern),
+ MEs = [ME || #node_info{me = ME} <- Nodes],
+ ?vtrace("install_mibs2 -> installing ~p MEs for mib ~p",
+ [length(MEs), MibName]),
+ NewF = fun(ME) -> call_instrumentation(ME, new) end,
+ lists:foreach(NewF, MEs),
+ install_mibs2(Mod, NodeDb, MibNames).
+
+
+%%----------------------------------------------------------------------
+%% Does all side effect stuff during load_mib.
+%%----------------------------------------------------------------------
+install_mib(Mod, Db, Symbolic, Mib, MibName, FileName, NonInternalMes) ->
+ ?vdebug("install_mib -> entry with"
+ "~n Symbolic: ~p"
+ "~n MibName: ~p"
+ "~n FileName: ~p", [Symbolic, MibName, FileName]),
+ Rec = #mib_info{name = MibName, symbolic = Symbolic, file_name = FileName},
+ Mod:write(Db, Rec),
+ install_mib2(Symbolic, MibName, Mib),
+ NewF = fun(ME) -> call_instrumentation(ME, new) end,
+ lists:foreach(NewF, NonInternalMes).
+
+install_mib2(true, MibName, Mib) ->
+ #mib{table_infos = TabInfos,
+ variable_infos = VarInfos,
+ mes = MEs,
+ asn1_types = ASN1Types,
+ traps = Traps} = Mib,
+ snmpa_symbolic_store:add_table_infos(MibName, TabInfos),
+ snmpa_symbolic_store:add_variable_infos(MibName, VarInfos),
+ snmpa_symbolic_store:add_aliasnames(MibName, MEs),
+ snmpa_symbolic_store:add_types(MibName, ASN1Types),
+ SetF = fun(Trap) ->
+ snmpa_symbolic_store:set_notification(Trap, MibName)
+ end,
+ lists:foreach(SetF, Traps);
+install_mib2(_, _, _) ->
+ ok.
+
+install_mes(Mod, Db, MibName, MEs) ->
+ Write = fun(#me{oid = Oid} = ME) ->
+ Node = #node_info{oid = Oid,
+ mib_name = MibName,
+ me = ME},
+ Mod:write(Db, Node)
+ end,
+ install_mes(Write, MEs).
+
+install_mes(_Write, []) ->
+ ok;
+install_mes(Write, [ME|MEs]) ->
+ Write(ME),
+ install_mes(Write, MEs).
+
+
+%%----------------------------------------------------------------------
+%% Does all side effect stuff during unload_mib.
+%%----------------------------------------------------------------------
+uninstall_mib(Mod, Db, Symbolic, MibName, MEs) ->
+ ?vtrace("uninstall_mib -> entry with"
+ "~n Db: ~p"
+ "~n Symbolic: ~p"
+ "~n MibName: ~p", [Db, Symbolic, MibName]),
+ Res = Mod:delete(Db, MibName),
+ ?vtrace("uninstall_mib -> (mib) db delete result: ~p", [Res]),
+ uninstall_mib2(Symbolic, MibName),
+ DelF = fun(ME) -> call_instrumentation(ME, delete) end,
+ lists:foreach(DelF, MEs).
+
+uninstall_mib2(true, MibName) ->
+ snmpa_symbolic_store:delete_table_infos(MibName),
+ snmpa_symbolic_store:delete_variable_infos(MibName),
+ snmpa_symbolic_store:delete_aliasnames(MibName),
+ snmpa_symbolic_store:delete_types(MibName),
+ snmpa_symbolic_store:delete_notifications(MibName);
+uninstall_mib2(_, _) ->
+ ok.
+
+uninstall_mes(Mod, Db, MibName) ->
+ Pattern = #node_info{oid = '_', mib_name = MibName, me = '_'},
+ Mod:match_delete(Db, Pattern).
+
+
+%%----------------------------------------------------------------------
+%% Create a list of the names of all the loaded mibs
+%%----------------------------------------------------------------------
+loaded(Mod, Db) ->
+ [N || #mib_info{name = N} <- Mod:tab2list(Db)].
+
+
+%%----------------------------------------------------------------------
+%% Calls MFA-instrumentation with 'new' or 'delete' operation.
+%%----------------------------------------------------------------------
+call_instrumentation(#me{entrytype = variable, mfa={M,F,A}}, Operation) ->
+ ?vtrace("call instrumentation with"
+ "~n entrytype: variable"
+ "~n MFA: {~p,~p,~p}"
+ "~n Operation: ~p",
+ [M,F,A,Operation]),
+ catch apply(M, F, [Operation | A]);
+call_instrumentation(#me{entrytype = table_entry, mfa={M,F,A}}, Operation) ->
+ ?vtrace("call instrumentation with"
+ "~n entrytype: table_entry"
+ "~n MFA: {~p,~p,~p}"
+ "~n Operation: ~p",
+ [M,F,A,Operation]),
+ catch apply(M, F, [Operation | A]);
+call_instrumentation(_ShitME, _Operation) ->
+ done.
+
+
+maybe_drop_me(#me{entrytype = internal}) -> false;
+maybe_drop_me(#me{entrytype = group}) -> false;
+maybe_drop_me(#me{imported = true}) -> false;
+maybe_drop_me(_) -> true.
+
+
+%%----------------------------------------------------------------------
+%% Code change functions
+%%----------------------------------------------------------------------
+
+code_change(down, _Vsn, _Extra, State) ->
+ ?d("code_change(down) -> entry when"
+ "~n Vsn: ~p"
+ "~n Extra: ~p", [_Vsn, _Extra]),
+ State;
+
+code_change(up, _Vsn, _Extra, State) ->
+ ?d("code_change(up) -> entry when"
+ "~n Vsn: ~p"
+ "~n Extra: ~p", [_Vsn, _Extra]),
+ State.
+
+
diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl
index 529a65a1f1..ecdf968458 100644
--- a/lib/snmp/src/agent/snmpa_mib_lib.erl
+++ b/lib/snmp/src/agent/snmpa_mib_lib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_mib_storage.erl b/lib/snmp/src/agent/snmpa_mib_storage.erl
new file mode 100644
index 0000000000..ed0607fb84
--- /dev/null
+++ b/lib/snmp/src/agent/snmpa_mib_storage.erl
@@ -0,0 +1,182 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(snmpa_mib_storage).
+
+-export_type([
+ mib_storage_fields/0,
+ mib_storage_table_type/0,
+ mib_storage_table_id/0
+ ]).
+
+
+%%% ----------------------------------------------------------------
+%%% This behaviour module defines the API for the mib-storage.
+%%% This is how the agent stores its internal mib-data
+%%% (symbolic-store and mib-server).
+%%%-----------------------------------------------------------------
+
+-type mib_storage_fields() :: [atom()].
+-type mib_storage_table_type() :: set | bag.
+-type mib_storage_table_id() :: term().
+
+
+%% ---------------------------------------------------------------
+%% open
+%%
+%% Open or create a mib-storage table.
+%% If any extra info needs to be communicated to the implementor
+%% (of the behaviour), this is done using the *Options* argument.
+%% ---------------------------------------------------------------
+
+%% Options is callback module dependant
+
+-callback open(Name :: atom(),
+ RecName :: atom(),
+ Fields :: mib_storage_fields(),
+ Type :: mib_storage_table_type(),
+ Options :: list()) ->
+ {ok, TabId :: mib_storage_table_id()} | {error, Reason :: term()}.
+
+
+%% ---------------------------------------------------------------
+%% close
+%%
+%% Close the mib-storage table. What this does is up to the
+%% implementor (when using mnesia it may be a no-op but for ets
+%% it may actually delete the table).
+%% ---------------------------------------------------------------
+
+-callback close(TabId :: mib_storage_table_id()) ->
+ term().
+
+
+%% ---------------------------------------------------------------
+%% read/2
+%%
+%% Retrieve a record from the mib-storage table.
+%% ---------------------------------------------------------------
+
+-callback read(TabId :: mib_storage_table_id(),
+ Key :: term()) ->
+ false | {value, Record :: tuple()}.
+
+
+%% ---------------------------------------------------------------
+%% write/2
+%%
+%% Write a record to the mib-storage table.
+%% ---------------------------------------------------------------
+
+-callback write(TabId :: mib_storage_table_id(),
+ Record :: tuple()) ->
+ ok | {error, Reason :: term()}.
+
+
+%% ---------------------------------------------------------------
+%% delete/1
+%%
+%% Delete the mib-storage table.
+%% ---------------------------------------------------------------
+
+-callback delete(TabId :: mib_storage_table_id()) ->
+ snmp:void().
+
+
+%% ---------------------------------------------------------------
+%% delete/2
+%%
+%% Delete a record from the mib-storage table.
+%% ---------------------------------------------------------------
+
+-callback delete(TabId :: mib_storage_table_id(),
+ Key :: term()) ->
+ ok | {error, Reason :: term()}.
+
+
+%% ---------------------------------------------------------------
+%% match_object
+%%
+%% Search the mib-storage table for records which matches
+%% the pattern.
+%% ---------------------------------------------------------------
+
+-callback match_object(TabId :: mib_storage_table_id(),
+ Pattern :: ets:match_pattern()) ->
+ {ok, Recs :: [tuple()]} | {error, Reason :: term()}.
+
+
+%% ---------------------------------------------------------------
+%% match_delete
+%%
+%% Search the mib-storage table for records which matches the
+%% pattern and deletes them from the database and return the
+%5 deleted records.
+%% ---------------------------------------------------------------
+
+-callback match_delete(TabId :: mib_storage_table_id(),
+ Pattern :: ets:match_pattern()) ->
+ {ok, Recs :: [tuple()]} | {error, Reason :: term()}.
+
+
+%% ---------------------------------------------------------------
+%% tab2list
+%%
+%% Return all records in the table in the form of a list.
+%% ---------------------------------------------------------------
+
+-callback tab2list(TabId :: mib_storage_table_id()) ->
+ [tuple()].
+
+
+%% ---------------------------------------------------------------
+%% info/1,2
+%%
+%% Retrieve implementation dependent mib-storage table
+%% information.
+%% ---------------------------------------------------------------
+
+-callback info(TabId :: mib_storage_table_id()) ->
+ Info :: term().
+
+-callback info(TabId :: mib_storage_table_id(), Item :: atom()) ->
+ Info :: term().
+
+
+%% ---------------------------------------------------------------
+%% sync
+%%
+%% Dump mib-storage table to disc (if it has a disk component).
+%% ---------------------------------------------------------------
+
+-callback sync(TabId :: mib_storage_table_id()) ->
+ snmp:void().
+
+
+%% ---------------------------------------------------------------
+%% backup
+%%
+%% Make a backup copy of the mib-storage table.
+%% ---------------------------------------------------------------
+
+-callback backup(TabId :: mib_storage_table_id(),
+ Dir :: file:filename()) ->
+ ok | {error, Reason :: term()}.
+
diff --git a/lib/snmp/src/agent/snmpa_mib_storage_dets.erl b/lib/snmp/src/agent/snmpa_mib_storage_dets.erl
new file mode 100644
index 0000000000..2459b6bc3e
--- /dev/null
+++ b/lib/snmp/src/agent/snmpa_mib_storage_dets.erl
@@ -0,0 +1,310 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(snmpa_mib_storage_dets).
+
+-behaviour(snmpa_mib_storage).
+
+
+%%%-----------------------------------------------------------------
+%%% This module implements the snmpa_mib_storage behaviour.
+%%% It uses dets for storage.
+%%%-----------------------------------------------------------------
+
+-export([
+ open/5,
+ close/1,
+ read/2,
+ write/2,
+ delete/1,
+ delete/2,
+ match_object/2,
+ match_delete/2,
+ tab2list/1,
+ info/1, info/2,
+ sync/1,
+ backup/2
+ ]).
+
+
+-define(VMODULE, "MS-DETS").
+-include("snmp_verbosity.hrl").
+
+-record(tab, {id, rec_name}).
+
+
+%% ---------------------------------------------------------------
+%% open
+%%
+%% Open or create a mib-storage (dets) table.
+%%
+%% Opts - A list of implementation dependent options
+%% dets_open_options() = [dets_open_option()]
+%% dets_open_option() = {dir, filename()} |
+%% {action, keep | clear} |
+%% {auto_save, default | pos_integer()} |
+%% {repair, force | boolean()}
+%%
+%% ---------------------------------------------------------------
+
+open(Name, RecName, _Fields, Type, Opts) ->
+ Dir = snmp_misc:get_option(dir, Opts),
+ Action = snmp_misc:get_option(action, Opts, keep),
+ AutoSave = snmp_misc:get_option(auto_save, Opts, default),
+ Repair = snmp_misc:get_option(repair, Opts, false),
+ File = dets_filename(Name, Dir),
+ OpenOpts = [{file, File},
+ {type, Type},
+ {keypos, 2},
+ {repair, Repair}] ++
+ case AutoSave of
+ default ->
+ [];
+ _ ->
+ [{auto_save, AutoSave}]
+ end,
+ case dets:open_file(Name, OpenOpts) of
+ {ok, ID} when (Action =:= keep) ->
+ {ok, #tab{id = ID, rec_name = RecName}};
+ {ok, ID} when (Action =:= clear) ->
+ dets:match_delete(ID, '_'),
+ {ok, #tab{id = ID, rec_name = RecName}};
+ {error, Reason} ->
+ {error, {dets_open, Reason}}
+ end.
+
+dets_filename(Name, Dir) ->
+ Dir1 = dets_filename1(Dir),
+ Dir2 = string:strip(Dir1, right, $/),
+ io_lib:format("~s/~p.dat", [Dir2, Name]).
+
+dets_filename1([]) -> ".";
+dets_filename1(Dir) -> Dir.
+
+
+%% ---------------------------------------------------------------
+%% close
+%%
+%% Close the table.
+%% ---------------------------------------------------------------
+
+close(#tab{id = ID}) ->
+ ?vtrace("close database ~p", [ID]),
+ dets:close(ID).
+
+
+%% ---------------------------------------------------------------
+%% read
+%%
+%% Retrieve a record from the database table.
+%% ---------------------------------------------------------------
+
+read(#tab{id = ID}, Key) ->
+ ?vtrace("read from table ~p: ~p", [ID, Key]),
+ case dets:lookup(ID, Key) of
+ [Rec|_] -> {value, Rec};
+ _ -> false
+ end.
+
+
+%% ---------------------------------------------------------------
+%% write
+%%
+%% Write a record to the database table.
+%% ---------------------------------------------------------------
+
+write(#tab{id = ID, rec_name = RecName}, Rec)
+ when (is_tuple(Rec) andalso (element(1, Rec) =:= RecName)) ->
+ ?vtrace("write to table ~p", [ID]),
+ dets:insert(ID, Rec).
+
+
+%% ---------------------------------------------------------------
+%% delete
+%%
+%% Delete the database table.
+%% ---------------------------------------------------------------
+
+delete(#tab{id = ID}) ->
+ ?vtrace("delete database ~p", [ID]),
+ File = dets:info(ID, filename),
+ case dets:close(ID) of
+ ok ->
+ file:delete(File);
+ Error ->
+ Error
+ end.
+
+
+%% ---------------------------------------------------------------
+%% delete
+%%
+%% Delete a record from the database table.
+%% ---------------------------------------------------------------
+
+delete(#tab{id = ID}, Key) ->
+ ?vtrace("delete from table ~p: ~p", [ID, Key]),
+ dets:delete(ID, Key).
+
+
+%% ---------------------------------------------------------------
+%% match_object
+%%
+%% Search the database table for records witch matches the pattern.
+%% ---------------------------------------------------------------
+
+match_object(#tab{id = ID}, Pattern) ->
+ ?vtrace("match_object in ~p of ~p", [ID, Pattern]),
+ dets:match_object(ID, Pattern).
+
+
+%% ---------------------------------------------------------------
+%% match_delete
+%%
+%% Search the database table for records witch matches the
+%% pattern and deletes them from the database table.
+%% ---------------------------------------------------------------
+
+match_delete(#tab{id = ID}, Pattern) ->
+ ?vtrace("match_delete in ~p with pattern ~p", [ID, Pattern]),
+ Recs = dets:match_object(ID, Pattern),
+ dets:match_delete(ID, Pattern),
+ Recs.
+
+
+%% ---------------------------------------------------------------
+%% tab2list
+%%
+%% Return all records in the table in the form of a list.
+%% ---------------------------------------------------------------
+
+tab2list(#tab{id = ID} = Tab) ->
+ ?vtrace("tab2list -> list of ~p", [ID]),
+ match_object(Tab, '_').
+
+
+%% ---------------------------------------------------------------
+%% info
+%%
+%% Retrieve implementation dependent mib-storage table
+%% information.
+%% ---------------------------------------------------------------
+
+info(#tab{id = ID}) ->
+ ?vtrace("info -> info of ~p", [ID]),
+ dets:info(ID).
+
+
+info(TabId, all = _Item) ->
+ info(TabId);
+info(#tab{id = ID}, memory = _Item) ->
+ ?vtrace("info on ~p (~w)", [ID, _Item]),
+ dets:info(ID, file_size);
+info(#tab{id = ID}, Item) ->
+ ?vtrace("info on ~p (~w)", [ID, Item]),
+ dets:info(ID, Item).
+
+
+%% ---------------------------------------------------------------
+%% sync
+%%
+%% Dump mib-storage table to disc (if it has a disk component)
+%% ---------------------------------------------------------------
+
+sync(#tab{id = ID}) ->
+ ?vtrace("sync -> sync ~p", [ID]),
+ dets:sync(ID).
+
+
+%% ---------------------------------------------------------------
+%% backup
+%%
+%% Make a backup copy of the mib-storage table.
+%% ---------------------------------------------------------------
+
+backup(#tab{id = ID}, BackupDir) ->
+ ?vtrace("backup -> backup of ~p to ~p", [ID, BackupDir]),
+ case dets:info(ID, filename) of
+ undefined ->
+ {error, no_file};
+ Filename ->
+ case filename:dirname(Filename) of
+ BackupDir ->
+ {error, db_dir};
+ _ ->
+ Type = dets:info(ID, type),
+ KP = dets:info(ID, keypos),
+ dets_backup(ID,
+ filename:basename(Filename),
+ BackupDir, Type, KP)
+ end
+ end.
+
+
+dets_backup(ID, Filename, BackupDir, Type, KP) ->
+ ?vtrace("dets_backup -> entry with"
+ "~n ID: ~p"
+ "~n Filename: ~p"
+ "~n BackupDir: ~p"
+ "~n Type: ~p"
+ "~n KP: ~p", [ID, Filename, BackupDir, Type, KP]),
+ BackupFile = filename:join(BackupDir, Filename),
+ ?vtrace("dets_backup -> "
+ "~n BackupFile: ~p", [BackupFile]),
+ Backup = list_to_atom(atom_to_list(ID) ++ "_backup"),
+ Opts = [{file, BackupFile}, {type, Type}, {keypos, KP}],
+ case dets:open_file(Backup, Opts) of
+ {ok, B} ->
+ ?vtrace("dets_backup -> create fun", []),
+ F = fun(Arg) ->
+ dets_backup(Arg, start, ID, B)
+ end,
+ dets:safe_fixtable(ID, true),
+ Res = dets:init_table(Backup, F, [{format, bchunk}]),
+ dets:safe_fixtable(ID, false),
+ ?vtrace("dets_backup -> Res: ~p", [Res]),
+ Res;
+ Error ->
+ ?vinfo("dets_backup -> open_file failed: "
+ "~n ~p", [Error]),
+ Error
+ end.
+
+dets_backup(close, _Cont, _ID, B) ->
+ dets:close(B),
+ ok;
+dets_backup(read, Cont1, ID, B) ->
+ case dets:bchunk(ID, Cont1) of
+ {Cont2, Data} ->
+ F = fun(Arg) ->
+ dets_backup(Arg, Cont2, ID, B)
+ end,
+ {Data, F};
+ '$end_of_table' ->
+ dets:close(B),
+ end_of_input;
+ Error ->
+ Error
+ end.
+
+
+%%----------------------------------------------------------------------
+
+%% user_err(F, A) ->
+%% snmpa_error:user_err(F, A).
diff --git a/lib/snmp/src/agent/snmpa_mib_storage_ets.erl b/lib/snmp/src/agent/snmpa_mib_storage_ets.erl
new file mode 100644
index 0000000000..68dfa83247
--- /dev/null
+++ b/lib/snmp/src/agent/snmpa_mib_storage_ets.erl
@@ -0,0 +1,342 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(snmpa_mib_storage_ets).
+
+-behaviour(snmpa_mib_storage).
+
+%%%-----------------------------------------------------------------
+%%% This module implements the snmpa_mib_storage behaviour.
+%%% It uses ets for storage.
+%%%-----------------------------------------------------------------
+
+-export([
+ open/5,
+ close/1,
+ read/2,
+ write/2,
+ delete/1,
+ delete/2,
+ match_object/2,
+ match_delete/2,
+ tab2list/1,
+ info/1, info/2,
+ sync/1,
+ backup/2
+ ]).
+
+
+-define(VMODULE,"MS-ETS").
+-include("snmp_verbosity.hrl").
+
+-record(tab, {id, rec_name, file, checksum = false}).
+
+
+%% ---------------------------------------------------------------
+%% open
+%%
+%% Open or create an ets table.
+%% Possibly also read data from a (specified) file (mirror) and
+%% populate the table from that (the dir option).
+%%
+%% Opts - A list of implementation dependent options
+%% ets_open_options() = [ets_open_option()]
+%% ets_open_option() = {dir, filename()} |
+%% {action, keep | clear} |
+%% {checksum, boolean()}
+%%
+%% The RecName and Fields arguments are not used in this
+%% implementation.
+%%
+%% ---------------------------------------------------------------
+
+%% This function creates the ets table
+open(Name, RecName, _Fields, Type, Opts) ->
+ ?vtrace("open table ~p", [Name]),
+ case lists:keysearch(dir, 1, Opts) of
+ {value, {dir, Dir}} ->
+ Action = snmp_misc:get_option(action, Opts, keep),
+ Checksum = snmp_misc:get_option(checksum, Opts, false),
+ ?vtrace("open ~p database ~p - check if file exist", [Type, Name]),
+ File = filename:join(Dir, atom_to_list(Name) ++ ".db"),
+ case file:read_file_info(File) of
+ {ok, _} ->
+ ?vdebug("open ~p database ~p - file exist - try reading",
+ [Type, Name]),
+ case ets:file2tab(File, [{verify, Checksum}]) of
+ {ok, ID} ->
+ ?vtrace("open ~p database ~p - "
+ "data read from file", [Type, Name]),
+ {ok, #tab{id = ID,
+ rec_name = RecName,
+ file = File,
+ checksum = Checksum}};
+ {error, Reason} when (Action =:= keep) ->
+ ?vinfo("open ~p database ~p - "
+ "failed reading from file (keep): "
+ "~n ~p",
+ [Type, Name, Reason]),
+ {error, {file2tab, Reason}};
+ {error, Reason} ->
+ ?vlog("open ~p database ~p - "
+ "failed reading from file (clear): "
+ "~n ~p", [Type, Name, Reason]),
+ user_err("Warning: could not read file - "
+ "create new (empty): "
+ "~n File: ~p"
+ "~n Reason: ~p", [File, Reason]),
+ ID = ets:new(Name, [Type, protected, {keypos, 2}]),
+ write_ets_file(ID, File, Checksum),
+ {ok, #tab{id = ID,
+ rec_name = RecName,
+ file = File,
+ checksum = Checksum}}
+ end;
+ {error, enoent} ->
+ %% No such file - create it
+ ?vdebug("open ~p database ~p - "
+ "file does *not* exist - create",
+ [Type, Name]),
+ ID = ets:new(Name, [Type, protected, {keypos, 2}]),
+ write_ets_file(ID, File, Checksum),
+ {ok, #tab{id = ID,
+ rec_name = RecName,
+ file = File,
+ checksum = Checksum}};
+ {error, Reason} when (Action =:= keep) ->
+ ?vinfo("open ~p database ~p - "
+ "failed reading file info (keep): "
+ "~n ~p",
+ [Type, Name, Reason]),
+ {error, {read_file_info, Reason}};
+ {error, Reason} ->
+ ?vlog("open ~p database ~p - "
+ "failed reading file info (clear): "
+ "~n ~p",
+ [Type, Name, Reason]),
+ user_err("Warning: could not read file info - "
+ "create new file: "
+ "~n File: ~p"
+ "~n Reason: ~p", [File, Reason]),
+ ID = ets:new(Name, [Type, protected, {keypos, 2}]),
+ write_ets_file(ID, File, Checksum),
+ {ok, #tab{id = ID,
+ rec_name = RecName,
+ file = File,
+ checksum = Checksum}}
+ end;
+ false ->
+ ?vdebug("open ~p database ~p - ok", [Type, Name]),
+ ID = ets:new(Name, [Type, protected, {keypos, 2}]),
+ {ok, #tab{id = ID, rec_name = RecName}}
+ end.
+
+
+%% ---------------------------------------------------------------
+%% close
+%%
+%% Close the mib-storage table.
+%% We will delete the table and if there is a file component,
+%% will also be written to file.
+%% ---------------------------------------------------------------
+close(#tab{id = ID, file = undefined}) ->
+ ?vtrace("close (delete) table ~p", [ID]),
+ ets:delete(ID);
+close(#tab{id = ID, file = File, checksum = Checksum}) ->
+ ?vtrace("close (delete) table ~p", [ID]),
+ write_ets_file(ID, File, Checksum),
+ ets:delete(ID).
+
+
+%% ---------------------------------------------------------------
+%% read
+%%
+%% Retrieve a record from the mib-storage table.
+%% ---------------------------------------------------------------
+
+read(#tab{id = ID}, Key) ->
+ ?vtrace("read from table ~p: ~p", [ID, Key]),
+ case ets:lookup(ID, Key) of
+ [Rec|_] -> {value, Rec};
+ _ -> false
+ end.
+
+
+%% ---------------------------------------------------------------
+%% write
+%%
+%% Write a record to the mib-storage table.
+%% ---------------------------------------------------------------
+
+%% This is a very crude guard test is used instead of: is_record(Rec, RecName)
+write(#tab{id = ID, rec_name = RecName}, Rec)
+ when (is_tuple(Rec) andalso (element(1, Rec) =:= RecName)) ->
+ ?vtrace("write to table ~p", [ID]),
+ ets:insert(ID, Rec).
+
+
+%% ---------------------------------------------------------------
+%% delete
+%%
+%% Delete the mib-storage table.
+%% ---------------------------------------------------------------
+delete(#tab{id = ID, file = undefined}) ->
+ ?vtrace("delete table ~p", [ID]),
+ ets:delete(ID);
+delete(#tab{id = ID, file = File}) ->
+ ?vtrace("delete table ~p", [ID]),
+ file:delete(File),
+ ets:delete(ID).
+
+
+%% ---------------------------------------------------------------
+%% delete
+%%
+%% Delete a record from the mib-storage table.
+%% ---------------------------------------------------------------
+delete(#tab{id = ID}, Key) ->
+ ?vtrace("delete from table ~p: ~p", [ID, Key]),
+ ets:delete(ID, Key).
+
+
+%% ---------------------------------------------------------------
+%% match_object
+%%
+%% Search the mib-storage table for records witch matches
+%% the pattern.
+%% ---------------------------------------------------------------
+
+match_object(#tab{id = ID}, Pattern) ->
+ ?vtrace("match_object in ~p of ~p", [ID, Pattern]),
+ ets:match_object(ID, Pattern).
+
+
+%% ---------------------------------------------------------------
+%% match_delete
+%%
+%% Search the mib-storage table for records witch matches
+%% the pattern and deletes them from the table.
+%% ---------------------------------------------------------------
+
+match_delete(#tab{id = ID}, Pattern) ->
+ ?vtrace("match_delete in ~p with pattern ~p", [ID, Pattern]),
+ Recs = ets:match_object(ID, Pattern),
+ ets:match_delete(ID, Pattern),
+ Recs.
+
+
+%% ---------------------------------------------------------------
+%% tab2list
+%%
+%% Return all records in the mib-storage table in the form
+%% of a list.
+%% ---------------------------------------------------------------
+
+tab2list(#tab{id = ID}) ->
+ ?vtrace("tab2list -> list of ~p", [ID]),
+ ets:tab2list(ID).
+
+
+
+%% ---------------------------------------------------------------
+%% info/1,2
+%%
+%% Retrieve implementation dependent mib-storage table
+%% information.
+%% ---------------------------------------------------------------
+info(#tab{id = ID}) ->
+ ?vtrace("info on ~p", [ID]),
+ case ets:info(ID) of
+ undefined ->
+ [];
+ L ->
+ L
+ end.
+
+
+info(TabId, all = _Item) ->
+ info(TabId);
+info(#tab{id = ID}, Item) ->
+ ?vtrace("info on ~p", [ID]),
+ ets:info(ID, Item).
+
+
+%% ---------------------------------------------------------------
+%% sync
+%%
+%% Dump mib-storage table to disc (if there is a file compionent)
+%% ---------------------------------------------------------------
+
+sync(#tab{file = undefined}) ->
+ ok;
+sync(#tab{id = ID, file = File, checksum = Checksum}) ->
+ ?vtrace("sync ~p", [ID]),
+ write_ets_file(ID, File, Checksum).
+
+
+%% ---------------------------------------------------------------
+%% backup
+%%
+%% Make a backup copy of the mib-storage table. Only valid id
+%% there is a file component.
+%% ---------------------------------------------------------------
+
+backup(#tab{file = undefined}, _BackupDir) ->
+ ok;
+backup(#tab{id = ID, file = File, checksum = Checksum}, BackupDir) ->
+ ?vtrace("backup ~p to ~p", [ID, BackupDir]),
+ Filename = filename:basename(File),
+ case filename:join(BackupDir, Filename) of
+ File ->
+ %% Oups: backup-dir and db-dir the same
+ {error, db_dir};
+ BackupFile ->
+ write_ets_file(ID, BackupFile, Checksum)
+ end.
+
+
+%%----------------------------------------------------------------------
+
+write_ets_file(ID, File, Checksum) when (Checksum =:= true) ->
+ do_write_ets_file(ID, File, [{extended_info, [md5sum]}]);
+write_ets_file(ID, File, Checksum) when (Checksum =:= false) ->
+ do_write_ets_file(ID, File, []).
+
+do_write_ets_file(ID, File, Options) ->
+ TmpFile = File ++ ".tmp",
+ case ets:tab2file(ID, TmpFile, Options) of
+ ok ->
+ case file:rename(TmpFile, File) of
+ ok ->
+ ok;
+ Else ->
+ user_err("Warning: could not move file ~p"
+ " (~p)", [File, Else])
+ end;
+ {error, Reason} ->
+ user_err("Warning: could not save file ~p (~p)",
+ [File, Reason])
+ end.
+
+
+%%----------------------------------------------------------------------
+
+user_err(F, A) ->
+ snmpa_error:user_err(F, A).
diff --git a/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl b/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl
new file mode 100644
index 0000000000..5f66b2ed9f
--- /dev/null
+++ b/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl
@@ -0,0 +1,303 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(snmpa_mib_storage_mnesia).
+
+
+-behaviour(snmpa_mib_storage).
+
+%%%-----------------------------------------------------------------
+%%% This module implements the snmpa_mib_storage behaviour.
+%%% It uses mnesia for storage.
+%%%-----------------------------------------------------------------
+
+-export([
+ open/5,
+ close/1,
+ read/2,
+ write/2,
+ delete/1,
+ delete/2,
+ match_object/2,
+ match_delete/2,
+ tab2list/1,
+ info/1, info/2,
+ sync/1,
+ backup/2
+ ]).
+
+
+-define(VMODULE,"MS-MNESIA").
+-include("snmp_verbosity.hrl").
+
+-record(tab, {id}).
+
+
+%% ---------------------------------------------------------------
+%% open
+%%
+%% Open or create a mnesia table.
+%%
+%% Opts - A list of implementation dependent options
+%% mnesia_open_options() = [mnesia_open_option()]
+%% mnesia_open_option() = {action, keep | clear} |
+%% {nodes, [node()]}
+%%
+%% ---------------------------------------------------------------
+
+open(Name, RecName, Fields, Type, Opts) ->
+ ?vtrace("open ~p table ~p for record ~p",
+ [Type, Name, RecName]),
+ Action = get_action(Opts),
+ Nodes = get_nodes(Opts),
+ case table_exists(Name) of
+ true when (Action =:= keep) ->
+ ?vtrace("open table ~p - exist (keep)", [Name]),
+ {ok, #tab{id = Name}};
+ true when (Action =:= clear) ->
+ ?vtrace("open table ~p - exist (clear)", [Name]),
+ F = fun() -> mnesia:clear_table(Name) end,
+ case mnesia:transaction(F) of
+ {aborted, Reason} ->
+ {error, {clear, Reason}};
+ {atomic, _} ->
+ {ok, #tab{id = Name}}
+ end;
+ false ->
+ ?vtrace("open table ~p - does not exist", [Name]),
+ Args = [{record_name, RecName},
+ {attributes, Fields},
+ {type, Type},
+ {disc_copies, Nodes}],
+ case mnesia:create_table(Name, Args) of
+ {atomic, ok} ->
+ ?vtrace("open table ~p - ok", [Name]),
+ {ok, #tab{id = Name}};
+ {aborted, Reason} ->
+ ?vinfo("open table ~p - aborted"
+ "~n Reason: ~p", [Name, Reason]),
+ {error, {create, Reason}}
+ end
+ end.
+
+table_exists(Name) ->
+ case (catch mnesia:table_info(Name, type)) of
+ {'EXIT', _Reason} ->
+ false;
+ _ ->
+ true
+ end.
+
+
+%% ---------------------------------------------------------------
+%% close
+%%
+%% Close the mib-storage table.
+%% This does nothing in the mnesia case.
+%% ---------------------------------------------------------------
+
+close(_) ->
+ ?vtrace("close mib-storage - ignore",[]),
+ ok.
+
+
+%% ---------------------------------------------------------------
+%% read
+%%
+%% Retrieve a record from the mib-storage table.
+%% ---------------------------------------------------------------
+
+read(#tab{id = ID}, Key) ->
+ ?vtrace("read (dirty) from database ~p: ~p", [ID, Key]),
+ case (catch mnesia:dirty_read(ID, Key)) of
+ [Rec|_] -> {value,Rec};
+ _ -> false
+ end.
+
+
+%% ---------------------------------------------------------------
+%% write
+%%
+%% Write a record to the mib-storage table.
+%% ---------------------------------------------------------------
+
+write(#tab{id = ID}, Rec) ->
+ ?vtrace("write to database ~p", [ID]),
+ F = fun() -> mnesia:write(ID, Rec, write) end,
+ case mnesia:transaction(F) of
+ {aborted, _Reason} = ABORTED ->
+ {error, ABORTED};
+ {atomic,_} ->
+ ok
+ end.
+
+
+%% ---------------------------------------------------------------
+%% delete
+%%
+%% Delete the mib-storage table.
+%% ---------------------------------------------------------------
+
+delete(#tab{id = ID}) ->
+ ?vtrace("delete database: ~p", [ID]),
+ mnesia:delete_table(ID).
+
+
+%% ---------------------------------------------------------------
+%% delete
+%%
+%% Delete a record from the mib-storage table.
+%% ---------------------------------------------------------------
+
+delete(#tab{id = ID}, Key) ->
+ ?vtrace("delete from database ~p: ~p", [ID, Key]),
+ F = fun() -> mnesia:delete(ID, Key, write) end,
+ case mnesia:transaction(F) of
+ {aborted, _Reason} = ABORTED ->
+ {error, ABORTED};
+ {atomic, _} ->
+ ok
+ end.
+
+
+%% ---------------------------------------------------------------
+%% match_object
+%%
+%% Search the mib-storage table for records witch matches
+%% the pattern.
+%% ---------------------------------------------------------------
+
+match_object(#tab{id = ID}, Pattern) ->
+ ?vtrace("match_object in ~p of ~p", [ID, Pattern]),
+ F = fun() -> mnesia:match_object(ID, Pattern, read) end,
+ case mnesia:transaction(F) of
+ {aborted, _Reason} = ABORTED ->
+ {error, ABORTED};
+ {atomic, Rs} ->
+ Rs
+ end.
+
+
+%% ---------------------------------------------------------------
+%% match_delete
+%%
+%% Search the mib-storage table for records witch matches
+%% the pattern and deletes them from the table.
+%% ---------------------------------------------------------------
+
+match_delete(#tab{id = ID}, Pattern) ->
+ ?vtrace("match_delete in ~p with pattern ~p", [ID, Pattern]),
+ F = fun() ->
+ Recs = mnesia:match_object(ID, Pattern, read),
+ lists:foreach(fun(Rec) ->
+ mnesia:delete_object(ID, Rec, write)
+ end, Recs),
+ Recs
+ end,
+ case mnesia:transaction(F) of
+ {aborted, _Reason} = ABORTED ->
+ {error, ABORTED};
+ {atomic, Rs} ->
+ Rs
+ end.
+
+
+%% ---------------------------------------------------------------
+%% tab2list
+%%
+%% Return all records in the mib-storage table in the form of
+%% a list.
+%% ---------------------------------------------------------------
+
+tab2list(#tab{id = ID} = Tab) ->
+ ?vtrace("tab2list -> list of ~p", [ID]),
+ match_object(Tab, mnesia:table_info(ID, wild_pattern)).
+
+
+%% ---------------------------------------------------------------
+%% info
+%%
+%% Retrieve implementation dependent mib-storage table
+%% information.
+%% ---------------------------------------------------------------
+
+info(#tab{id = ID}) ->
+ case (catch mnesia:table_info(ID, all)) of
+ Info when is_list(Info) ->
+ Info;
+ {'EXIT', {aborted, Reason}} ->
+ {error, Reason}
+ end.
+
+
+info(#tab{id = ID}, Item) ->
+ mnesia:table_info(ID, Item).
+
+
+%% ---------------------------------------------------------------
+%% sync
+%%
+%% Ignore
+%% ---------------------------------------------------------------
+
+sync(_) ->
+ ok.
+
+
+%% ---------------------------------------------------------------
+%% backup
+%%
+%% Ignore. Mnesia handles its own backups.
+%% ---------------------------------------------------------------
+
+backup(_, _) ->
+ ok.
+
+
+%%----------------------------------------------------------------------
+
+get_action(Opts) ->
+ snmp_misc:get_option(action, Opts, keep).
+
+get_nodes(Opts) ->
+ case snmp_misc:get_option(nodes, Opts, erlang:nodes()) of
+ [] ->
+ [node()];
+ Nodes when is_list(Nodes) ->
+ Nodes;
+ all ->
+ erlang:nodes();
+ visible ->
+ erlang:nodes(visible);
+ connected ->
+ erlang:nodes(connected);
+ db_nodes ->
+ try mnesia:system_info(db_nodes) of
+ DbNodes when is_list(DbNodes) ->
+ DbNodes;
+ _ ->
+ erlang:nodes()
+ catch
+ _:_ ->
+ erlang:nodes()
+ end
+ end.
+
+%% user_err(F, A) ->
+%% snmpa_error:user_err(F, A).
diff --git a/lib/snmp/src/agent/snmpa_misc_sup.erl b/lib/snmp/src/agent/snmpa_misc_sup.erl
index 488d3f7921..746405ec1d 100644
--- a/lib/snmp/src/agent/snmpa_misc_sup.erl
+++ b/lib/snmp/src/agent/snmpa_misc_sup.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_mpd.erl b/lib/snmp/src/agent/snmpa_mpd.erl
index 2d37ea56f0..b440d57d03 100644
--- a/lib/snmp/src/agent/snmpa_mpd.erl
+++ b/lib/snmp/src/agent/snmpa_mpd.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -20,7 +21,7 @@
-export([init/1, reset/0, inc/1, counters/0,
discarded_pdu/1,
- process_packet/6, process_packet/7,
+ process_packet/5, process_packet/6, process_packet/7,
generate_response_msg/5, generate_response_msg/6,
generate_msg/5, generate_msg/6,
generate_discovery_msg/4,
@@ -75,8 +76,9 @@
init(Vsns) ->
?vlog("init -> entry with"
"~n Vsns: ~p", [Vsns]),
- {A,B,C} = erlang:now(),
- random:seed(A,B,C),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
ets:insert(snmp_agent_table, {msg_id, random:uniform(2147483647)}),
ets:insert(snmp_agent_table, {req_id, random:uniform(2147483647)}),
init_counters(),
@@ -113,22 +115,30 @@ reset() ->
% length(snmp_pdus:enc_message(M)) + 4.
%%-----------------------------------------------------------------
-%% Func: process_packet(Packet, TDomain, TAddress, State, Log) ->
+%% Func: process_packet(Packet, Domain, Address, State, Log) ->
%% {ok, SnmpVsn, Pdu, PduMS, ACMData} | {discarded, Reason}
%% Types: Packet = binary()
-%% TDomain = snmpUDPDomain | transportDomain()
-%% TAddress = {Ip, Udp} (*but* depends on TDomain)
+%% Domain = snmpUDPDomain | transportDomain()
+%% Address = {Ip, Udp} (*but* depends on Domain)
%% State = #state
%% Purpose: This is the main Message Dispatching function. (see
%% section 4.2.1 in rfc2272)
%%-----------------------------------------------------------------
-process_packet(Packet, TDomain, TAddress, State, NoteStore, Log) ->
+process_packet(Packet, From, State, NoteStore, Log) ->
LocalEngineID = ?DEFAULT_LOCAL_ENGINE_ID,
- process_packet(Packet, TDomain, TAddress, LocalEngineID,
- State, NoteStore, Log).
-
-process_packet(Packet, TDomain, TAddress, LocalEngineID,
- State, NoteStore, Log) ->
+ process_packet(Packet, From, LocalEngineID, State, NoteStore, Log).
+
+process_packet(
+ Packet, Domain, Address, LocalEngineID, State, NoteStore, Log) ->
+ From = {Domain, Address},
+ process_packet(Packet, From, LocalEngineID, State, NoteStore, Log).
+
+process_packet(Packet, Domain, Address, State, NoteStore, Log)
+ when is_atom(Domain) ->
+ LocalEngineID = ?DEFAULT_LOCAL_ENGINE_ID,
+ From = {Domain, Address},
+ process_packet(Packet, From, LocalEngineID, State, NoteStore, Log);
+process_packet(Packet, From, LocalEngineID, State, NoteStore, Log) ->
inc(snmpInPkts),
case catch snmp_pdus:dec_message_only(binary_to_list(Packet)) of
@@ -136,17 +146,17 @@ process_packet(Packet, TDomain, TAddress, LocalEngineID,
when State#state.v1 =:= true ->
?vlog("v1, community: ~s", [Community]),
HS = ?empty_msg_size + length(Community),
- v1_v2c_proc('version-1', NoteStore, Community,
- TDomain, TAddress,
- LocalEngineID, Data, HS, Log, Packet);
+ v1_v2c_proc(
+ 'version-1', NoteStore, Community, From,
+ LocalEngineID, Data, HS, Log, Packet);
#message{version = 'version-2', vsn_hdr = Community, data = Data}
when State#state.v2c =:= true ->
?vlog("v2c, community: ~s", [Community]),
HS = ?empty_msg_size + length(Community),
- v1_v2c_proc('version-2', NoteStore, Community,
- TDomain, TAddress,
- LocalEngineID, Data, HS, Log, Packet);
+ v1_v2c_proc(
+ 'version-2', NoteStore, Community, From,
+ LocalEngineID, Data, HS, Log, Packet);
#message{version = 'version-3', vsn_hdr = V3Hdr, data = Data}
when State#state.v3 =:= true ->
@@ -154,9 +164,9 @@ process_packet(Packet, TDomain, TAddress, LocalEngineID,
[V3Hdr#v3_hdr.msgID,
V3Hdr#v3_hdr.msgFlags,
V3Hdr#v3_hdr.msgSecurityModel]),
- v3_proc(NoteStore, Packet,
- TDomain, TAddress,
- LocalEngineID, V3Hdr, Data, Log);
+ v3_proc(
+ NoteStore, Packet, From,
+ LocalEngineID, V3Hdr, Data, Log);
{'EXIT', {bad_version, Vsn}} ->
?vtrace("exit: bad version: ~p",[Vsn]),
@@ -183,11 +193,32 @@ discarded_pdu(Variable) -> inc(Variable).
%%-----------------------------------------------------------------
%% Handles a Community based message (v1 or v2c).
%%-----------------------------------------------------------------
-v1_v2c_proc(Vsn, NoteStore, Community, Domain,
- {Ip, Udp}, LocalEngineID,
- Data, HS, Log, Packet) ->
- TDomain = snmp_conf:mk_tdomain(Domain),
- TAddress = snmp_conf:mk_taddress(Domain, Ip, Udp),
+v1_v2c_proc(
+ Vsn, NoteStore, Community, From,
+ LocalEngineID, Data, HS, Log, Packet) ->
+ try
+ case From of
+ {D, A} when is_atom(D) ->
+ {snmp_conf:mk_tdomain(D),
+ snmp_conf:mk_taddress(D, A)};
+ {_, P} = A when is_integer(P) ->
+ {snmp_conf:mk_tdomain(),
+ snmp_conf:mk_taddress(A)}
+ end
+ of
+ {TDomain, TAddress} ->
+ v1_v2c_proc_dec(
+ Vsn, NoteStore, Community, TDomain, TAddress,
+ LocalEngineID, Data, HS, Log, Packet)
+ catch
+ _ ->
+ {discarded, {badarg, From}}
+ end.
+
+
+v1_v2c_proc_dec(
+ Vsn, NoteStore, Community, TDomain, TAddress,
+ LocalEngineID, Data, HS, Log, Packet) ->
AgentMS = get_engine_max_message_size(LocalEngineID),
MgrMS = snmp_community_mib:get_target_addr_ext_mms(TDomain, TAddress),
PduMS = case MgrMS of
@@ -214,7 +245,7 @@ v1_v2c_proc(Vsn, NoteStore, Community, Domain,
case Pdu#pdu.type of
'set-request' ->
%% Check if this message has already been processed
- Key = {agent, Ip, ReqId},
+ Key = {agent, {TDomain, TAddress}, ReqId},
case snmp_note_store:get_note(NoteStore, Key) of
undefined ->
%% Set the processed note _after_ pdu processing.
@@ -236,13 +267,7 @@ v1_v2c_proc(Vsn, NoteStore, Community, Domain,
{discarded, Reason};
_TrapPdu ->
{discarded, trap_pdu}
- end;
-v1_v2c_proc(_Vsn, _NoteStore, _Community, snmpUDPDomain, TAddress,
- _LocalEngineID, _Data, _HS, _Log, _Packet) ->
- {discarded, {badarg, TAddress}};
-v1_v2c_proc(_Vsn, _NoteStore, _Community, TDomain, _TAddress,
- _LocalEngineID, _Data, _HS, _Log, _Packet) ->
- {discarded, {badarg, TDomain}}.
+ end.
sec_model('version-1') -> ?SEC_V1;
sec_model('version-2') -> ?SEC_V2C.
@@ -252,8 +277,7 @@ sec_model('version-2') -> ?SEC_V2C.
%% Handles a SNMPv3 Message, following the procedures in rfc2272,
%% section 4.2 and 7.2
%%-----------------------------------------------------------------
-v3_proc(NoteStore, Packet, _TDomain, _TAddress, LocalEngineID,
- V3Hdr, Data, Log) ->
+v3_proc(NoteStore, Packet, _From, LocalEngineID, V3Hdr, Data, Log) ->
case (catch v3_proc(NoteStore, Packet, LocalEngineID, V3Hdr, Data, Log)) of
{'EXIT', Reason} ->
exit(Reason);
@@ -657,7 +681,7 @@ generate_response_msg(Vsn, RePdu, Type,
?SEC_USM ->
snmpa_usm
end,
- SecEngineID = LocalEngineID,
+ SecEngineID = LocalEngineID, % 3.1.1a
?vtrace("generate_response_msg -> SecEngineID: ~w", [SecEngineID]),
case (catch SecModule:generate_outgoing_msg(Message,
SecEngineID,
@@ -749,21 +773,7 @@ generate_v3_report_msg(MsgID, MsgSecurityModel, Data, LocalEngineID,
ContextEngineID, ContextName, SecData},
LocalEngineID, Log).
-%% req_id(#scopedPdu{data = #pdu{request_id = ReqId}}) ->
-%% ?vtrace("Report ReqId: ~p",[ReqId]),
-%% ReqId;
-%% req_id(_) ->
-%% 0. % RFC2572, 7.1.3.c.4
-
-%% maybe_generate_discovery1_report_msg() ->
-%% case (catch DiscoveryHandler:handle_discovery1(Ip, Udp, EngineId)) of
-%% {ok, Entry} when is_record(Entry, snmp_discovery_data1) ->
-%% ok;
-%% ignore ->
-%% ok;
-%% {error, Reason} ->
-
%% Response to stage 1 discovery message (terminating, i.e. from the manager)
generate_discovery1_report_msg(MsgID, MsgSecurityModel,
SecName, SecLevel,
@@ -999,7 +1009,7 @@ generate_discovery_msg(NoteStore, {TDomain, TAddress},
InitialUserName,
ContextName, Timeout) ->
- {ok, {_Domain, Address}} = transform_taddr(TDomain, TAddress),
+ {ok, {Domain, Address}} = transform_taddr(TDomain, TAddress),
%% 7.1.7
?vdebug("generate_discovery_msg -> 7.1.7 (~w)", [ManagerEngineID]),
@@ -1041,7 +1051,7 @@ generate_discovery_msg(NoteStore, {TDomain, TAddress},
%% Log(Packet),
inc_snmp_out_vars(Pdu),
?vdebug("generate_discovery_msg -> done", []),
- {Packet, Address};
+ {Domain, Address, Packet};
Error ->
throw(Error)
@@ -1081,8 +1091,22 @@ transform_taddr(?transportDomainUdpIpv4, [A, B, C, D, P1, P2]) ->
{ok, {Domain, Address}};
transform_taddr(?transportDomainUdpIpv4, BadAddr) ->
{error, {bad_transportDomainUdpIpv4_address, BadAddr}};
-transform_taddr(?transportDomainUdpIpv6,
- [A1, A2, A3, A4, A5, A6, A7, A8, P1, P2]) ->
+transform_taddr(
+ ?transportDomainUdpIpv6,
+ [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16,
+ P1, P2]) ->
+ Domain = transportDomainUdpIpv6,
+ Addr =
+ {(A1 bsl 8) bor A2, (A3 bsl 8) bor A4,
+ (A5 bsl 8) bor A6, (A7 bsl 8) bor A8,
+ (A9 bsl 8) bor A10, (A11 bsl 8) bor A12,
+ (A13 bsl 8) bor A14, (A15 bsl 8) bor A16},
+ Port = P1 bsl 8 + P2,
+ Address = {Addr, Port},
+ {ok, {Domain, Address}};
+transform_taddr(
+ ?transportDomainUdpIpv6,
+ [A1, A2, A3, A4, A5, A6, A7, A8, P1, P2]) ->
Domain = transportDomainUdpIpv6,
Addr = {A1, A2, A3, A4, A5, A6, A7, A8},
Port = P1 bsl 8 + P2,
@@ -1171,6 +1195,9 @@ mk_v1_v2_packet_list([{Domain, Addr} | T],
%% Sending from default UDP port
inc_snmp_out_vars(Pdu),
Entry = {Domain, Addr, Packet},
+ %% It would be cleaner to return {To, Packet} to not
+ %% break the abstraction for an address on the
+ %% {Domain, Address} format.
mk_v1_v2_packet_list(T, Packet, Len, Pdu, [Entry | Acc]).
@@ -1277,6 +1304,9 @@ mk_v3_packet_entry(NoteStore, Domain, Addr,
req_id = Pdu#pdu.request_id},
snmp_note_store:set_note(NoteStore, 1500, CacheKey, CacheVal),
inc_snmp_out_vars(Pdu),
+ %% It would be cleaner to return {To, Packet} to not
+ %% break the abstraction for an address on the
+ %% {Domain, Address} format.
{ok, {Domain, Addr, Data}}
end.
diff --git a/lib/snmp/src/agent/snmpa_net_if.erl b/lib/snmp/src/agent/snmpa_net_if.erl
index 79c85a6e4e..ecf9498ca9 100644
--- a/lib/snmp/src/agent/snmpa_net_if.erl
+++ b/lib/snmp/src/agent/snmpa_net_if.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -35,18 +36,27 @@
-include("snmp_debug.hrl").
-include("snmp_verbosity.hrl").
--record(state, {parent,
- note_store,
- master_agent,
- usock,
- usock_opts,
- mpd_state,
- log,
- reqs = [],
- debug = false,
- limit = infinity,
- rcnt = [],
- filter}).
+-record(state,
+ {parent,
+ note_store,
+ master_agent,
+ transports = [],
+%% usock,
+%% usock_opts,
+ mpd_state,
+ log,
+ reqs = [],
+ debug = false,
+ limit = infinity,
+%% rcnt = [],
+ filter}).
+%% domain = snmpUDPDomain}).
+
+-record(transport,
+ {socket,
+ domain = snmpUDPDomain,
+ opts = [],
+ req_refs = []}).
-ifndef(default_verbosity).
-define(default_verbosity,silence).
@@ -104,13 +114,9 @@ get_request_limit(Pid) ->
set_request_limit(Pid, NewLimit) ->
call(Pid, {set_request_limit, NewLimit}).
-get_port() ->
- {value, UDPPort} = snmp_framework_mib:intAgentUDPPort(get),
- UDPPort.
-
-get_address() ->
- {value, IPAddress} = snmp_framework_mib:intAgentIpAddress(get),
- IPAddress.
+get_transports() ->
+ {value, Transports} = snmp_framework_mib:intAgentTransports(get),
+ Transports.
filter_reset(Pid) ->
Pid ! filter_reset.
@@ -129,7 +135,22 @@ init(Prio, NoteStore, MasterAgent, Parent, Opts) ->
case (catch do_init(Prio, NoteStore, MasterAgent, Parent, Opts)) of
{ok, State} ->
proc_lib:init_ack({ok, self()}),
- loop(State);
+ try loop(State)
+ catch
+ C:E when C =/= exit, E =/= shutdown ->
+ Fmt =
+ "loop/1 EXCEPTION ~w:~w~n"
+ " ~p",
+ S = erlang:get_stacktrace(),
+ case C of
+ exit ->
+ %% Externally killed, root cause is elsewhere
+ info_msg(Fmt, [C, E, S]);
+ _ ->
+ error_msg(Fmt, [C, E, S])
+ end,
+ erlang:raise(C, E, S)
+ end;
{error, Reason} ->
config_err("failed starting net-if: ~n~p", [Reason]),
proc_lib:init_ack({error, Reason});
@@ -147,12 +168,6 @@ do_init(Prio, NoteStore, MasterAgent, Parent, Opts) ->
put(verbosity,get_verbosity(Opts)),
?vlog("starting",[]),
- %% -- Port and address --
- UDPPort = get_port(),
- ?vdebug("port: ~w",[UDPPort]),
- IPAddress = get_address(),
- ?vdebug("addr: ~w",[IPAddress]),
-
%% -- Versions --
Vsns = get_vsns(Opts),
?vdebug("vsns: ~w",[Vsns]),
@@ -162,39 +177,45 @@ do_init(Prio, NoteStore, MasterAgent, Parent, Opts) ->
?vdebug("Limit: ~w", [Limit]),
FilterOpts = get_filter_opts(Opts),
FilterMod = create_filter(FilterOpts),
- ?vdebug("FilterMod: ~w", [FilterMod]),
+ ?vdebug("FilterMod: ~w FilterOpts: ~p", [FilterMod,FilterOpts]),
%% -- Audit trail log
Log = create_log(),
?vdebug("Log: ~w",[Log]),
-
- %% -- Socket --
- IPOpts1 = ip_opt_bind_to_ip_address(Opts, IPAddress),
- IPOpts2 = ip_opt_no_reuse_address(Opts),
- IPOpts3 = ip_opt_recbuf(Opts),
- IPOpts4 = ip_opt_sndbuf(Opts),
- IPOpts = [binary | IPOpts1 ++ IPOpts2 ++ IPOpts3 ++ IPOpts4],
- ?vdebug("open socket with options: ~w",[IPOpts]),
- case gen_udp_open(UDPPort, IPOpts) of
- {ok, Sock} ->
+ DomainAddresses = get_transports(),
+ ?vdebug("DomainAddresses: ~w",[DomainAddresses]),
+ try
+ [begin
+ SocketOpts = socket_opts(Domain, Address, Opts),
+ Socket = socket_open(Domain, SocketOpts),
+ active_once(Socket),
+ #transport{
+ socket = Socket,
+ domain = Domain,
+ opts = SocketOpts}
+ end || {Domain, Address} <- DomainAddresses]
+ of
+ [] ->
+ ?vinfo("No transports configured: ~p", [DomainAddresses]),
+ {error, {no_transports,DomainAddresses}};
+ Transports ->
MpdState = snmpa_mpd:init(Vsns),
- init_counters(),
- active_once(Sock),
+ init_counters(),
S = #state{parent = Parent,
note_store = NoteStore,
master_agent = MasterAgent,
mpd_state = MpdState,
- usock = Sock,
- usock_opts = IPOpts,
+ transports = Transports,
log = Log,
limit = Limit,
filter = FilterMod},
?vdebug("started with MpdState: ~p", [MpdState]),
- {ok, S};
- {error, Reason} ->
- ?vinfo("Failed to open UDP socket: ~p", [Reason]),
- {error, {udp_open, UDPPort, Reason}}
+ {ok, S}
+ catch
+ Error ->
+ ?vinfo("Failed to initialize socket(s): ~p", [Error]),
+ {error, Error}
end.
@@ -250,48 +271,84 @@ create_filter(BadOpts) ->
throw({error, {bad_filter_opts, BadOpts}}).
-log({_, []}, _, _, _, _) ->
+log({_, []}, _, _, _) ->
ok;
-log({Log, Types}, 'set-request', Packet, Addr, Port) ->
+log({Log, Types}, 'set-request', Packet, Address) ->
case lists:member(write, Types) of
true ->
- snmp_log:log(Log, Packet, Addr, Port);
+ snmp_log:log(Log, Packet, format_address(Address));
false ->
ok
end;
-log({Log, Types}, _, Packet, Addr, Port) ->
+log({Log, Types}, _, Packet, Address) ->
case lists:member(read, Types) of
true ->
- snmp_log:log(Log, Packet, Addr, Port);
+ snmp_log:log(Log, Packet, format_address(Address));
false ->
ok
- end;
-log(_, _, _, _, _) ->
- ok.
-
-
-gen_udp_open(Port, Opts) ->
+ end.
+
+format_address(Address) ->
+ iolist_to_binary(snmp_conf:mk_addr_string(Address)).
+
+
+socket_open(snmpUDPDomain = Domain, [IpPort | Opts]) ->
case init:get_argument(snmp_fd) of
{ok, [[FdStr]]} ->
Fd = list_to_integer(FdStr),
- gen_udp:open(0, [{fd, Fd}|Opts]);
+ ?vdebug("socket_open(~p, [~p | ~p]) Fd: ~p",
+ [Domain, IpPort, Opts, Fd]),
+ gen_udp_open(0, [{fd, Fd} | Opts]);
error ->
case init:get_argument(snmpa_fd) of
{ok, [[FdStr]]} ->
Fd = list_to_integer(FdStr),
- gen_udp:open(0, [{fd, Fd}|Opts]);
+ ?vdebug("socket_open(~p, [~p | ~p]) Fd: ~p",
+ [Domain, IpPort, Opts, Fd]),
+ gen_udp_open(0, [{fd, Fd} | Opts]);
error ->
- gen_udp:open(Port, Opts)
+ ?vdebug("socket_open(~p, [~p | ~p])",
+ [Domain, IpPort, Opts]),
+ gen_udp_open(IpPort, Opts)
end
+ end;
+socket_open(Domain, [IpPort | Opts])
+ when Domain =:= transportDomainUdpIpv4;
+ Domain =:= transportDomainUdpIpv6 ->
+ ?vdebug("socket_open(~p, [~p | ~p])", [Domain, IpPort, Opts]),
+ gen_udp_open(IpPort, Opts);
+socket_open(Domain, Opts) ->
+ throw({socket_open, Domain, Opts}).
+
+gen_udp_open(IpPort, Opts) ->
+ case gen_udp:open(IpPort, Opts) of
+ {ok, Socket} ->
+ Socket;
+ {error, Reason} ->
+ throw({udp_open, IpPort, Reason})
end.
-loop(S) ->
+
+loop(#state{transports = Transports, limit = Limit, parent = Parent} = S) ->
+ ?vdebug("loop(~p)", [S]),
receive
- {udp, _UdpId, Ip, Port, Packet} ->
- ?vlog("got paket from ~w:~w",[Ip,Port]),
- NewS = maybe_handle_recv(S, Ip, Port, Packet),
- loop(NewS);
+ {udp, Socket, IpAddr, IpPort, Packet} = Msg when is_port(Socket) ->
+ ?vlog("got paket from ~w:~w on ~w", [IpAddr, IpPort, Socket]),
+ case lists:keyfind(Socket, #transport.socket, Transports) of
+ #transport{socket = Socket, domain = Domain} = Transport ->
+ From =
+ case Domain of
+ snmpUDPDomain ->
+ {IpAddr, IpPort};
+ _ ->
+ {Domain, {IpAddr, IpPort}}
+ end,
+ loop(maybe_handle_recv(S, Transport, From, Packet));
+ false ->
+ error_msg("Packet on unknown port: ~p", [Msg]),
+ loop(S)
+ end;
{info, ReplyRef, Pid} ->
Info = get_info(S),
@@ -299,47 +356,78 @@ loop(S) ->
loop(S);
%% response (to get/get_next/get_bulk/set requests)
- {snmp_response, Vsn, RePdu, Type, ACMData, Dest, []} ->
+ {snmp_response, Vsn, RePdu, Type, ACMData, To, Extra} ->
?vlog("reply pdu: "
"~n ~s",
[?vapply(snmp_misc, format, [256, "~w", [RePdu]])]),
- NewS = maybe_handle_reply_pdu(S, Vsn, RePdu, Type, ACMData, Dest),
- loop(NewS);
+ {_, ReqRef} = lists:keyfind(request_ref, 1, Extra),
+ case
+ case
+ (Limit =/= infinity) andalso
+ select_transport_from_req_ref(ReqRef, Transports)
+ of
+ false ->
+ select_transport_from_domain(
+ address_to_domain(To),
+ Transports);
+ T ->
+ T
+ end
+ of
+ false ->
+ error_msg(
+ "Can not find transport for response PDU to: ~s",
+ [format_address(To)]),
+ loop(S);
+ Transport ->
+ NewS = update_req_counter_outgoing(S, Transport, ReqRef),
+ maybe_handle_reply_pdu(
+ NewS, Transport, Vsn, RePdu, Type, ACMData, To),
+ loop(NewS)
+ end;
%% Traps/notification
- {send_pdu, Vsn, Pdu, MsgData, To} ->
- ?vdebug("send pdu: "
- "~n Pdu: ~p"
- "~n To: ~p", [Pdu, To]),
- NewS = maybe_handle_send_pdu(S, Vsn, Pdu, MsgData, To, undefined),
+ {send_pdu, Vsn, Pdu, MsgData, TDomAddrs} ->
+ ?vdebug("send pdu:~n"
+ " Pdu: ~p~n"
+ " TDomAddrs: ~p", [Pdu, TDomAddrs]),
+ NewS =
+ maybe_handle_send_pdu(
+ S, Vsn, Pdu, MsgData, TDomAddrs, undefined),
loop(NewS);
%% We dont use the extra-info at this time, ...
- {send_pdu, Vsn, Pdu, MsgData, To, _ExtraInfo} ->
- ?vdebug("send pdu: "
- "~n Pdu: ~p"
- "~n To: ~p", [Pdu, To]),
- NewS = maybe_handle_send_pdu(S, Vsn, Pdu, MsgData, To, undefined),
+ {send_pdu, Vsn, Pdu, MsgData, TDomAddrs, _ExtraInfo} ->
+ ?vdebug("send pdu:~n"
+ " Pdu: ~p~n"
+ " TDomAddrs: ~p", [Pdu, TDomAddrs]),
+ NewS =
+ maybe_handle_send_pdu(
+ S, Vsn, Pdu, MsgData, TDomAddrs, undefined),
loop(NewS);
%% Informs
- {send_pdu_req, Vsn, Pdu, MsgData, To, From} ->
- ?vdebug("send pdu request: "
- "~n Pdu: ~p"
- "~n To: ~p"
- "~n From: ~p",
- [Pdu, To, toname(From)]),
- NewS = maybe_handle_send_pdu(S, Vsn, Pdu, MsgData, To, From),
+ {send_pdu_req, Vsn, Pdu, MsgData, TDomAddrs, From} ->
+ ?vdebug("send pdu request:~n"
+ " Pdu: ~p~n"
+ " TDomAddrs: ~p~n"
+ " From: ~p",
+ [Pdu, TDomAddrs, toname(From)]),
+ NewS =
+ maybe_handle_send_pdu(
+ S, Vsn, Pdu, MsgData, TDomAddrs, From),
loop(NewS);
%% We dont use the extra-info at this time, ...
- {send_pdu_req, Vsn, Pdu, MsgData, To, From, _ExtraInfo} ->
- ?vdebug("send pdu request: "
- "~n Pdu: ~p"
- "~n To: ~p"
- "~n From: ~p",
- [Pdu, To, toname(From)]),
- NewS = maybe_handle_send_pdu(S, Vsn, Pdu, MsgData, To, From),
+ {send_pdu_req, Vsn, Pdu, MsgData, TDomAddrs, From, _ExtraInfo} ->
+ ?vdebug("send pdu request:~n"
+ " Pdu: ~p~n"
+ " TDomAddrs: ~p~n"
+ " From: ~p",
+ [Pdu, TDomAddrs, toname(From)]),
+ NewS =
+ maybe_handle_send_pdu(
+ S, Vsn, Pdu, MsgData, TDomAddrs, From),
loop(NewS);
%% Discovery Inform
@@ -365,15 +453,34 @@ loop(S) ->
NewS = handle_send_discovery(S, Pdu, MsgData, To, From),
loop(NewS);
- {discarded_pdu, _Vsn, ReqId, _ACMData, Variable, _Extra} ->
- ?vdebug("discard PDU: ~p", [Variable]),
+ {discarded_pdu, _Vsn, ReqId, _ACMData, Variable, Extra} ->
+ ?vdebug("discard PDU: ~p - ~p - ~p",
+ [Variable, Extra, Transports]),
snmpa_mpd:discarded_pdu(Variable),
- NewS = update_req_counter_outgoing(S, ReqId),
- loop(NewS);
+ {_, ReqRef} = lists:keyfind(request_ref, 1, Extra),
+ if
+ Limit =:= infinity ->
+ %% The incoming PDU was not registered
+ loop(update_req_counter_outgoing(S, false, ReqRef));
+ true ->
+ case
+ select_transport_from_req_ref(ReqRef, Transports)
+ of
+ false ->
+ error_msg(
+ "Can not find transport for discarded PDU: ~p",
+ [ReqId]),
+ loop(S);
+ Transport ->
+ loop(
+ update_req_counter_outgoing(
+ S, Transport, ReqRef))
+ end
+ end;
{get_log_type, ReplyRef, Pid} ->
?vdebug("get log type: ~p", []),
- #state{log = {_, LogType}} = S,
+ {_, LogType} = S#state.log,
Pid ! {ReplyRef, {ok, LogType}, self()},
loop(S);
@@ -385,7 +492,6 @@ loop(S) ->
{get_request_limit, ReplyRef, Pid} ->
?vdebug("get request limit: ~p", []),
- #state{limit = Limit} = S,
Pid ! {ReplyRef, {ok, Limit}, self()},
loop(S);
@@ -409,36 +515,50 @@ loop(S) ->
reset_counters(),
loop(S);
- {'EXIT', Parent, Reason} when Parent == S#state.parent ->
+ {'EXIT', Parent, Reason} ->
?vlog("parent (~p) exited: "
"~n ~p", [Parent, Reason]),
exit(Reason);
- {'EXIT', Port, Reason} when Port == S#state.usock ->
- UDPPort = get_port(),
- NewS =
- case gen_udp_open(UDPPort, S#state.usock_opts) of
- {ok, Id} ->
- error_msg("Port ~p exited for reason"
- "~n ~p"
- "~n Re-opened (~p)", [Port, Reason, Id]),
- S#state{usock = Id};
- {error, ReopenReason} ->
- error_msg("Port ~p exited for reason"
- "~n ~p"
- "~n Re-open failed with reason"
- "~n ~p",
- [Port, Reason, ReopenReason]),
- ok
- end,
- loop(NewS);
-
- {'EXIT', Port, Reason} when is_port(Port) ->
- error_msg("Exit message from port ~p for reason ~p~n",
- [Port, Reason]),
- loop(S);
-
- {'EXIT', Pid, Reason} ->
+ {'EXIT', Socket, Reason} when is_port(Socket) ->
+ case lists:keyfind(Socket, #transport.socket, Transports) of
+ #transport{
+ socket = Socket,
+ domain = Domain,
+ opts = SocketOpts,
+ req_refs = ReqRefs} = Transport ->
+ try socket_open(Domain, SocketOpts) of
+ NewSocket ->
+ error_msg(
+ "Socket ~p exited for reason"
+ "~n ~p"
+ "~n Re-opened (~p)",
+ [Socket, Reason, NewSocket]),
+ (length(ReqRefs) < Limit) andalso
+ active_once(NewSocket),
+ S#state{
+ transports =
+ lists:keyreplace(
+ Socket, #transport.socket, Transports,
+ Transport#transport{socket = NewSocket})}
+ catch
+ ReopenReason ->
+ error_msg(
+ "Socket ~p exited for reason"
+ "~n ~p"
+ "~n Re-open failed with reason"
+ "~n ~p",
+ [Socket, Reason, ReopenReason]),
+ exit(ReopenReason)
+ end;
+ false ->
+ error_msg(
+ "Exit message from port ~p for reason ~p~n",
+ [Socket, Reason]),
+ loop(S)
+ end;
+
+ {'EXIT', Pid, Reason} when is_pid(Pid) ->
?vlog("~p exited: "
"~n ~p", [Pid, Reason]),
NewS = clear_reqs(Pid, S),
@@ -446,205 +566,321 @@ loop(S) ->
{system, From, Msg} ->
?vdebug("system event ~p from ~p", [Msg, From]),
- sys:handle_system_msg(Msg, From, S#state.parent, ?MODULE, [], S);
+ sys:handle_system_msg(Msg, From, Parent, ?MODULE, [], S);
_ ->
loop(S)
end.
-update_req_counter_incomming(#state{limit = infinity, usock = Sock} = S, _) ->
- active_once(Sock), %% No limit so activate directly
+update_req_counter_incoming(
+ #state{limit = infinity} = S,
+ #transport{socket = Socket},
+ _ReqRef) ->
+ active_once(Socket), %% No limit so activate directly
S;
-update_req_counter_incomming(#state{limit = Limit,
- rcnt = RCnt,
- usock = Sock} = S, Rid)
- when length(RCnt) + 1 == Limit ->
+update_req_counter_incoming(
+ #state{limit = Limit} = S,
+ #transport{socket = Socket, req_refs = ReqRefs} = T,
+ ReqRef) when length(ReqRefs) + 1 >= Limit ->
%% Ok, one more and we are at the limit.
%% Just make sure we are not already processing this one...
- case lists:member(Rid, RCnt) of
+ case lists:member(ReqRef, ReqRefs) of
false ->
%% We are at the limit, do _not_ activate socket
- S#state{rcnt = [Rid|RCnt]};
+ update_transport_req_refs(S, T, [ReqRef | ReqRefs]);
true ->
- active_once(Sock),
+ active_once(Socket),
S
end;
-update_req_counter_incomming(#state{rcnt = RCnt,
- usock = Sock} = S, Rid) ->
- active_once(Sock),
- case lists:member(Rid, RCnt) of
+update_req_counter_incoming(
+ #state{} = S,
+ #transport{socket = Socket, req_refs = ReqRefs} = T,
+ ReqRef) ->
+ active_once(Socket),
+ case lists:member(ReqRef, ReqRefs) of
false ->
- S#state{rcnt = [Rid|RCnt]};
+ update_transport_req_refs(S, T, [ReqRef | ReqRefs]);
true ->
S
end.
-
-update_req_counter_outgoing(#state{limit = infinity} = S, _Rid) ->
+update_req_counter_outgoing(
+ #state{limit = infinity} = S,
+ _Transport, _ReqRef) ->
%% Already activated (in the incoming function)
S;
-update_req_counter_outgoing(#state{limit = Limit,
- rcnt = RCnt,
- usock = Sock} = S, Rid)
- when length(RCnt) == Limit ->
- ?vtrace("handle_req_counter_outgoing(~w) -> entry with"
- "~n Rid: ~w"
- "~n length(RCnt): ~w", [Limit, Rid, length(RCnt)]),
- case lists:delete(Rid, RCnt) of
- NewRCnt when length(NewRCnt) < Limit ->
+update_req_counter_outgoing(
+ #state{limit = Limit} = S,
+ #transport{socket = Socket, req_refs = ReqRefs} = Transport,
+ ReqRef) ->
+ LengthReqRefs = length(ReqRefs),
+ ?vtrace("update_req_counter_outgoing() -> entry with~n"
+ " Limit: ~w~n"
+ " ReqRef: ~w~n"
+ " length(ReqRefs): ~w", [Limit, ReqRef, LengthReqRefs]),
+ NewReqRefs = lists:delete(ReqRef, ReqRefs),
+ (LengthReqRefs >= Limit) andalso (length(NewReqRefs) < Limit) andalso
+ begin
?vtrace("update_req_counter_outgoing -> "
- "passed below limit: activate", []),
- active_once(Sock),
- S#state{rcnt = NewRCnt};
- _ ->
- S
- end;
-update_req_counter_outgoing(#state{limit = Limit, rcnt = RCnt} = S,
- Rid) ->
- ?vtrace("handle_req_counter_outgoing(~w) -> entry with"
- "~n Rid: ~w"
- "~n length(RCnt): ~w", [Limit, Rid, length(RCnt)]),
- NewRCnt = lists:delete(Rid, RCnt),
- S#state{rcnt = NewRCnt}.
-
-
-maybe_handle_recv(#state{usock = Sock, filter = FilterMod} = S,
- Ip, Port, Packet) ->
- case (catch FilterMod:accept_recv(Ip, Port)) of
+ "passed below limit: activate", []),
+ active_once(Socket)
+ end,
+ update_transport_req_refs(S, Transport, NewReqRefs).
+
+update_transport_req_refs(
+ #state{transports = Transports} = S,
+ #transport{socket = Socket} = T,
+ ReqRefs) ->
+ S#state{
+ transports =
+ lists:keyreplace(
+ Socket, #transport.socket, Transports,
+ T#transport{req_refs = ReqRefs})}.
+
+
+maybe_handle_recv(
+ #state{filter = FilterMod} = S,
+ #transport{socket = Socket} = Transport,
+ From, Packet) ->
+ {From_1, From_2} = From,
+ case
+ try FilterMod:accept_recv(From_1, From_2)
+ catch
+ Class:Exception ->
+ error_msg(
+ "FilterMod:accept_recv(~p, ~p) crashed: ~w:~w~n ~p",
+ [From_1,From_2,Class,Exception,erlang:get_stacktrace()]),
+ true
+ end
+ of
false ->
%% Drop the received packet
inc(netIfMsgInDrops),
- active_once(Sock),
+ active_once(Socket),
S;
- _ ->
- handle_recv(S, Ip, Port, Packet)
+ Other ->
+ case Other of
+ true ->
+ ok;
+ _ ->
+ error_msg(
+ "FilterMod:accept_recv(~p, ~p) returned: ~p",
+ [From_1,From_2,Other])
+ end,
+ handle_recv(S, Transport, From, Packet)
end.
-handle_discovery_response(_Ip, _Port, #pdu{request_id = ReqId} = Pdu,
- ManagerEngineId,
- #state{usock = Sock, reqs = Reqs} = S) ->
- case lists:keysearch(ReqId, 1, S#state.reqs) of
- {value, {_, Pid}} ->
- active_once(Sock),
- Pid ! {snmp_discovery_response_received, Pdu, ManagerEngineId},
- NReqs = lists:keydelete(ReqId, 1, Reqs),
- S#state{reqs = NReqs};
- _ ->
- %% Ouch, timeout? resend?
- S
- end.
-
-handle_recv(#state{usock = Sock,
- mpd_state = MpdState,
- note_store = NS,
- log = Log} = S, Ip, Port, Packet) ->
- put(n1, erlang:now()),
- LogF = fun(Type, Data) ->
- log(Log, Type, Data, Ip, Port)
- end,
- Domain = snmp_conf:which_domain(Ip), % What the ****...
- case (catch snmpa_mpd:process_packet(Packet,
- Domain, {Ip, Port},
- MpdState, NS, LogF)) of
+handle_recv(
+ #state{mpd_state = MpdState, note_store = NS, log = Log} = S,
+ #transport{socket = Socket} = Transport,
+ From, Packet) ->
+ put(n1, erlang:monotonic_time(micro_seconds)),
+ LogF =
+ fun(Type, Data) ->
+ log(Log, Type, Data, From)
+ end,
+ case (catch snmpa_mpd:process_packet(
+ Packet, From, MpdState, NS, LogF)) of
{ok, _Vsn, Pdu, _PduMS, {discovery, ManagerEngineId}} ->
- handle_discovery_response(Ip, Port, Pdu, ManagerEngineId, S);
+ handle_discovery_response(
+ S, Transport, From, Pdu, ManagerEngineId);
{ok, _Vsn, Pdu, _PduMS, discovery} ->
- handle_discovery_response(Ip, Port, Pdu, undefined, S);
+ handle_discovery_response(
+ S, Transport, From, Pdu, undefined);
{ok, Vsn, Pdu, PduMS, ACMData} ->
?vlog("got pdu ~s",
[?vapply(snmp_misc, format, [256, "~w", [Pdu]])]),
- %% handle_recv_pdu(Ip, Port, Vsn, Pdu, PduMS, ACMData, S);
- maybe_handle_recv_pdu(Ip, Port, Vsn, Pdu, PduMS, ACMData, S);
+ %% handle_recv_pdu(S, Transport, From, Vsn, Pdu, PduMS, ACMData);
+ maybe_handle_recv_pdu(
+ S, Transport, From, Vsn, Pdu, PduMS, ACMData);
{discarded, Reason} ->
?vlog("packet discarded for reason: ~s",
[?vapply(snmp_misc, format, [256, "~w", [Reason]])]),
- active_once(Sock),
+ active_once(Socket),
S;
{discarded, Reason, ReportPacket} ->
?vlog("sending report for reason: "
"~n ~s",
[?vapply(snmp_misc, format, [256, "~w", [Reason]])]),
- (catch udp_send(S#state.usock, Ip, Port, ReportPacket)),
- active_once(Sock),
+ (catch udp_send(Socket, From, ReportPacket)),
+ active_once(Socket),
S;
{discovery, ReportPacket} ->
?vlog("sending discovery report", []),
- (catch udp_send(S#state.usock, Ip, Port, ReportPacket)),
- active_once(Sock),
+ (catch udp_send(Socket, From, ReportPacket)),
+ active_once(Socket),
S;
Error ->
error_msg("processing of received message failed: "
"~n ~p", [Error]),
- active_once(Sock),
+ active_once(Socket),
S
end.
-
-maybe_handle_recv_pdu(Ip, Port, Vsn, #pdu{type = Type} = Pdu, PduMS, ACMData,
- #state{usock = Sock, filter = FilterMod} = S) ->
- case (catch FilterMod:accept_recv_pdu(Ip, Port, Type)) of
+
+handle_discovery_response(
+ #state{reqs = Reqs} = S,
+ #transport{socket = Socket},
+ _From,
+ #pdu{request_id = ReqId} = Pdu,
+ ManagerEngineId) ->
+ case lists:keyfind(ReqId, 1, S#state.reqs) of
+ {ReqId, Pid} ->
+ active_once(Socket),
+ Pid ! {snmp_discovery_response_received, Pdu, ManagerEngineId},
+ %% XXX Strange... Reqs from this Pid should be reaped
+ %% at process exit by clear_reqs/2 so the following
+ %% should be redundant.
+ NReqs = lists:keydelete(ReqId, 1, Reqs),
+ S#state{reqs = NReqs};
+ false ->
+ %% Ouch, timeout? resend?
+ S
+ end.
+
+maybe_handle_recv_pdu(
+ #state{filter = FilterMod} = S,
+ #transport{socket = Socket} = Transport,
+ From, Vsn,
+ #pdu{type = Type} = Pdu, PduMS, ACMData) ->
+ {From_1, From_2} = From,
+ case
+ try FilterMod:accept_recv_pdu(From_1, From_2, Type)
+ catch
+ Class:Exception ->
+ error_msg(
+ "FilterMod:accept_recv_pdu(~p, ~p, ~p) crashed: ~w:~w~n"
+ " ~p",
+ [From_1,From_2,Type,Class,Exception,
+ erlang:get_stacktrace()]),
+ true
+ end
+ of
false ->
inc(netIfPduInDrops),
- active_once(Sock),
- ok;
- _ ->
- handle_recv_pdu(Ip, Port, Vsn, Pdu, PduMS, ACMData, S)
- end;
-maybe_handle_recv_pdu(Ip, Port, Vsn, Pdu, PduMS, ACMData, S) ->
- handle_recv_pdu(Ip, Port, Vsn, Pdu, PduMS, ACMData, S).
+ active_once(Socket),
+ S;
+ Other ->
+ case Other of
+ true ->
+ ok;
+ _ ->
+ error_msg(
+ "FilterMod:accept_recv_pdu(~p, ~p, ~p) returned: ~p",
+ [From_1,From_2,Type,Other])
+ end,
+ handle_recv_pdu(S, Transport, From, Vsn, Pdu, PduMS, ACMData)
+ end.
-handle_recv_pdu(Ip, Port, Vsn, #pdu{type = 'get-response'} = Pdu,
- _PduMS, _ACMData, #state{usock = Sock} = S) ->
- active_once(Sock),
- handle_response(Vsn, Pdu, {Ip, Port}, S),
+handle_recv_pdu(
+ #state{reqs = Reqs} = S,
+ #transport{socket = Socket},
+ From, Vsn,
+ #pdu{type = 'get-response', request_id = ReqId} = Pdu,
+ _PduMS, _ACMData) ->
+ active_once(Socket),
+ case lists:keyfind(ReqId, 1, Reqs) of
+ {ReqId, Pid} ->
+ ?vdebug("handle_recv_pdu -> "
+ "~n send response to receiver ~p", [Pid]),
+ Pid ! {snmp_response_received, Vsn, Pdu, From};
+ false ->
+ ?vdebug("handle_recv_pdu -> "
+ "~n No receiver available for response pdu", [])
+ end,
S;
-handle_recv_pdu(Ip, Port, Vsn, #pdu{request_id = Rid, type = Type} = Pdu,
- PduMS, ACMData, #state{master_agent = Pid} = S)
- when ((Type =:= 'get-request') orelse
- (Type =:= 'get-next-request') orelse
- (Type =:= 'get-bulk-request')) ->
- ?vtrace("handle_recv_pdu -> received get (~w)", [Type]),
- Pid ! {snmp_pdu, Vsn, Pdu, PduMS, ACMData, {Ip, Port}, []},
- update_req_counter_incomming(S, Rid);
-handle_recv_pdu(Ip, Port, Vsn, Pdu, PduMS, ACMData,
- #state{usock = Sock, master_agent = Pid} = S) ->
+handle_recv_pdu(
+ #state{master_agent = Pid} = S,
+ #transport{} = Transport,
+ From, Vsn,
+ #pdu{type = Type} = Pdu,
+ PduMS, ACMData)
+ when Type =:= 'set-request';
+ Type =:= 'get-request';
+ Type =:= 'get-next-request';
+ Type =:= 'get-bulk-request' ->
+ ?vtrace("handle_recv_pdu -> received request (~w)", [Type]),
+ ReqRef = make_ref(),
+ Extra = [{request_ref, ReqRef}],
+ Pid ! {snmp_pdu, Vsn, Pdu, PduMS, ACMData, From, Extra},
+ NewS = update_req_counter_incoming(S, Transport, ReqRef),
+ ?vdebug("handle_recv_pdu -> ~p", [NewS]),
+ NewS;
+handle_recv_pdu(
+ #state{master_agent = Pid} = S,
+ #transport{socket = Socket},
+ From, Vsn, Pdu, PduMS, ACMData) ->
?vtrace("handle_recv_pdu -> received other request", []),
- active_once(Sock),
- Pid ! {snmp_pdu, Vsn, Pdu, PduMS, ACMData, {Ip, Port}, []},
+ active_once(Socket),
+ Pid ! {snmp_pdu, Vsn, Pdu, PduMS, ACMData, From, []},
S.
-maybe_handle_reply_pdu(#state{filter = FilterMod} = S, Vsn,
- #pdu{request_id = Rid} = Pdu,
- Type, ACMData, {Ip, Port} = Dest) ->
- S1 = update_req_counter_outgoing(S, Rid),
- case (catch FilterMod:accept_send_pdu([{Ip, Port}], Type)) of
+maybe_handle_reply_pdu(
+ #state{filter = FilterMod, transports = Transports} = S,
+ #transport{} = Transport,
+ Vsn,
+ #pdu{} = Pdu,
+ Type, ACMData, To) ->
+ %%
+ Addresses = [fix_filter_address(Transports, To)],
+ case
+ try
+ FilterMod:accept_send_pdu(Addresses, Type)
+ catch
+ Class:Exception ->
+ error_msg(
+ "FilterMod:accept_send_pdu(~p, ~p) crashed: ~w:~w~n ~p",
+ [Addresses, Type, Class, Exception,
+ erlang:get_stacktrace()]),
+ true
+ end
+ of
false ->
inc(netIfPduOutDrops),
ok;
- _ ->
- handle_reply_pdu(S1, Vsn, Pdu, Type, ACMData, Dest)
- end,
- S1.
-
-handle_reply_pdu(#state{log = Log,
- usock = Sock,
- filter = FilterMod},
- Vsn, Pdu, Type, ACMData, {Ip, Port}) ->
- LogF = fun(Type2, Data) ->
- log(Log, Type2, Data, Ip, Port)
- end,
+ Other ->
+ case Other of
+ true ->
+ ok;
+ _ ->
+ error_msg(
+ "FilterMod:accept_send_pdu(~p, ~p) returned: ~p",
+ [Addresses,Type,Other])
+ end,
+ handle_reply_pdu(S, Transport, Vsn, Pdu, Type, ACMData, To)
+ end.
+
+handle_reply_pdu(
+ #state{log = Log} = S,
+ #transport{} = Transport,
+ Vsn,
+ #pdu{} = Pdu,
+ Type, ACMData, To) ->
+ %%
+ LogF =
+ fun(Type2, Data) ->
+ log(Log, Type2, Data, To)
+ end,
case (catch snmpa_mpd:generate_response_msg(Vsn, Pdu, Type,
ACMData, LogF)) of
{ok, Packet} ->
?vinfo("time in agent: ~w mysec", [time_in_agent()]),
- maybe_udp_send(FilterMod, Sock, Ip, Port, Packet);
+ try maybe_udp_send(S, Transport, To, Packet)
+ catch
+ {Reason, Sz} ->
+ error_msg("Cannot send message "
+ "~n size: ~p"
+ "~n reason: ~p"
+ "~n pdu: ~p",
+ [Sz, Reason, Pdu])
+ end;
{discarded, Reason} ->
?vlog("handle_reply_pdu -> "
"~n reply discarded for reason: ~s",
@@ -652,105 +888,116 @@ handle_reply_pdu(#state{log = Log,
ok;
{'EXIT', Reason} ->
user_err("failed generating response message: "
- "~nPDU: ~w~n~w", [Pdu, Reason])
+ "~nPDU: ~p~n~p", [Pdu, Reason])
end.
-
-
-process_taddrs(To) ->
- process_taddrs(To, []).
-
-process_taddrs([], Acc) ->
- lists:reverse(Acc);
-%% v3
-process_taddrs([{{_Domain, AddrAndPort}, _SecData}|T], Acc) ->
- process_taddrs(T, [AddrAndPort|Acc]);
-%% v1 & v2
-process_taddrs([{_Domain, AddrAndPort}|T], Acc) ->
- process_taddrs(T, [AddrAndPort|Acc]).
-merge_taddrs(To1, To2) ->
- merge_taddrs(To1, To2, []).
-
-merge_taddrs([], _To2, Acc) ->
- lists:reverse(Acc);
-%% v3
-merge_taddrs([{{_, AddrAndPort}, _} = H|To1], To2, Acc) ->
- case lists:member(AddrAndPort, To2) of
- true ->
- merge_taddrs(To1, To2, [H|Acc]);
- false ->
- merge_taddrs(To1, To2, Acc)
- end;
-%% v1 & v2
-merge_taddrs([{_, AddrAndPort} = H|To1], To2, Acc) ->
- case lists:member(AddrAndPort, To2) of
- true ->
- merge_taddrs(To1, To2, [H|Acc]);
- false ->
- merge_taddrs(To1, To2, Acc)
- end;
-merge_taddrs([_Crap|To1], To2, Acc) ->
- merge_taddrs(To1, To2, Acc).
-maybe_handle_send_pdu(#state{filter = FilterMod} = S,
- Vsn, Pdu, MsgData, To0, From) ->
+maybe_handle_send_pdu(
+ #state{filter = FilterMod, transports = Transports} = S,
+ Vsn, Pdu, MsgData, TDomAddrSecs, From) ->
- ?vtrace("maybe_handle_send_pdu -> entry with"
- "~n FilterMod: ~p"
- "~n To0: ~p", [FilterMod, To0]),
+ ?vtrace("maybe_handle_send_pdu -> entry with~n"
+ " FilterMod: ~p~n"
+ " TDomAddrSecs: ~p", [FilterMod, TDomAddrSecs]),
- To1 = snmpa_mpd:process_taddrs(To0),
- To2 = process_taddrs(To1),
+ DomAddrSecs = snmpa_mpd:process_taddrs(TDomAddrSecs),
+ AddressesToFilter =
+ case is_legacy_transports(Transports) of
+ true ->
+ [fix_filter_legacy_mpd_address(DAS)
+ || DAS <- DomAddrSecs];
+ false ->
+ [fix_filter_mpd_address(DAS)
+ || DAS <- DomAddrSecs]
+ end,
- case (catch FilterMod:accept_send_pdu(To2, pdu_type_of(Pdu))) of
+ Type = pdu_type_of(Pdu),
+
+ case
+ try FilterMod:accept_send_pdu(AddressesToFilter, Type)
+ catch
+ Class:Exception ->
+ error_msg(
+ "FilterMod:accept_send_pdu(~p, ~p) crashed: ~w:~w~n ~p",
+ [AddressesToFilter,Type,
+ Class,Exception,erlang:get_stacktrace()]),
+ true
+ end
+ of
false ->
inc(netIfPduOutDrops),
ok;
true ->
- handle_send_pdu(S, Vsn, Pdu, MsgData, To1, From);
- To3 when is_list(To3) ->
- To4 = merge_taddrs(To1, To3),
- ?vtrace("maybe_handle_send_pdu -> To4: "
- "~n ~p", [To4]),
- handle_send_pdu(S, Vsn, Pdu, MsgData, To4, From);
- _ ->
- handle_send_pdu(S, Vsn, Pdu, MsgData, To1, From)
+ handle_send_pdu(S, Vsn, Pdu, MsgData, DomAddrSecs, From);
+ FilteredAddresses when is_list(FilteredAddresses) ->
+ FilteredDomAddrSecs =
+ case is_legacy_transports(Transports) of
+ true ->
+ [DAS ||
+ DAS <- DomAddrSecs,
+ lists:member(
+ fix_filter_legacy_mpd_address(DAS),
+ FilteredAddresses)];
+ false ->
+ [DAS ||
+ DAS <- DomAddrSecs,
+ lists:member(
+ fix_filter_mpd_address(DAS),
+ FilteredAddresses)]
+ end,
+ ?vtrace("maybe_handle_send_pdu -> FilteredDomAddrSecs:~n"
+ " ~p", [FilteredDomAddrSecs]),
+ handle_send_pdu(S, Vsn, Pdu, MsgData, FilteredDomAddrSecs, From);
+ Other ->
+ error_msg(
+ "FilterMod:accept_send_pdu(~p, ~p) returned: ~p",
+ [AddressesToFilter,Type,Other]),
+ handle_send_pdu(S, Vsn, Pdu, MsgData, DomAddrSecs, From)
end.
-handle_send_pdu(#state{note_store = NS} = S, Vsn, Pdu, MsgData, To, From) ->
-
- ?vtrace("handle_send_pdu -> entry with"
- "~n Pdu: ~p"
- "~n To: ~p", [Pdu, To]),
+handle_send_pdu(
+ #state{note_store = NS} = S,
+ Vsn, Pdu, MsgData, DomAddrSecs, From) ->
+ %%
+ ?vtrace("handle_send_pdu -> entry with~n"
+ " Pdu: ~p~n"
+ " DomAddrSecs: ~p", [Pdu, DomAddrSecs]),
- case (catch snmpa_mpd:generate_msg(Vsn, NS, Pdu, MsgData, To)) of
+ case (catch snmpa_mpd:generate_msg(
+ Vsn, NS, Pdu, MsgData, DomAddrSecs)) of
{ok, Addresses} ->
- handle_send_pdu(S, Pdu, Addresses);
+ do_handle_send_pdu(S, Pdu, Addresses);
{discarded, Reason} ->
?vlog("handle_send_pdu -> "
"~n PDU ~p not sent due to ~p", [Pdu, Reason]),
ok;
{'EXIT', Reason} ->
user_err("failed generating message: "
- "~nPDU: ~w~n~w", [Pdu, Reason]),
+ "~nPDU: ~p~n~p", [Pdu, Reason]),
ok
end,
case From of
undefined ->
S;
- Pid ->
+ Pid when is_pid(Pid) ->
?vtrace("link to ~p and add to request list", [Pid]),
link(Pid),
- NReqs = snmp_misc:keyreplaceadd(Pid, 2, S#state.reqs,
- {Pdu#pdu.request_id, From}),
+ NReqs =
+ snmp_misc:keyreplaceadd(
+ Pid, 2, S#state.reqs, {Pdu#pdu.request_id, From}),
S#state{reqs = NReqs}
end.
-handle_send_discovery(#state{note_store = NS} = S,
- Pdu, MsgData,
- To, From) ->
+handle_send_discovery(
+ #state{
+ note_store = NS,
+ log = Log,
+ reqs = Reqs,
+ transports = Transports} = S,
+ #pdu{type = Type, request_id = ReqId} = Pdu,
+ MsgData, To, From) when is_pid(From) ->
?vtrace("handle_send_discovery -> entry with"
"~n Pdu: ~p"
@@ -759,155 +1006,173 @@ handle_send_discovery(#state{note_store = NS} = S,
"~n From: ~p", [Pdu, MsgData, To, From]),
case (catch snmpa_mpd:generate_discovery_msg(NS, Pdu, MsgData, To)) of
- {ok, {Packet, {Ip, Port}}} ->
- handle_send_discovery(S, Pdu, Packet, Ip, Port, From);
+ {ok, {Domain, Address, Packet}} ->
+ case select_transport_from_domain(Domain, Transports) of
+ false ->
+ error_msg(
+ "Can not find transport to: ~s",
+ [format_address(To)]),
+ S;
+ #transport{socket = Socket} ->
+ log(Log, Type, Packet, {Domain, Address}),
+ udp_send(Socket, {Domain, Address}, Packet),
+ ?vtrace("handle_send_discovery -> sent (~w)", [ReqId]),
+ NReqs = snmp_misc:keyreplaceadd(From, 2, Reqs, {ReqId, From}),
+ S#state{reqs = NReqs}
+ end;
{discarded, Reason} ->
?vlog("handle_send_discovery -> "
"~n Discovery PDU ~p not sent due to ~p", [Pdu, Reason]),
- ok;
+ S;
{'EXIT', Reason} ->
user_err("failed generating discovery message: "
- "~n PDU: ~w"
- "~n Reason: ~w", [Pdu, Reason]),
- ok
+ "~n PDU: ~p"
+ "~n Reason: ~p", [Pdu, Reason]),
+ S
end.
-handle_send_discovery(#state{log = Log,
- usock = Sock,
- reqs = Reqs} = S,
- #pdu{type = Type,
- request_id = ReqId},
- Packet, Ip, Port, From)
- when is_binary(Packet) ->
- log(Log, Type, Packet, Ip, Port),
- udp_send(Sock, Ip, Port, Packet),
- ?vtrace("handle_send_discovery -> sent (~w)", [ReqId]),
- NReqs = snmp_misc:keyreplaceadd(From, 2, Reqs, {ReqId, From}),
- S#state{reqs = NReqs}.
-
-handle_send_pdu(S, #pdu{type = Type} = Pdu, Addresses) ->
- handle_send_pdu(S, Type, Pdu, Addresses);
-handle_send_pdu(S, Trap, Addresses) ->
- handle_send_pdu(S, trappdu, Trap, Addresses).
+do_handle_send_pdu(S, #pdu{type = Type} = Pdu, Addresses) ->
+ do_handle_send_pdu(S, Type, Pdu, Addresses);
+do_handle_send_pdu(S, Trap, Addresses) ->
+ do_handle_send_pdu(S, trappdu, Trap, Addresses).
-handle_send_pdu(S, Type, Pdu, Addresses) ->
- case (catch handle_send_pdu1(S, Type, Addresses)) of
+do_handle_send_pdu(S, Type, Pdu, Addresses) ->
+ try do_handle_send_pdu1(S, Type, Addresses)
+ catch
{Reason, Sz} ->
- error_msg("Cannot send message "
- "~n size: ~p"
- "~n reason: ~p"
- "~n pdu: ~p",
- [Sz, Reason, Pdu]);
- _ ->
- ok
- end.
-
-handle_send_pdu1(#state{log = Log,
- usock = Sock,
- filter = FilterMod}, Type, Addresses) ->
- SendFun =
- fun({snmpUDPDomain, {Ip, Port}, Packet})
- when is_binary(Packet) ->
- ?vdebug("[snmpUDPDomain] sending packet:"
- "~n size: ~p"
- "~n to: ~p:~p",
- [sz(Packet), Ip, Port]),
- maybe_udp_send(FilterMod, Log, Type, Sock, Ip, Port, Packet);
-
- ({snmpUDPDomain, {Ip, Port}, {Packet, _LogData}})
- when is_binary(Packet) ->
- ?vdebug("[snmpUDPDomain] sending encrypted packet:"
- "~n size: ~p"
- "~n to: ~p:~p",
- [sz(Packet), Ip, Port]),
- maybe_udp_send(FilterMod, Log, Type, Sock, Ip, Port, Packet);
-
- ({transportDomainUdpIpv4, {Ip, Port}, Packet})
- when is_binary(Packet) ->
- ?vdebug("[transportDomainUdpIpv4] sending packet:"
- "~n size: ~p"
- "~n to: ~p:~p",
- [sz(Packet), Ip, Port]),
- maybe_udp_send(FilterMod, Log, Type, Sock, Ip, Port, Packet);
-
- ({transportDomainUdpIpv4, {Ip, Port}, {Packet, _LogData}})
- when is_binary(Packet) ->
- ?vdebug("[transportDomainUdpIpv4] sending encrypted packet:"
- "~n size: ~p"
- "~n to: ~p:~p",
- [sz(Packet), Ip, Port]),
- maybe_udp_send(FilterMod, Log, Type, Sock, Ip, Port, Packet);
-
- ({transportDomainUdpIpv6, {Ip, Port}, Packet})
- when is_binary(Packet) ->
- ?vdebug("[transportDomainUdpIpv6] sending packet:"
- "~n size: ~p"
- "~n to: ~p:~p",
- [sz(Packet), Ip, Port]),
- maybe_udp_send(FilterMod, Log, Type, Sock, Ip, Port, Packet);
-
- ({transportDomainUdpIpv6, {Ip, Port}, {Packet, _LogData}})
- when is_binary(Packet) ->
- ?vdebug("[transportDomainUdpIpv6] sending encrypted packet:"
- "~n size: ~p"
- "~n to: ~p:~p",
- [sz(Packet), Ip, Port]),
- maybe_udp_send(FilterMod, Log, Type, Sock, Ip, Port, Packet);
-
- (_X) ->
- ?vlog("** bad res: ~p", [_X]),
- ok
- end,
- lists:foreach(SendFun, Addresses).
-
-
-handle_response(Vsn, Pdu, From, S) ->
- case lists:keysearch(Pdu#pdu.request_id, 1, S#state.reqs) of
- {value, {_, Pid}} ->
- ?vdebug("handle_response -> "
- "~n send response to receiver ~p", [Pid]),
- Pid ! {snmp_response_received, Vsn, Pdu, From};
- _ ->
- ?vdebug("handle_response -> "
- "~n No receiver available for response pdu", [])
+ error_msg(
+ "Can not send message~n"
+ " size: ~p~n"
+ " reason: ~p~n"
+ " pdu: ~p",
+ [Sz, Reason, Pdu])
end.
-maybe_udp_send(FilterMod, Sock, Ip, Port, Packet) ->
- case (catch FilterMod:accept_send(Ip, Port)) of
+do_handle_send_pdu1(
+ #state{transports = Transports} = S,
+ Type, Addresses) ->
+ lists:foreach(
+ fun ({Domain, Address, Packet}) when is_binary(Packet) ->
+ ?vdebug(
+ "[~w] sending packet:~n"
+ " size: ~p~n"
+ " to: ~p", [Domain, sz(Packet), Address]),
+ To = {Domain, Address},
+ case select_transport_from_domain(Domain, Transports) of
+ false ->
+ error_msg(
+ "Can not find transport~n"
+ " size: ~p~n"
+ " to: ~s",
+ [sz(Packet), format_address(To)]);
+ Transport ->
+ maybe_udp_send(S, Transport, To, Packet)
+ end;
+ ({Domain, Address, {Packet, LogData}}) when is_binary(Packet) ->
+ ?vdebug(
+ "[~w] sending encrypted packet:~n"
+ " size: ~p~n"
+ " to: ~p", [Domain, sz(Packet), Address]),
+ To = {Domain, Address},
+ case select_transport_from_domain(Domain, Transports) of
+ false ->
+ error_msg(
+ "Can not find transport~n"
+ " size: ~p~n"
+ " to: ~s",
+ [sz(Packet), format_address(To)]);
+ Transport ->
+ maybe_udp_send(S, Transport, To, Packet, Type, LogData)
+ end
+ end,
+ Addresses).
+
+maybe_udp_send(
+ #state{filter = FilterMod, transports = Transports},
+ #transport{socket = Socket},
+ To, Packet) ->
+ {To_1, To_2} = fix_filter_address(Transports, To),
+ case
+ try FilterMod:accept_send(To_1, To_2)
+ catch
+ Class:Exception ->
+ error_msg(
+ "FilterMod:accept_send(~p, ~p) crashed: ~w:~w~n ~p",
+ [To_1,To_2,Class,Exception,erlang:get_stacktrace()]),
+ true
+ end
+ of
false ->
inc(netIfMsgOutDrops),
ok;
- _ ->
- (catch udp_send(Sock, Ip, Port, Packet))
+ Other ->
+ case Other of
+ true ->
+ ok;
+ _ ->
+ error_msg(
+ "FilterMod:accept_send(~p, ~p) returned: ~p",
+ [To_1,To_2,Other])
+ end,
+ udp_send(Socket, To, Packet)
end.
-maybe_udp_send(FilterMod, AtLog, Type, Sock, Ip, Port, Packet) ->
- case (catch FilterMod:accept_send(Ip, Port)) of
+maybe_udp_send(
+ #state{log = Log, filter = FilterMod, transports = Transports},
+ #transport{socket = Socket},
+ To, Packet, Type, _LogData) ->
+ {To_1, To_2} = fix_filter_address(Transports, To),
+ case
+ try FilterMod:accept_send(To_1, To_2)
+ catch
+ Class:Exception ->
+ error_msg(
+ "FilterMod:accept_send(~p, ~p) crashed for: ~w:~w~n ~p",
+ [To_1, To_2, Class, Exception, erlang:get_stacktrace()]),
+ true
+ end
+ of
false ->
inc(netIfMsgOutDrops),
ok;
- _ ->
- log(AtLog, Type, Packet, Ip, Port),
- (catch udp_send(Sock, Ip, Port, Packet))
+ Other ->
+ case Other of
+ true ->
+ ok;
+ _ ->
+ error_msg(
+ "FilterMod:accept_send(~p, ~p) returned: ~p",
+ [To_1,To_2,Other])
+ end,
+ log(Log, Type, Packet, To),
+ udp_send(Socket, To, Packet)
end.
-
-udp_send(UdpId, AgentIp, UdpPort, B) ->
- case (catch gen_udp:send(UdpId, AgentIp, UdpPort, B)) of
+udp_send(Socket, To, B) ->
+ {IpAddr, IpPort} =
+ case To of
+ {Domain, Addr} when is_atom(Domain) ->
+ Addr;
+ {_, P} = Addr when is_integer(P) ->
+ Addr
+ end,
+ try gen_udp:send(Socket, IpAddr, IpPort, B) of
{error, emsgsize} ->
%% From this message we cannot recover, so exit sending loop
throw({emsgsize, sz(B)});
{error, ErrorReason} ->
error_msg("[error] cannot send message "
"(destination: ~p:~p, size: ~p, reason: ~p)",
- [AgentIp, UdpPort, sz(B), ErrorReason]);
- {'EXIT', ExitReason} ->
- error_msg("[exit] cannot send message "
- "(destination: ~p:~p, size: ~p, reason: ~p)",
- [AgentIp, UdpPort, sz(B), ExitReason]);
- _ ->
+ [IpAddr, IpPort, sz(B), ErrorReason]);
+ ok ->
ok
+ catch
+ error:ExitReason ->
+ error_msg("[exit] cannot send message "
+ "(destination: ~p:~p, size: ~p, reason: ~p, at: ~p)",
+ [IpAddr, IpPort, sz(B), ExitReason,
+ erlang:get_stacktrace()])
end.
sz(L) when is_list(L) -> length(L);
@@ -957,6 +1222,75 @@ active_once(Sock) ->
inet:setopts(Sock, [{active, once}]).
+select_transport_from_req_ref(_, []) ->
+ false;
+select_transport_from_req_ref(
+ ReqRef,
+ [#transport{req_refs = ReqRefs} = Transport | Transports]) ->
+ case lists:member(ReqRef, ReqRefs) of
+ true ->
+ Transport;
+ false ->
+ select_transport_from_req_ref(ReqRef, Transports)
+ end.
+
+select_transport_from_domain(Domain, Transports) when is_atom(Domain) ->
+ Pos = #transport.domain,
+ case lists:keyfind(Domain, Pos, Transports) of
+ #transport{domain = Domain} = Transport ->
+ Transport;
+ false when Domain == snmpUDPDomain ->
+ lists:keyfind(transportDomainUdpIpv4, Pos, Transports);
+ false when Domain == transportDomainUdpIpv4 ->
+ lists:keyfind(snmpUDPDomain, Pos, Transports);
+ false ->
+ false
+ end.
+
+address_to_domain({Domain, _Addr}) when is_atom(Domain) ->
+ Domain;
+address_to_domain({_Ip, Port}) when is_integer(Port) ->
+ snmpUDPDomain.
+
+%% If the agent uses legacy snmpUDPDomain e.g has not set
+%% intAgentTransportDomain, then make sure
+%% snmpa_network_interface_filter gets legacy arguments
+%% to not break backwards compatibility.
+%%
+fix_filter_address(Transports, Address) ->
+ case is_legacy_transports(Transports) of
+ true ->
+ case Address of
+ {Domain, Addr} when is_atom(Domain) ->
+ Addr;
+ {_, IpPort} = Addr when is_integer(IpPort) ->
+ Addr
+ end;
+ false ->
+ Address
+ end.
+
+is_legacy_transports([#transport{domain = snmpUDPDomain}]) ->
+ true;
+is_legacy_transports([#transport{} | _]) ->
+ false.
+
+fix_filter_legacy_mpd_address(Domain_Address_SecData) ->
+ case Domain_Address_SecData of
+ {{Domain, Addr}, _SecData} when is_atom(Domain) -> % v3
+ Addr;
+ {Domain, Addr} when is_atom(Domain) -> % v1 & v2
+ Addr
+ end.
+
+fix_filter_mpd_address(Domain_Address_SecData) ->
+ case Domain_Address_SecData of
+ {{Domain, _Addr} = Address, _SecData} when is_atom(Domain) -> % v3
+ Address;
+ {Domain, _Addr} = Address when is_atom(Domain) -> % v1 & v2
+ Address
+ end.
+
%%%-----------------------------------------------------------------
handle_set_log_type(#state{log = {Log, OldValue}} = State, NewType)
@@ -1046,15 +1380,7 @@ do_close_log(_) ->
%%% DEBUG FUNCTIONS
%%%-----------------------------------------------------------------
time_in_agent() ->
- subtr(erlang:now(), get(n1)).
-
-subtr({X1,Y1,Z1}, {X1,Y1,Z2}) ->
- Z1 - Z2;
-subtr({X1,Y1,Z1}, {X1,Y2,Z2}) ->
- ((Y1-Y2) * 1000000) + (Z1 - Z2);
-subtr({X1,Y1,Z1}, {X2,Y2,Z2}) ->
- ((X1 - X2) * 1000000000000) + ((Y1 - Y2) * 1000000) + (Z1 - Z2).
-
+ erlang:monotonic_time(micro_seconds) - get(n1).
%% ----------------------------------------------------------------
@@ -1113,37 +1439,39 @@ get_counters([Counter|Counters], Acc) ->
%% ----------------------------------------------------------------
-ip_opt_bind_to_ip_address(Opts, Ip) ->
- case get_bind_to_ip_address(Opts) of
- true ->
- [{ip, list_to_tuple(Ip)}];
- _ ->
- []
- end.
-
-ip_opt_no_reuse_address(Opts) ->
- case get_no_reuse_address(Opts) of
- false ->
- [{reuseaddr, true}];
- _ ->
- []
- end.
-
-ip_opt_recbuf(Opts) ->
- case get_recbuf(Opts) of
- use_default ->
- [];
- Sz ->
- [{recbuf, Sz}]
- end.
-
-ip_opt_sndbuf(Opts) ->
- case get_sndbuf(Opts) of
- use_default ->
- [];
- Sz ->
- [{sndbuf, Sz}]
- end.
+socket_opts(Domain, {IpAddr, IpPort}, Opts) ->
+ [IpPort, % Picked off at socket open, separate argument
+ binary
+ | case snmp_conf:tdomain_to_family(Domain) of
+ inet6 = Family ->
+ [Family, {ipv6_v6only, true}];
+ Family ->
+ [Family]
+ end ++
+ case get_bind_to_ip_address(Opts) of
+ true ->
+ [{ip, IpAddr}];
+ _ ->
+ []
+ end ++
+ case get_no_reuse_address(Opts) of
+ false ->
+ [{reuseaddr, true}];
+ _ ->
+ []
+ end ++
+ case get_recbuf(Opts) of
+ use_default ->
+ [];
+ Sz ->
+ [{recbuf, Sz}]
+ end ++
+ case get_sndbuf(Opts) of
+ use_default ->
+ [];
+ Sz ->
+ [{sndbuf, Sz}]
+ end].
%% ----------------------------------------------------------------
@@ -1203,6 +1531,9 @@ get_bind_to_ip_address(Opts) ->
error_msg(F,A) ->
?snmpa_error("NET-IF server: " ++ F, A).
+info_msg(F,A) ->
+ ?snmpa_info("NET-IF server: " ++ F, A).
+
%% ---
user_err(F, A) ->
@@ -1227,14 +1558,14 @@ call(Pid, Req) ->
%% ----------------------------------------------------------------
-get_info(#state{usock = Id, reqs = Reqs}) ->
+get_info(#state{transports = Transports, reqs = Reqs}) ->
ProcSize = proc_mem(self()),
- PortInfo = get_port_info(Id),
Counters = get_counters(),
- [{reqs, Reqs},
- {counters, Counters},
- {process_memory, ProcSize},
- {port_info, PortInfo}].
+ [{reqs, Reqs},
+ {counters, Counters},
+ {process_memory, ProcSize}
+ | [{port_info, get_port_info(Socket)}
+ || #transport{socket = Socket} <- Transports]].
proc_mem(P) when is_pid(P) ->
case (catch erlang:process_info(P, memory)) of
@@ -1299,10 +1630,3 @@ get_port_info(Id) ->
%% ----------------------------------------------------------------
-
-% i(F) ->
-% i(F, []).
-
-% i(F, A) ->
-% io:format("~p: " ++ F ++ "~n", [?MODULE|A]).
-
diff --git a/lib/snmp/src/agent/snmpa_net_if_filter.erl b/lib/snmp/src/agent/snmpa_net_if_filter.erl
index 989f7c95b3..1db8609eaf 100644
--- a/lib/snmp/src/agent/snmpa_net_if_filter.erl
+++ b/lib/snmp/src/agent/snmpa_net_if_filter.erl
@@ -1,52 +1,67 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
-module(snmpa_net_if_filter).
--export([accept_recv/2,
- accept_send/2,
- accept_recv_pdu/3,
- accept_send_pdu/2]).
+%% Behaviour
+-export([accept_recv/2, accept_send/2, accept_recv_pdu/3, accept_send_pdu/2]).
-include("snmp_debug.hrl").
-accept_recv(_Addr, _Port) ->
- ?d("accept_recv -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p", [_Addr, _Port]),
+accept_recv(Domain, _Address) when is_atom(Domain) ->
+ ?d("accept_recv -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p", [Domain, _Address]),
+ true;
+accept_recv(_Addr, Port) when is_integer(Port) ->
+ ?d("accept_recv -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p", [_Addr, Port]),
true.
-accept_send(_Addr, _Port) ->
- ?d("accept_send -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p", [_Addr, _Port]),
+accept_send(Domain, _Address) when is_atom(Domain) ->
+ ?d("accept_send -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p", [Domain, _Address]),
+ true;
+accept_send(_Addr, Port) when is_integer(Port) ->
+ ?d("accept_send -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p", [_Addr, Port]),
true.
-accept_recv_pdu(_Addr, _Port, _PduType) ->
- ?d("accept_recv_pdu -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n PduType: ~p", [_Addr, _Port, _PduType]),
+accept_recv_pdu(Domain, _Address, _PduType) when is_atom(Domain) ->
+ ?d("accept_recv -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p~n"
+ " PduType: ~p", [Domain, _Address, _PduType]),
+ true;
+accept_recv_pdu(_Addr, Port, _PduType) when is_integer(Port) ->
+ ?d("accept_recv_pdu -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p~n"
+ " PduType: ~p", [_Addr, Port, _PduType]),
true.
accept_send_pdu(_Targets, _PduType) ->
- ?d("accept_send_pdu -> entry with"
- "~n Targets: ~p"
- "~n PduType: ~p", [_Targets, _PduType]),
+ ?d("accept_send_pdu -> entry with~n"
+ " Targets: ~p~n"
+ " PduType: ~p", [_Targets, _PduType]),
true.
diff --git a/lib/snmp/src/agent/snmpa_network_interface.erl b/lib/snmp/src/agent/snmpa_network_interface.erl
index 887ea22549..699fbde671 100644
--- a/lib/snmp/src/agent/snmpa_network_interface.erl
+++ b/lib/snmp/src/agent/snmpa_network_interface.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_network_interface_filter.erl b/lib/snmp/src/agent/snmpa_network_interface_filter.erl
index 6fa131beee..1524a6447b 100644
--- a/lib/snmp/src/agent/snmpa_network_interface_filter.erl
+++ b/lib/snmp/src/agent/snmpa_network_interface_filter.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -23,7 +24,7 @@
behaviour_info(callbacks) ->
- [{accept_recv, 2},
+ [{accept_recv, 2},
{accept_send, 2},
{accept_recv_pdu, 3},
{accept_send_pdu, 2}];
@@ -31,20 +32,21 @@ behaviour_info(_) ->
undefined.
-%% accept_recv(address(), port()) -> boolean()
+%% accept_recv({domain(), address()}) -> boolean()
%% Called at the receiption of a message
%% (before *any* processing has been done).
%%
-%% accept_send(address(), port()) -> boolean()
+%% accept_send({domain(), address()}) -> boolean()
%% Called before the sending of a message
%% (after *all* processing has been done).
%%
-%% accept_recv_pdu(Addr, Port, pdu_type()) -> boolean()
+%% accept_recv_pdu({domain(), address()}, pdu_type()) -> boolean()
%% Called after the basic message processing (MPD) has been done,
%% but before the pdu is handed over to the master-agent for
%% primary processing.
%%
-%% accept_send_pdu(Targets, pdu_type()) -> boolean() | NewTargets
+%% accept_send_pdu([{domain(), address()}, ...] = Targets, pdu_type()) ->
+%% boolean() | NewTargets
%% Called before the basic message processing (MPD) is done,
%% when a pdu has been received from the master-agent.
%%
diff --git a/lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl b/lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl
index b9ec5ff05e..aca90baf0e 100644
--- a/lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl
+++ b/lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_notification_filter.erl b/lib/snmp/src/agent/snmpa_notification_filter.erl
index 199cf725fd..6300d450c7 100644
--- a/lib/snmp/src/agent/snmpa_notification_filter.erl
+++ b/lib/snmp/src/agent/snmpa_notification_filter.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_set.erl b/lib/snmp/src/agent/snmpa_set.erl
index 0f85d0aaa0..9833d6fdcc 100644
--- a/lib/snmp/src/agent/snmpa_set.erl
+++ b/lib/snmp/src/agent/snmpa_set.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_set_lib.erl b/lib/snmp/src/agent/snmpa_set_lib.erl
index f5218d5409..57507a36e8 100644
--- a/lib/snmp/src/agent/snmpa_set_lib.erl
+++ b/lib/snmp/src/agent/snmpa_set_lib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_set_mechanism.erl b/lib/snmp/src/agent/snmpa_set_mechanism.erl
index 4561fb035b..2f24f38092 100644
--- a/lib/snmp/src/agent/snmpa_set_mechanism.erl
+++ b/lib/snmp/src/agent/snmpa_set_mechanism.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_supervisor.erl b/lib/snmp/src/agent/snmpa_supervisor.erl
index 886fd074bc..cdb5ca840d 100644
--- a/lib/snmp/src/agent/snmpa_supervisor.erl
+++ b/lib/snmp/src/agent/snmpa_supervisor.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -224,26 +225,101 @@ init([AgentType, Opts]) ->
ets:insert(snmp_agent_table, {error_report_mod, ErrorReportMod}),
%% -- mib storage --
+ %% MibStorage has only one mandatory part: module
+ %% Everything else is module dependent and therefor
+ %% put in a special option: options
MibStorage =
- case get_opt(mib_storage, Opts, ets) of
+ case get_opt(mib_storage, Opts, [{module, snmpa_mib_storage_ets}]) of
+
+ %% --- ETS wrappers ---
+
+ ets ->
+ [{module, snmpa_mib_storage_ets}];
+ {ets, default} ->
+ [{module, snmpa_mib_storage_ets},
+ {options, [{dir, filename:join([DbDir])},
+ {action, keep}]}];
+ {ets, Dir} when is_list(Dir) ->
+ [{module, snmpa_mib_storage_ets},
+ {options, [{dir, filename:join([Dir])},
+ {action, keep}]}];
+ {ets, default, Action} when ((Action =:= keep) orelse
+ (Action =:= clear)) ->
+ [{module, snmpa_mib_storage_ets},
+ {options, [{dir, filename:join([DbDir])},
+ {action, Action}]}];
+ {ets, Dir, Action} when is_list(Dir) andalso
+ ((Action =:= keep) orelse
+ (Action =:= clear)) ->
+ [{module, snmpa_mib_storage_ets},
+ {options, [{dir, filename:join([Dir])},
+ {action, Action}]}];
+
+ %% --- DETS wrappers ---
+
dets ->
- {dets, DbDir};
+ [{module, snmpa_mib_storage_dets},
+ {options, [{dir, filename:join([DbDir])},
+ {action, keep}]}];
{dets, default} ->
- {dets, DbDir};
- {dets, default, Act} ->
- {dets, DbDir, Act};
- {ets, default} ->
- {ets, DbDir};
+ [{module, snmpa_mib_storage_dets},
+ {options, [{dir, filename:join([DbDir])},
+ {action, keep}]}];
+ {dets, default, Action} when ((Action =:= keep) orelse
+ (Action =:= clear)) ->
+ [{module, snmpa_mib_storage_dets},
+ {options, [{dir, filename:join([DbDir])},
+ {action, Action}]}];
+ {dets, Dir, Action} when is_list(Dir) andalso
+ ((Action =:= keep) orelse
+ (Action =:= clear)) ->
+ [{module, snmpa_mib_storage_dets},
+ {options, [{dir, filename:join([Dir])},
+ {action, Action}]}];
+
+ %% --- Mnesia wrappers ---
+
mnesia ->
- {mnesia, erlang:nodes()};
- {mnesia, visible} ->
- {mnesia, erlang:nodes(visible)};
- {mnesia, connected} ->
- {mnesia, erlang:nodes(connected)};
- Other ->
+ [{module, snmpa_mib_storage_mnesia},
+ {options, [{nodes, erlang:nodes()},
+ {action, keep}]}];
+ {mnesia, Nodes0} ->
+ Nodes =
+ if
+ Nodes0 =:= visible ->
+ erlang:nodes(visible);
+ Nodes0 =:= connected ->
+ erlang:nodes(connected);
+ Nodes0 =:= [] ->
+ [node()];
+ true ->
+ Nodes0
+ end,
+ [{module, snmpa_mib_storage_mnesia},
+ {options, [{nodes, Nodes},
+ {action, keep}]}];
+ {mnesia, Nodes0, Action} when ((Action =:= keep) orelse
+ (Action =:= clear)) ->
+ Nodes =
+ if
+ Nodes0 =:= visible ->
+ erlang:nodes(visible);
+ Nodes0 =:= connected ->
+ erlang:nodes(connected);
+ Nodes0 =:= [] ->
+ [node()];
+ true ->
+ Nodes0
+ end,
+ [{module, snmpa_mib_storage_mnesia},
+ {options, [{nodes, Nodes},
+ {action, Action}]}];
+
+ Other when is_list(Other) ->
Other
end,
- ?vdebug("[agent table] store mib storage: ~w",[MibStorage]),
+
+ ?vdebug("[agent table] store mib storage: ~w", [MibStorage]),
ets:insert(snmp_agent_table, {mib_storage, MibStorage}),
%% -- Agent mib storage --
@@ -281,7 +357,7 @@ init([AgentType, Opts]) ->
SymStoreSpec =
worker_spec(snmpa_symbolic_store, SymStoreArgs, Restart, 2000),
- LdbArgs = [Prio, DbDir, LdbOpts],
+ LdbArgs = [Prio, DbDir, DbInitError, LdbOpts],
LocalDbSpec =
worker_spec(snmpa_local_db, LdbArgs, Restart, 5000),
@@ -388,7 +464,7 @@ init([AgentType, Opts]) ->
AgentSpec =
worker_spec(snmpa_agent,
- [Prio,snmp_master_agent,none,Ref,AgentOpts],
+ [Prio, snmp_master_agent, none, Ref, AgentOpts],
Restart, 15000),
AgentSupSpec =
sup_spec(snmpa_agent_sup, [AgentSpec],
diff --git a/lib/snmp/src/agent/snmpa_svbl.erl b/lib/snmp/src/agent/snmpa_svbl.erl
index 9c2910580e..8955bed0f2 100644
--- a/lib/snmp/src/agent/snmpa_svbl.erl
+++ b/lib/snmp/src/agent/snmpa_svbl.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/agent/snmpa_symbolic_store.erl b/lib/snmp/src/agent/snmpa_symbolic_store.erl
index 6c58ffde41..945a4e9a9c 100644
--- a/lib/snmp/src/agent/snmpa_symbolic_store.erl
+++ b/lib/snmp/src/agent/snmpa_symbolic_store.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -78,7 +79,7 @@
gen_server:start_link({local, ?SERVER}, ?MODULE, [Prio, Opts], [])).
-endif.
--record(state, {db, backup}).
+-record(state, {module, db, backup}).
-record(symbol, {key, mib_name, info}).
@@ -112,6 +113,9 @@ backup(BackupDir) ->
get_db() ->
call(get_db).
+which_module() ->
+ call(which_module).
+
%%----------------------------------------------------------------------
%% Returns: {value, Oid} | false
@@ -202,49 +206,63 @@ verbosity(Verbosity) ->
%%----------------------------------------------------------------------
%% DB access (read) functions: Returns: {value, Oid} | false
%%----------------------------------------------------------------------
+
aliasname_to_oid(Db, Aliasname) ->
- case snmpa_general_db:read(Db, {alias, Aliasname}) of
+ Mod = which_module(),
+ aliasname_to_oid(Mod, Db, Aliasname).
+
+aliasname_to_oid(Mod, Db, Aliasname) ->
+ case Mod:read(Db, {alias, Aliasname}) of
{value,#symbol{info = {Oid, _Enums}}} -> {value, Oid};
false -> false
end.
-oid_to_aliasname(Db,Oid) ->
- case snmpa_general_db:read(Db, {oid, Oid}) of
+oid_to_aliasname(Db, Oid) ->
+ Mod = which_module(),
+ oid_to_aliasname(Mod, Db, Oid).
+
+oid_to_aliasname(Mod, Db, Oid) ->
+ case Mod:read(Db, {oid, Oid}) of
{value,#symbol{info = Aliasname}} -> {value, Aliasname};
_ -> false
end.
-which_notifications(Db) ->
+which_notifications(Mod, Db) ->
Pattern = #symbol{key = {trap, '_'}, _ = '_'},
- Symbols = snmpa_general_db:match_object(Db, Pattern),
+ Symbols = Mod:match_object(Db, Pattern),
[{Name, Mib, Rec} || #symbol{key = {trap, Name},
mib_name = Mib,
info = Rec} <- Symbols].
-which_aliasnames(Db) ->
+which_aliasnames(Mod, Db) ->
Pattern = #symbol{key = {alias, '_'}, _ = '_'},
- Symbols = snmpa_general_db:match_object(Db, Pattern),
+ Symbols = Mod:match_object(Db, Pattern),
[Alias || #symbol{key = {alias, Alias}} <- Symbols].
-which_tables(Db) ->
+which_tables(Mod, Db) ->
Pattern = #symbol{key = {table_info, '_'}, _ = '_'},
- Symbols = snmpa_general_db:match_object(Db, Pattern),
+ Symbols = Mod:match_object(Db, Pattern),
[Name || #symbol{key = {table_info, Name}} <- Symbols].
-which_variables(Db) ->
+which_variables(Mod, Db) ->
Pattern = #symbol{key = {variable_info, '_'}, _ = '_'},
- Symbols = snmpa_general_db:match_object(Db, Pattern),
+ Symbols = Mod:match_object(Db, Pattern),
[Name || #symbol{key = {variable_info, Name}} <- Symbols].
-int_to_enum(Db,TypeOrObjName,Int) ->
- case snmpa_general_db:read(Db, {alias, TypeOrObjName}) of
+
+int_to_enum(Db, TypeOrObjName, Int) ->
+ Mod = which_module(),
+ int_to_enum(Mod, Db, TypeOrObjName, Int).
+
+int_to_enum(Mod, Db, TypeOrObjName, Int) ->
+ case Mod:read(Db, {alias, TypeOrObjName}) of
{value,#symbol{info = {_Oid, Enums}}} ->
case lists:keysearch(Int, 2, Enums) of
{value, {Enum, _Int}} -> {value, Enum};
false -> false
end;
false -> % Not an Aliasname ->
- case snmpa_general_db:read(Db, {type, TypeOrObjName}) of
+ case Mod:read(Db, {type, TypeOrObjName}) of
{value,#symbol{info = Enums}} ->
case lists:keysearch(Int, 2, Enums) of
{value, {Enum, _Int}} -> {value, Enum};
@@ -256,14 +274,18 @@ int_to_enum(Db,TypeOrObjName,Int) ->
end.
enum_to_int(Db, TypeOrObjName, Enum) ->
- case snmpa_general_db:read(Db, {alias, TypeOrObjName}) of
+ Mod = which_module(),
+ enum_to_int(Mod, Db, TypeOrObjName, Enum).
+
+enum_to_int(Mod, Db, TypeOrObjName, Enum) ->
+ case Mod:read(Db, {alias, TypeOrObjName}) of
{value,#symbol{info = {_Oid, Enums}}} ->
case lists:keysearch(Enum, 1, Enums) of
{value, {_Enum, Int}} -> {value, Int};
false -> false
end;
false -> % Not an Aliasname
- case snmpa_general_db:read(Db, {type, TypeOrObjName}) of
+ case Mod:read(Db, {type, TypeOrObjName}) of
{value,#symbol{info = Enums}} ->
case lists:keysearch(Enum, 1, Enums) of
{value, {_Enum, Int}} -> {value, Int};
@@ -278,8 +300,9 @@ enum_to_int(Db, TypeOrObjName, Enum) ->
%%----------------------------------------------------------------------
%% DB access (read) functions: Returns: false|{value, Info}
%%----------------------------------------------------------------------
-table_info(Db,TableName) ->
- case snmpa_general_db:read(Db, {table_info, TableName}) of
+
+table_info(Mod, Db, TableName) ->
+ case Mod:read(Db, {table_info, TableName}) of
{value,#symbol{info = Info}} -> {value, Info};
false -> false
end.
@@ -288,8 +311,8 @@ table_info(Db,TableName) ->
%%----------------------------------------------------------------------
%% DB access (read) functions: Returns: false|{value, Info}
%%----------------------------------------------------------------------
-variable_info(Db,VariableName) ->
- case snmpa_general_db:read(Db, {variable_info, VariableName}) of
+variable_info(Mod, Db, VariableName) ->
+ case Mod:read(Db, {variable_info, VariableName}) of
{value,#symbol{info = Info}} -> {value, Info};
false -> false
end.
@@ -299,7 +322,7 @@ variable_info(Db,VariableName) ->
%% Implementation
%%----------------------------------------------------------------------
-init([Prio,Opts]) ->
+init([Prio, Opts]) ->
?d("init -> entry with"
"~n Prio: ~p"
"~n Opts: ~p", [Prio,Opts]),
@@ -317,102 +340,125 @@ do_init(Prio, Opts) ->
put(sname,ss),
put(verbosity,get_verbosity(Opts)),
?vlog("starting",[]),
- Storage = get_mib_storage(Opts),
+ MibStorage = get_mib_storage(Opts),
+ Mod = snmp_misc:get_option(module, MibStorage),
+ MsOpts = snmp_misc:get_option(options, MibStorage, []),
+
%% type = bag solves the problem with import and multiple
%% object/type definitions.
- Db = snmpa_general_db:open(Storage, snmpa_symbolic_store,
- symbol, record_info(fields,symbol), bag),
- S = #state{db = Db},
- ?vdebug("started",[]),
- {ok, S}.
+ case Mod:open(?MODULE, symbol, record_info(fields, symbol), bag, MsOpts) of
+ {ok, Db} ->
+ S = #state{module = Mod, db = Db},
+ ?vdebug("started",[]),
+ {ok, S};
+ {error, _} = ERROR ->
+ ERROR
+ end.
handle_call(get_db, _From, #state{db = DB} = S) ->
?vlog("get db",[]),
{reply, DB, S};
-handle_call({table_info, TableName}, _From, #state{db = DB} = S) ->
+handle_call(which_module, _From, #state{module = Mod} = S) ->
+ ?vlog("which module",[]),
+ {reply, Mod, S};
+
+handle_call({table_info, TableName}, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("table info: ~p",[TableName]),
- Res = table_info(DB, TableName),
+ Res = table_info(Mod, DB, TableName),
?vdebug("table info result: ~p",[Res]),
{reply, Res, S};
-handle_call({variable_info, VariableName}, _From, #state{db = DB} = S) ->
+handle_call({variable_info, VariableName}, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("variable info: ~p",[VariableName]),
- Res = variable_info(DB, VariableName),
+ Res = variable_info(Mod, DB, VariableName),
?vdebug("variable info result: ~p",[Res]),
{reply, Res, S};
-handle_call({aliasname_to_oid, Aliasname}, _From, #state{db = DB} = S) ->
+handle_call({aliasname_to_oid, Aliasname}, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("aliasname to oid: ~p",[Aliasname]),
- Res = aliasname_to_oid(DB,Aliasname),
+ Res = aliasname_to_oid(Mod, DB, Aliasname),
?vdebug("aliasname to oid result: ~p",[Res]),
{reply, Res, S};
-handle_call({oid_to_aliasname, Oid}, _From, #state{db = DB} = S) ->
+handle_call({oid_to_aliasname, Oid}, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("oid to aliasname: ~p",[Oid]),
- Res = oid_to_aliasname(DB, Oid),
+ Res = oid_to_aliasname(Mod, DB, Oid),
?vdebug("oid to aliasname result: ~p",[Res]),
{reply, Res, S};
-handle_call(which_aliasnames, _From, #state{db = DB} = S) ->
+handle_call(which_aliasnames, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("which aliasnames",[]),
- Res = which_aliasnames(DB),
+ Res = which_aliasnames(Mod, DB),
?vdebug("which aliasnames: ~p",[Res]),
{reply, Res, S};
-handle_call(which_tables, _From, #state{db = DB} = S) ->
+handle_call(which_tables, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("which tables",[]),
- Res = which_tables(DB),
+ Res = which_tables(Mod, DB),
?vdebug("which tables: ~p",[Res]),
{reply, Res, S};
-handle_call(which_variables, _From, #state{db = DB} = S) ->
+handle_call(which_variables, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("which variables",[]),
- Res = which_variables(DB),
+ Res = which_variables(Mod, DB),
?vdebug("which variables: ~p",[Res]),
{reply, Res, S};
-handle_call({enum_to_int, TypeOrObjName, Enum}, _From, #state{db = DB} = S) ->
+handle_call({enum_to_int, TypeOrObjName, Enum}, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("enum to int: ~p, ~p",[TypeOrObjName,Enum]),
- Res = enum_to_int(DB, TypeOrObjName, Enum),
+ Res = enum_to_int(Mod, DB, TypeOrObjName, Enum),
?vdebug("enum to int result: ~p",[Res]),
{reply, Res, S};
-handle_call({int_to_enum, TypeOrObjName, Int}, _From, #state{db = DB} = S) ->
+handle_call({int_to_enum, TypeOrObjName, Int}, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("int to enum: ~p, ~p",[TypeOrObjName,Int]),
- Res = int_to_enum(DB, TypeOrObjName, Int),
+ Res = int_to_enum(Mod, DB, TypeOrObjName, Int),
?vdebug("int to enum result: ~p",[Res]),
{reply, Res, S};
-handle_call({set_notification, MibName, Trap}, _From, #state{db = DB} = S) ->
+handle_call({set_notification, MibName, Trap}, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("set notification:"
"~n ~p~n ~p", [MibName,Trap]),
- set_notif(DB, MibName, Trap),
+ set_notif(Mod, DB, MibName, Trap),
{reply, true, S};
-handle_call({delete_notifications, MibName}, _From, #state{db = DB} = S) ->
+handle_call({delete_notifications, MibName}, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("delete notification: ~p",[MibName]),
- delete_notif(DB, MibName),
+ delete_notif(Mod, DB, MibName),
{reply, true, S};
-handle_call(which_notifications, _From, #state{db = DB} = S) ->
+handle_call(which_notifications, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("which notifications", []),
- Reply = which_notifications(DB),
+ Reply = which_notifications(Mod, DB),
{reply, Reply, S};
-handle_call({get_notification, Key}, _From, #state{db = DB} = S) ->
+handle_call({get_notification, Key}, _From,
+ #state{module = Mod, db = DB} = S) ->
?vlog("get notification: ~p",[Key]),
- Res = get_notif(DB, Key),
+ Res = get_notif(Mod, DB, Key),
?vdebug("get notification result: ~p",[Res]),
{reply, Res, S};
-handle_call(info, _From, #state{db = DB} = S) ->
+handle_call(info, _From, #state{module = Mod, db = DB} = S) ->
?vlog("info",[]),
- Info = get_info(DB),
+ Info = get_info(Mod, DB),
{reply, Info, S};
-handle_call({backup, BackupDir}, From, #state{db = DB} = S) ->
+handle_call({backup, BackupDir}, From, #state{module = Mod, db = DB} = S) ->
?vlog("info to ~p",[BackupDir]),
Pid = self(),
V = get(verbosity),
@@ -424,7 +470,7 @@ handle_call({backup, BackupDir}, From, #state{db = DB} = S) ->
put(sname, albs),
put(verbosity, V),
Dir = filename:join([BackupDir]),
- Reply = snmpa_general_db:backup(DB, Dir),
+ Reply = Mod:backup(DB, Dir),
Pid ! {backup_done, Reply},
unlink(Pid)
end),
@@ -446,7 +492,7 @@ handle_call(Req, _From, S) ->
{reply, Reply, S}.
-handle_cast({add_types, MibName, Types}, #state{db = DB} = S) ->
+handle_cast({add_types, MibName, Types}, #state{module = Mod, db = DB} = S) ->
?vlog("add types for ~p:",[MibName]),
F = fun(#asn1_type{assocList = Alist, aliasname = Name}) ->
case snmp_misc:assq(enums, Alist) of
@@ -455,20 +501,21 @@ handle_cast({add_types, MibName, Types}, #state{db = DB} = S) ->
Rec = #symbol{key = {type, Name},
mib_name = MibName,
info = Es},
- snmpa_general_db:write(DB, Rec);
+ Mod:write(DB, Rec);
false -> done
end
end,
lists:foreach(F, Types),
{noreply, S};
-handle_cast({delete_types, MibName}, #state{db = DB} = S) ->
+handle_cast({delete_types, MibName}, #state{module = Mod, db = DB} = S) ->
?vlog("delete types: ~p",[MibName]),
Pattern = #symbol{key = {type, '_'}, mib_name = MibName, info = '_'},
- snmpa_general_db:match_delete(DB, Pattern),
+ Mod:match_delete(DB, Pattern),
{noreply, S};
-handle_cast({add_aliasnames, MibName, MEs}, #state{db = DB} = S) ->
+handle_cast({add_aliasnames, MibName, MEs},
+ #state{module = Mod, db = DB} = S) ->
?vlog("add aliasnames for ~p:",[MibName]),
F = fun(#me{aliasname = AN, oid = Oid, asn1_type = AT}) ->
Enums =
@@ -480,20 +527,21 @@ handle_cast({add_aliasnames, MibName, MEs}, #state{db = DB} = S) ->
end;
_ -> []
end,
- write_alias(AN, DB, Enums, MibName, Oid)
+ write_alias(Mod, AN, DB, Enums, MibName, Oid)
end,
lists:foreach(F, MEs),
{noreply, S};
-handle_cast({delete_aliasname, MibName}, #state{db = DB} = S) ->
+handle_cast({delete_aliasname, MibName}, #state{module = Mod, db = DB} = S) ->
?vlog("delete aliasname: ~p",[MibName]),
Pattern1 = #symbol{key = {alias, '_'}, mib_name = MibName, info = '_'},
- snmpa_general_db:match_delete(DB, Pattern1),
+ Mod:match_delete(DB, Pattern1),
Pattern2 = #symbol{key = {oid, '_'}, mib_name = MibName, info = '_'},
- snmpa_general_db:match_delete(DB, Pattern2),
+ Mod:match_delete(DB, Pattern2),
{noreply, S};
-handle_cast({add_table_infos, MibName, TableInfos}, #state{db = DB} = S) ->
+handle_cast({add_table_infos, MibName, TableInfos},
+ #state{module = Mod, db = DB} = S) ->
?vlog("add table infos for ~p:",[MibName]),
F = fun({Name, TableInfo}) ->
?vlog("add table info~n ~p -> ~p",
@@ -501,19 +549,20 @@ handle_cast({add_table_infos, MibName, TableInfos}, #state{db = DB} = S) ->
Rec = #symbol{key = {table_info, Name},
mib_name = MibName,
info = TableInfo},
- snmpa_general_db:write(DB, Rec)
+ Mod:write(DB, Rec)
end,
lists:foreach(F, TableInfos),
{noreply, S};
-handle_cast({delete_table_infos, MibName}, #state{db = DB} = S) ->
+handle_cast({delete_table_infos, MibName},
+ #state{module = Mod, db = DB} = S) ->
?vlog("delete table infos: ~p",[MibName]),
Pattern = #symbol{key = {table_info, '_'}, mib_name = MibName, info = '_'},
- snmpa_general_db:match_delete(DB, Pattern),
+ Mod:match_delete(DB, Pattern),
{noreply, S};
handle_cast({add_variable_infos, MibName, VariableInfos},
- #state{db = DB} = S) ->
+ #state{module = Mod, db = DB} = S) ->
?vlog("add variable infos for ~p:",[MibName]),
F = fun({Name, VariableInfo}) ->
?vlog("add variable info~n ~p -> ~p",
@@ -521,17 +570,18 @@ handle_cast({add_variable_infos, MibName, VariableInfos},
Rec = #symbol{key = {variable_info, Name},
mib_name = MibName,
info = VariableInfo},
- snmpa_general_db:write(DB, Rec)
+ Mod:write(DB, Rec)
end,
lists:foreach(F, VariableInfos),
{noreply, S};
-handle_cast({delete_variable_infos, MibName}, #state{db = DB} = S) ->
+handle_cast({delete_variable_infos, MibName},
+ #state{module = Mod, db = DB} = S) ->
?vlog("delete variable infos: ~p",[MibName]),
Pattern = #symbol{key = {variable_info,'_'},
mib_name = MibName,
info = '_'},
- snmpa_general_db:match_delete(DB, Pattern),
+ Mod:match_delete(DB, Pattern),
{noreply, S};
handle_cast({verbosity,Verbosity}, State) ->
@@ -565,9 +615,9 @@ handle_info(Info, S) ->
{noreply, S}.
-terminate(Reason, S) ->
- ?vlog("terminate: ~p",[Reason]),
- snmpa_general_db:close(S#state.db).
+terminate(Reason, #state{module = Mod, db = DB}) ->
+ ?vlog("terminate: ~p", [Reason]),
+ Mod:close(DB).
%%----------------------------------------------------------
@@ -575,28 +625,28 @@ terminate(Reason, S) ->
%%----------------------------------------------------------
% downgrade
-code_change({down, _Vsn}, #state{db = DB, backup = B}, downgrade_to_pre_4_7) ->
- ?d("code_change(down) -> entry", []),
- stop_backup_server(B),
- S = {state, DB},
- {ok, S};
-
-% upgrade
-code_change(_Vsn, S, upgrade_from_pre_4_7) ->
- ?d("code_change(up) -> entry", []),
- {state, DB} = S,
- S1 = #state{db = DB},
- {ok, S1};
+%% code_change({down, _Vsn}, #state{db = DB, backup = B}, downgrade_to_pre_4_7) ->
+%% ?d("code_change(down) -> entry", []),
+%% stop_backup_server(B),
+%% S = {state, DB},
+%% {ok, S};
+
+%% % upgrade
+%% code_change(_Vsn, S, upgrade_from_pre_4_7) ->
+%% ?d("code_change(up) -> entry", []),
+%% {state, DB} = S,
+%% S1 = #state{db = DB},
+%% {ok, S1};
code_change(_Vsn, S, _Extra) ->
?d("code_change -> entry [do nothing]", []),
{ok, S}.
-stop_backup_server(undefined) ->
- ok;
-stop_backup_server({Pid, _}) when is_pid(Pid) ->
- exit(Pid, kill).
+%% stop_backup_server(undefined) ->
+%% ok;
+%% stop_backup_server({Pid, _}) when is_pid(Pid) ->
+%% exit(Pid, kill).
@@ -609,13 +659,13 @@ stop_backup_server({Pid, _}) when is_pid(Pid) ->
%%-----------------------------------------------------------------
%% Returns: {value, Value} | undefined
%%-----------------------------------------------------------------
-get_notif(Db, Key) ->
- case snmpa_general_db:read(Db, {trap, Key}) of
+get_notif(Mod, Db, Key) ->
+ case Mod:read(Db, {trap, Key}) of
{value,#symbol{info = Value}} -> {value, Value};
false -> undefined
end.
-set_notif(Db, MibName, Trap) when is_record(Trap, trap) ->
+set_notif(Mod, Db, MibName, Trap) when is_record(Trap, trap) ->
#trap{trapname = Name} = Trap,
Rec = #symbol{key = {trap, Name}, mib_name = MibName, info = Trap},
%% convert old v1 trap to oid
@@ -625,40 +675,41 @@ set_notif(Db, MibName, Trap) when is_record(Trap, trap) ->
Oid0 ->
Oid0 ++ [0, Trap#trap.specificcode]
end,
- write_alias(Name, Db, MibName, Oid),
- snmpa_general_db:write(Db, Rec);
-set_notif(Db, MibName, Trap) ->
+ write_alias(Mod, Name, Db, MibName, Oid),
+ Mod:write(Db, Rec);
+set_notif(Mod, Db, MibName, Trap) ->
#notification{trapname = Name, oid = Oid} = Trap,
Rec = #symbol{key = {trap, Name}, mib_name = MibName, info = Trap},
- write_alias(Name, Db, MibName, Oid),
- snmpa_general_db:write(Db, Rec).
+ write_alias(Mod, Name, Db, MibName, Oid),
+ Mod:write(Db, Rec).
-delete_notif(Db, MibName) ->
+delete_notif(Mod, Db, MibName) ->
Pattern = #symbol{key = {trap, '_'}, mib_name = MibName, info = '_'},
- snmpa_general_db:match_delete(Db, Pattern).
+ Mod:match_delete(Db, Pattern).
-write_alias(AN, DB, MibName, Oid) ->
- write_alias(AN, DB, [], MibName, Oid).
+write_alias(Mod, AN, DB, MibName, Oid) ->
+ write_alias(Mod, AN, DB, [], MibName, Oid).
-write_alias(AN, DB, Enums, MibName, Oid) ->
+write_alias(Mod, AN, DB, Enums, MibName, Oid) ->
?vlog("add alias~n ~p -> {~p,~p}",[AN, Oid, Enums]),
Rec1 = #symbol{key = {alias, AN},
mib_name = MibName,
info = {Oid,Enums}},
- snmpa_general_db:write(DB, Rec1),
+ Mod:write(DB, Rec1),
?vlog("add oid~n ~p -> ~p",[Oid, AN]),
Rec2 = #symbol{key = {oid, Oid},
mib_name = MibName,
info = AN},
- snmpa_general_db:write(DB, Rec2).
+ Mod:write(DB, Rec2).
+
%% -------------------------------------
-get_info(DB) ->
+get_info(Mod, DB) ->
ProcSize = proc_mem(self()),
- DbSz = tab_size(DB),
- [{process_memory, ProcSize}, {db_memory, DbSz}].
+ DbMemory = Mod:info(DB, memory),
+ [{process_memory, ProcSize}, {db_memory, DbMemory}].
proc_mem(P) when is_pid(P) ->
case (catch erlang:process_info(P, memory)) of
@@ -667,26 +718,15 @@ proc_mem(P) when is_pid(P) ->
_ ->
undefined
end.
-%% proc_mem(_) ->
-%% undefined.
-
-tab_size(DB) ->
- case (catch snmpa_general_db:info(DB, memory)) of
- Sz when is_integer(Sz) ->
- Sz;
- _ ->
- undefined
- end.
-
%% -------------------------------------
get_verbosity(L) ->
- snmp_misc:get_option(verbosity,L,?default_verbosity).
+ snmp_misc:get_option(verbosity, L, ?default_verbosity).
get_mib_storage(L) ->
- snmp_misc:get_option(mib_storage,L,ets).
+ snmp_misc:get_option(mib_storage, L).
%% -------------------------------------
diff --git a/lib/snmp/src/agent/snmpa_target_cache.erl b/lib/snmp/src/agent/snmpa_target_cache.erl
index 2aa35aa46a..72caf72b33 100644
--- a/lib/snmp/src/agent/snmpa_target_cache.erl
+++ b/lib/snmp/src/agent/snmpa_target_cache.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -21,8 +22,6 @@
-behaviour(gen_server).
%% External exports
-%% Avoid warning for local function demonitor/1 clashing with autoimported BIF.
--compile({no_auto_import,[demonitor/1]}).
-export([start_link/2, stop/0, verbosity/1]).
-export([
@@ -213,21 +212,6 @@ do_init(Prio, Opts) ->
%% requests will have to wait.
%%
-monitor(Pid) -> erlang:monitor(process, Pid).
--ifdef(SNMP_R10).
-demonitor(Ref) ->
- erlang:demonitor(Ref),
- receive
- {_, Ref, _, _, _} ->
- true
- after 0 ->
- true
- end.
--else.
-demonitor(Ref) ->
- erlang:demonitor(Ref, [flush]).
--endif.
-
%% (1) No write_lock active or waiting
handle_call({lock, read = Type, infinity}, {Pid, _} = From,
@@ -236,7 +220,7 @@ handle_call({lock, read = Type, infinity}, {Pid, _} = From,
"entry when no waiting or active writer with"
"~n Pid: ~p"
"~n Cnt: ~p", [Pid, Cnt]),
- MonRef = monitor(Pid),
+ MonRef = erlang:monitor(process, Pid),
Locker = #locker{pid = Pid,
from = From,
mon_ref = MonRef,
@@ -252,7 +236,7 @@ handle_call({lock, read = Type, infinity}, {Pid, _} = From, State) ->
?vlog("lock(read, infinity) -> "
"entry when active or waiting write locks with"
"~n Pid: ~p", [Pid]),
- MonRef = monitor(Pid),
+ MonRef = erlang:monitor(process, Pid),
Locker = #locker{pid = Pid,
from = From,
mon_ref = MonRef,
@@ -273,7 +257,7 @@ handle_call({lock, write = Type, infinity}, {Pid, _} = From,
?vlog("lock(write, infinity) -> "
"entry when no active lockers with"
"~n Pid: ~p", [Pid]),
- MonRef = monitor(Pid),
+ MonRef = erlang:monitor(process, Pid),
Locker = #locker{pid = Pid,
from = From,
mon_ref = MonRef,
@@ -290,7 +274,7 @@ handle_call({lock, write = Type, infinity}, {Pid, _} = From,
?vlog("lock(write, infinity) -> "
"entry when active lockers with"
"~n Pid: ~p", [Pid]),
- MonRef = monitor(Pid),
+ MonRef = erlang:monitor(process, Pid),
Locker = #locker{pid = Pid,
from = From,
mon_ref = MonRef,
@@ -307,7 +291,7 @@ handle_call({lock, write = Type, infinity}, {Pid, _} = From,
#state{writer = true} = State) ->
?vlog("lock(write, infinity) -> entry with"
"~n Pid: ~p", [Pid]),
- MonRef = monitor(Pid),
+ MonRef = erlang:monitor(process, Pid),
Locker = #locker{pid = Pid,
from = From,
mon_ref = MonRef,
@@ -429,7 +413,7 @@ handle_cast({unlock, Pid},
[#locker{mon_ref = MonRef, type = read}] ->
?vdebug("unlock -> found read locker"
"~n MonRef: ~p", [MonRef]),
- demonitor(MonRef),
+ erlang:demonitor(MonRef, [flush]),
ets:delete(?LOCKER_TAB, Pid),
%% ?vtrace("unlock -> done when"
%% "~n Lockers: ~p", [ets:tab2list(?LOCKER_TAB)]),
@@ -437,7 +421,7 @@ handle_cast({unlock, Pid},
[#locker{mon_ref = MonRef, type = write}] ->
?vdebug("unlock -> found write locker"
"~n MonRef: ~p", [MonRef]),
- demonitor(MonRef),
+ erlang:demonitor(MonRef, [flush]),
ets:delete(?LOCKER_TAB, Pid),
%% ?vtrace("unlock -> done when"
%% "~n Lockers: ~p", [ets:tab2list(?LOCKER_TAB)]),
@@ -459,7 +443,7 @@ handle_cast({unlock, Pid},
[#locker{mon_ref = MonRef, type = read}] when (Cnt == 1) ->
?vdebug("unlock -> found read locker"
"~n MonRef: ~p", [MonRef]),
- demonitor(MonRef),
+ erlang:demonitor(MonRef, [flush]),
ets:delete(?LOCKER_TAB, Pid),
case active_waiting_writer(Waiting) of
{true, StillWaiting} ->
@@ -482,7 +466,7 @@ handle_cast({unlock, Pid},
[#locker{mon_ref = MonRef, type = read}] ->
?vdebug("unlock -> found read locker"
"~n MonRef: ~p", [MonRef]),
- demonitor(MonRef),
+ erlang:demonitor(MonRef, [flush]),
ets:delete(?LOCKER_TAB, Pid),
%% ?vtrace("unlock -> done when"
%% "~n Lockers: ~p", [ets:tab2list(?LOCKER_TAB)]),
@@ -492,7 +476,7 @@ handle_cast({unlock, Pid},
%% Release the hord (maybe)
?vdebug("unlock -> found write locker"
"~n MonRef: ~p", [MonRef]),
- demonitor(MonRef),
+ erlang:demonitor(MonRef, [flush]),
ets:delete(?LOCKER_TAB, Pid),
{Active, StillWaiting, Writer} =
activate_waiting_readers_or_maybe_writer(Waiting),
diff --git a/lib/snmp/src/agent/snmpa_trap.erl b/lib/snmp/src/agent/snmpa_trap.erl
index b9a2496341..e75016f7ec 100644
--- a/lib/snmp/src/agent/snmpa_trap.erl
+++ b/lib/snmp/src/agent/snmpa_trap.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -270,12 +271,13 @@ localise_type({VariableOid, Value}, Mib) when is_list(VariableOid) ->
localise_type(X, _) -> X.
%%-----------------------------------------------------------------
-%% Func: make_v1_trap_pdu/4
+%% Func: make_v1_trap_pdu/5
%% Args: Enterprise = oid()
%% Specific = integer()
%% Varbinds is as returned from initiate_vars
%% (but only {Oid, Type[, Value} permitted)
%% SysUpTime = integer()
+%% AgentIp = {A, B, C, D}
%% Purpose: Make a #trappdu
%% Checks the Varbinds to see that no symbolic names are
%% present, and that each var has a type. Performs a get
@@ -284,7 +286,7 @@ localise_type(X, _) -> X.
%% Fails: yes
%% NOTE: Executed at the MA
%%-----------------------------------------------------------------
-make_v1_trap_pdu(Enterprise, Specific, VarbindList, SysUpTime) ->
+make_v1_trap_pdu(Enterprise, Specific, VarbindList, SysUpTime, AgentIp) ->
{Enterp,Generic,Spec} =
case Enterprise of
?snmp ->
@@ -292,7 +294,6 @@ make_v1_trap_pdu(Enterprise, Specific, VarbindList, SysUpTime) ->
_ ->
{Enterprise,?enterpriseSpecific,Specific}
end,
- {value, AgentIp} = snmp_framework_mib:intAgentIpAddress(get),
#trappdu{enterprise = Enterp,
agent_addr = AgentIp,
generic_trap = Generic,
@@ -369,6 +370,7 @@ send_trap(TrapRec, NotifyName, ContextName, Recv, Vbs, LocalEngineID,
{tag, T},
{err, E},
{stacktrace, erlang:get_stacktrace()}],
+ ?vlog("snmpa_trap:send_trap exception: ~p", [Info]),
{error, {failed_sending_trap, Info}}
end.
@@ -789,23 +791,19 @@ send_trap_pdus([], ContextName, {TrapRec, Vbs},
send_v1_trap(_TrapRec, [], _Vbs, _ExtraInfo, _NetIf, _SysUpTime) ->
ok;
-send_v1_trap(#trap{enterpriseoid = Enter, specificcode = Spec},
- V1Res, Vbs, ExtraInfo, NetIf, SysUpTime) ->
+send_v1_trap(
+ #trap{enterpriseoid = Enter, specificcode = Spec},
+ V1Res, Vbs, ExtraInfo, NetIf, SysUpTime) ->
?vdebug("prepare to send v1 trap "
"~n '~p'"
"~n with"
"~n ~p"
"~n to"
"~n ~p", [Enter, Spec, V1Res]),
- TrapPdu = make_v1_trap_pdu(Enter, Spec, Vbs, SysUpTime),
- AddrCommunities = mk_addr_communities(V1Res),
- lists:foreach(fun({Community, Addrs}) ->
- ?vtrace("send v1 trap pdu to ~p",[Addrs]),
- NetIf ! {send_pdu, 'version-1', TrapPdu,
- {community, Community}, Addrs, ExtraInfo}
- end, AddrCommunities);
-send_v1_trap(#notification{oid = Oid}, V1Res, Vbs, ExtraInfo, NetIf,
- SysUpTime) ->
+ do_send_v1_trap(Enter, Spec, V1Res, Vbs, ExtraInfo, NetIf, SysUpTime);
+send_v1_trap(
+ #notification{oid = Oid},
+ V1Res, Vbs, ExtraInfo, NetIf, SysUpTime) ->
%% Use alg. in rfc2089 to map a v2 trap to a v1 trap
% delete Counter64 objects from vbs
?vdebug("prepare to send v1 trap '~p'",[Oid]),
@@ -822,14 +820,38 @@ send_v1_trap(#notification{oid = Oid}, V1Res, Vbs, ExtraInfo, NetIf,
{lists:reverse(First),Last}
end
end,
- TrapPdu = make_v1_trap_pdu(Enter, Spec, NVbs, SysUpTime),
+ do_send_v1_trap(Enter, Spec, V1Res, NVbs, ExtraInfo, NetIf, SysUpTime).
+
+do_send_v1_trap(Enter, Spec, V1Res, NVbs, ExtraInfo, NetIf, SysUpTime) ->
+ {value, Transports} = snmp_framework_mib:intAgentTransports(get),
+ {_Domain, {AgentIp, _AgentPort}} =
+ case lists:keyfind(snmpUDPDomain, 1, Transports) of
+ false ->
+ case lists:keyfind(transportDomainUdpIpv4, 1, Transports) of
+ false ->
+ ?vtrace(
+ "snmpa_trap: can not send v1 trap "
+ "without IPv4 domain: ~p",
+ [Transports]),
+ user_err(
+ "snmpa_trap: can not send v1 trap "
+ "without IPv4 domain: ~p",
+ [Transports]);
+ DomainAddr ->
+ DomainAddr
+ end;
+ DomainAddr ->
+ DomainAddr
+ end,
+ TrapPdu = make_v1_trap_pdu(Enter, Spec, NVbs, SysUpTime, AgentIp),
AddrCommunities = mk_addr_communities(V1Res),
- lists:foreach(fun({Community, Addrs}) ->
- ?vtrace("send v1 trap to ~p",[Addrs]),
- NetIf ! {send_pdu, 'version-1', TrapPdu,
- {community, Community}, Addrs, ExtraInfo}
- end, AddrCommunities).
-
+ lists:foreach(
+ fun ({Community, Addrs}) ->
+ ?vtrace("send v1 trap to ~p",[Addrs]),
+ NetIf ! {send_pdu, 'version-1', TrapPdu,
+ {community, Community}, Addrs, ExtraInfo}
+ end, AddrCommunities).
+
send_v2_trap(_TrapRec, [], _Vbs, _Recv, _ExtraInfo, _NetIf, _SysUpTime) ->
ok;
send_v2_trap(TrapRec, V2Res, Vbs, Recv, ExtraInfo, NetIf, SysUpTime) ->
@@ -1045,7 +1067,7 @@ deliver_recv(#snmpa_notification_delivery_info{tag = Tag,
"~n DeliveryResult: ~p"
"~n TAddr: ~p"
"", [Tag, Mod, Extra, DeliveryResult, TAddr]),
- Addr = transform_taddr(TAddr),
+ [Addr] = transform_taddrs([TAddr]),
(catch Mod:delivery_info(Tag, Addr, DeliveryResult, Extra));
deliver_recv({Tag, Receiver}, MsgId, Result) ->
?vtrace("deliver_recv -> entry with"
@@ -1072,35 +1094,90 @@ deliver_recv(Else, _MsgId, _Result) ->
[Else]),
user_err("snmpa: bad receiver, ~w\n", [Else]).
-transform_taddrs(Addrs) ->
- [transform_taddr(Addr) || Addr <- Addrs].
+transform_taddrs(TAddrs) ->
+ UseTDomain =
+ case snmp_framework_mib:intAgentTransportDomain(get) of
+ {value,snmpUDPDomain} ->
+ false;
+ {value,_} ->
+ true;
+ genErr ->
+ false
+ end,
+ DomAddrs = [transform_taddr(TAddr) || TAddr <- TAddrs],
+ case UseTDomain of
+ true ->
+ DomAddrs;
+ false ->
+ [Addr || {_Domain, Addr} <- DomAddrs]
+ end.
-transform_taddr({?snmpUDPDomain, [A1, A2, A3, A4, P1, P2]}) -> % v2
- Addr = {A1, A2, A3, A4},
+%% v2
+transform_taddr({?snmpUDPDomain, Addr}) ->
+ transform_taddr(transportDomainIdpIpv4, Addr);
+transform_taddr({?transportDomainUdpIpv4, Addr}) ->
+ transform_taddr(transportDomainUdpIpv4, Addr);
+transform_taddr({?transportDomainUdpIpv6, Addr}) ->
+ transform_taddr(transportDomainUdpIpv6, Addr);
+%% v3
+transform_taddr({{?snmpUDPDomain, Addr}, _MsgData}) ->
+ transform_taddr(transportDomainUdpIpv4, Addr);
+transform_taddr({{?transportDomainUdpIpv4, Addr}, _MsgData}) ->
+ transform_taddr(transportDomainUdpIpv4, Addr);
+transform_taddr({{?transportDomainUdpIpv6, Addr}, _MsgData}) ->
+ transform_taddr(transportDomainUdpIpv6, Addr).
+
+transform_taddr(
+ transportDomainUdpIpv4 = Domain,
+ [A1,A2,A3,A4,P1,P2]) ->
+ Ip = {A1, A2, A3, A4},
Port = P1 bsl 8 + P2,
- {Addr, Port};
-transform_taddr({?transportDomainUdpIpv4, [A1, A2, A3, A4, P1, P2]}) -> % v2
- Addr = {A1, A2, A3, A4},
+ {Domain, {Ip, Port}};
+transform_taddr(
+ transportDomainUdpIpv6 = Domain,
+ [A1, A2, A3, A4, A5, A6, A7, A8, P1, P2]) ->
+ Ip = {A1, A2, A3, A4, A5, A6, A7, A8},
Port = P1 bsl 8 + P2,
- {Addr, Port};
-transform_taddr({?transportDomainUdpIpv6,
- [A1, A2, A3, A4, A5, A6, A7, A8, P1, P2]}) -> % v2
- Addr = {A1, A2, A3, A4, A5, A6, A7, A8},
+ {Domain, {Ip, Port}};
+transform_taddr(
+ transportDomainUdpIpv6 = Domain,
+ [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16,
+ P1, P2]) ->
+ Ip =
+ {(A1 bsl 8) bor A2, (A3 bsl 8) bor A4,
+ (A5 bsl 8) bor A6, (A7 bsl 8) bor A8,
+ (A9 bsl 8) bor A10, (A11 bsl 8) bor A12,
+ (A13 bsl 8) bor A14, (A15 bsl 8) bor A16},
Port = P1 bsl 8 + P2,
- {Addr, Port};
-transform_taddr({{?snmpUDPDomain, [A1, A2, A3, A4, P1, P2]}, _MsgData}) -> % v3
- Addr = {A1, A2, A3, A4},
- Port = P1 bsl 8 + P2,
- {Addr, Port};
-transform_taddr({{?transportDomainUdpIpv4, [A1, A2, A3, A4, P1, P2]}, _MsgData}) -> % v3
- Addr = {A1, A2, A3, A4},
- Port = P1 bsl 8 + P2,
- {Addr, Port};
-transform_taddr({{?transportDomainUdpIpv6,
- [A1, A2, A3, A4, A5, A6, A7, A8, P1, P2]}, _MsgData}) -> % v3
- Addr = {A1, A2, A3, A4, A5, A6, A7, A8},
- Port = P1 bsl 8 + P2,
- {Addr, Port}.
+ {Domain, {Ip, Port}}.
+
+%% transform_taddr({?snmpUDPDomain, [A1, A2, A3, A4, P1, P2]}) -> % v2
+%% Addr = {A1, A2, A3, A4},
+%% Port = P1 bsl 8 + P2,
+%% {Addr, Port};
+%% transform_taddr({?transportDomainUdpIpv4, [A1, A2, A3, A4, P1, P2]}) -> % v2
+%% Addr = {A1, A2, A3, A4},
+%% Port = P1 bsl 8 + P2,
+%% {Addr, Port};
+%% transform_taddr({?transportDomainUdpIpv6,
+%% [A1, A2, A3, A4, A5, A6, A7, A8, P1, P2]}) -> % v2
+%% Addr = {A1, A2, A3, A4, A5, A6, A7, A8},
+%% Port = P1 bsl 8 + P2,
+%% {Addr, Port};
+%% transform_taddr({{?snmpUDPDomain, [A1, A2, A3, A4, P1, P2]}, _MsgData}) -> % v3
+%% Addr = {A1, A2, A3, A4},
+%% Port = P1 bsl 8 + P2,
+%% {Addr, Port};
+%% transform_taddr({{?transportDomainUdpIpv4, [A1, A2, A3, A4, P1, P2]}, _MsgData}) -> % v3
+%% Addr = {A1, A2, A3, A4},
+%% Port = P1 bsl 8 + P2,
+%% {Addr, Port};
+%% transform_taddr({{?transportDomainUdpIpv6,
+%% [A1, A2, A3, A4, A5, A6, A7, A8, P1, P2]}, _MsgData}) -> % v3
+%% Addr = {A1, A2, A3, A4, A5, A6, A7, A8},
+%% Port = P1 bsl 8 + P2,
+%% {Addr, Port}.
+
check_all_varbinds(#notification{oid = Oid}, Vbs, MibView) ->
diff --git a/lib/snmp/src/agent/snmpa_usm.erl b/lib/snmp/src/agent/snmpa_usm.erl
index 6f54307f9f..fb616cd9ef 100644
--- a/lib/snmp/src/agent/snmpa_usm.erl
+++ b/lib/snmp/src/agent/snmpa_usm.erl
@@ -1,21 +1,25 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
+%% AES: RFC 3826
+%%
+
-module(snmpa_usm).
%% Avoid warning for local function error/1 clashing with autoimported BIF.
@@ -642,8 +646,9 @@ get_des_salt() ->
ets:insert(snmp_agent_table, {usm_des_salt, 0}),
0;
_ -> % it doesn't exist, initialize
- {A1,A2,A3} = erlang:now(),
- random:seed(A1,A2,A3),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
R = random:uniform(4294967295),
ets:insert(snmp_agent_table, {usm_des_salt, R}),
R
@@ -652,7 +657,10 @@ get_des_salt() ->
[?i32(EngineBoots), ?i32(SaltInt)].
aes_encrypt(PrivKey, Data) ->
- snmp_usm:aes_encrypt(PrivKey, Data, fun get_aes_salt/0).
+ EngineBoots = snmp_framework_mib:get_engine_boots(),
+ EngineTime = snmp_framework_mib:get_engine_time(),
+ snmp_usm:aes_encrypt(PrivKey, Data, fun get_aes_salt/0,
+ EngineBoots, EngineTime).
aes_decrypt(PrivKey, UsmSecParams, EncData) ->
#usmSecurityParameters{msgPrivacyParameters = PrivParams,
@@ -671,8 +679,9 @@ get_aes_salt() ->
ets:insert(snmp_agent_table, {usm_aes_salt, 0}),
0;
_ -> % it doesn't exist, initialize
- {A1,A2,A3} = erlang:now(),
- random:seed(A1,A2,A3),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
R = random:uniform(36893488147419103231),
ets:insert(snmp_agent_table, {usm_aes_salt, R}),
R
diff --git a/lib/snmp/src/agent/snmpa_vacm.erl b/lib/snmp/src/agent/snmpa_vacm.erl
index dadcf32543..f9df52010b 100644
--- a/lib/snmp/src/agent/snmpa_vacm.erl
+++ b/lib/snmp/src/agent/snmpa_vacm.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -305,8 +306,8 @@ dump_table() ->
%% time dumping the table.
unique_table_name(Pre) ->
%% We want something that is guaranteed to be unique,
- %% therefor we use erlang:now() instead of os:timestamp()
- unique_table_name(Pre, erlang:now()).
+ %% therefor we use erlang:timestamp() instead of os:timestamp()
+ unique_table_name(Pre, erlang:timestamp()).
unique_table_name(Pre, {_A, _B, C} = Now) ->
{Date, Time} = calendar:now_to_datetime(Now),
@@ -445,6 +446,3 @@ gc_tab(Oid) ->
user_err(F, A) ->
snmpa_error:user_err(F, A).
-
-% config_err(F, A) ->
-% snmpa_error:config_err(F, A).
diff --git a/lib/snmp/src/agent/snmpa_vacm.hrl b/lib/snmp/src/agent/snmpa_vacm.hrl
index 681591d212..527298e499 100644
--- a/lib/snmp/src/agent/snmpa_vacm.hrl
+++ b/lib/snmp/src/agent/snmpa_vacm.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/app/Makefile b/lib/snmp/src/app/Makefile
index f7c311b663..6f2b8a4077 100644
--- a/lib/snmp/src/app/Makefile
+++ b/lib/snmp/src/app/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
@@ -79,6 +80,8 @@ endif
# FLAGS
# ----------------------------------------------------
+ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/snmp/ebin
+
ifeq ($(WARN_UNUSED_VARS),true)
ERL_COMPILE_FLAGS += +warn_unused_vars
endif
@@ -116,10 +119,10 @@ info:
# ----------------------------------------------------
$(APP_TARGET): $(APP_SRC) ../../vsn.mk
- sed -e 's;%VSN%;$(VSN);' $< > $@
+ $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@
$(APPUP_TARGET): $(APPUP_SRC) ../../vsn.mk
- sed -e 's;%VSN%;$(VSN);' $< > $@
+ $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@
# ----------------------------------------------------
# Release Target
diff --git a/lib/snmp/src/app/depend.mk b/lib/snmp/src/app/depend.mk
index 1080cb5693..bf213c2aec 100644
--- a/lib/snmp/src/app/depend.mk
+++ b/lib/snmp/src/app/depend.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/app/modules.mk b/lib/snmp/src/app/modules.mk
index 678f15de5c..2bfd2d5c56 100644
--- a/lib/snmp/src/app/modules.mk
+++ b/lib/snmp/src/app/modules.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/app/snmp.app.src b/lib/snmp/src/app/snmp.app.src
index b11c1ef934..d4bf0de61a 100644
--- a/lib/snmp/src/app/snmp.app.src
+++ b/lib/snmp/src/app/snmp.app.src
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -22,12 +23,12 @@
{vsn, "%VSN%"},
{modules, [
%% Compiler modules (not in the runtime part of the app)
-% snmpc,
-% snmpc_lib,
-% snmpc_mib_gram,
-% snmpc_mib_to_hrl,
-% snmpc_misc,
-% snmpc_tok,
+ snmpc,
+ snmpc_lib,
+ snmpc_mib_gram,
+ snmpc_mib_to_hrl,
+ snmpc_misc,
+ snmpc_tok,
%% Application modules
snmp,
@@ -48,11 +49,15 @@
snmpa_error_io,
snmpa_error_logger,
snmpa_error_report,
- snmpa_general_db,
snmpa_local_db,
snmpa_mib,
snmpa_mib_data,
+ snmpa_mib_data_tttn,
snmpa_mib_lib,
+ snmpa_mib_storage,
+ snmpa_mib_storage_ets,
+ snmpa_mib_storage_dets,
+ snmpa_mib_storage_mnesia,
snmpa_misc_sup,
snmpa_mpd,
snmpa_net_if,
@@ -132,4 +137,6 @@
%% configuration and use), and in that case mnesia must also be started,
%% before snmp.
{applications, [kernel, stdlib]},
- {mod, {snmp_app, []}}]}.
+ {mod, {snmp_app, []}},
+ {runtime_dependencies, ["stdlib-2.5","runtime_tools-1.8.14","mnesia-4.12",
+ "kernel-3.0","erts-6.0","crypto-3.3"]}]}.
diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src
index 31f56cb73c..db09ec3dc5 100644
--- a/lib/snmp/src/app/snmp.appup.src
+++ b/lib/snmp/src/app/snmp.appup.src
@@ -1,631 +1,32 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
+%% -*- erlang -*-
{"%VSN%",
%% ----- U p g r a d e -------------------------------------------------------
-
+%% Instruction examples:
+%% {restart_application, snmp}
+%% {load_module, snmp_pdus, soft_purge, soft_purge, []}
+%% {update, snmpa_local_db, soft, soft_purge, soft_purge, []}
+%% {add_module, snmpm_net_if_mt}
[
- {"4.22.2",
- [
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []}
- ]
- },
- {"4.22.1",
- [
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []}
- ]
- },
- {"4.22",
- [
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm, soft_purge, soft_purge, []},
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}
- ]
- },
- {"4.21.7",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {add_module, snmpm_net_if_mt}
- ]
- },
- {"4.21.6",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {add_module, snmpm_net_if_mt}
- ]
- },
- {"4.21.5",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {add_module, snmpm_net_if_mt}
- ]
- },
- {"4.21.4",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {add_module, snmpm_net_if_mt}
- ]
- },
- {"4.21.3",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {add_module, snmpm_net_if_mt}
- ]
- },
- {"4.21.2",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_mpd, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {add_module, snmpm_net_if_mt}
- ]
- },
- {"4.21.1",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_mpd, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []},
-
- {add_module, snmpm_net_if_mt}
- ]
- },
- {"4.21",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_mpd, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []},
-
- {add_module, snmpm_net_if_mt}
- ]
- }
- ],
-
+ {<<"5\\.2\\.4">>,
+ [{load_module, snmp, soft_purge, soft_purge, []},
+ {load_module, snmpc_lib, soft_purge, soft_purge, []},
+ {load_module, snmpc_mib_gram, soft_purge, soft_purge, []}]},
+ {<<"5\\..*">>, [{restart_application, snmp}]},
+ {<<"4\\..*">>, [{restart_application, snmp}]}
+ ],
+
%% ------D o w n g r a d e ---------------------------------------------------
-
+%% Instruction examples:
+%% {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
+
[
- {"4.22.2",
- [
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []}
- ]
- },
- {"4.22.1",
- [
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []}
- ]
- },
- {"4.22",
- [
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm, soft_purge, soft_purge, []},
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}
- ]
- },
- {"4.21.7",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
- ]
- },
- {"4.21.6",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
- ]
- },
- {"4.21.5",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
- ]
- },
- {"4.21.4",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
- ]
- },
- {"4.21.3",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
- ]
- },
- {"4.21.2",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_mpd, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
-
- {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
- ]
- },
- {"4.21.1",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_mpd, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []},
-
- {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
- ]
- },
- {"4.21",
- [
- {load_module, snmp_pdus, soft_purge, soft_purge, []},
-
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
-
- {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
- {load_module, snmpm, soft_purge, soft_purge, [snmp]},
- {load_module, snmp_log, soft_purge, soft_purge, [snmp_verbosity]},
- {load_module, snmp_verbosity, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge, []},
-
- {load_module, snmpa, soft_purge, soft_purge, [snmp]},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
- [snmp_conf]},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_mpd, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmp_conf, snmpa_mib_lib]},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []},
-
- {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
- ]
- }
- ]
-}.
+ {<<"5\\.2\\.4">>,
+ [{load_module, snmp, soft_purge, soft_purge, []},
+ {load_module, snmpc_lib, soft_purge, soft_purge, []},
+ {load_module, snmpc_mib_gram, soft_purge, soft_purge, []}]},
+ {<<"5\\..*">>, [{restart_application, snmp}]},
+ {<<"4\\..*">>, [{restart_application, snmp}]}
+ ]
+}.
diff --git a/lib/snmp/src/app/snmp.erl b/lib/snmp/src/app/snmp.erl
index cd3e3a0055..8a736f688b 100644
--- a/lib/snmp/src/app/snmp.erl
+++ b/lib/snmp/src/app/snmp.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -49,8 +50,8 @@
read_mib/1,
- log_to_txt/5, log_to_txt/6, log_to_txt/7,
- log_to_io/4, log_to_io/5, log_to_io/6,
+ log_to_txt/5, log_to_txt/6, log_to_txt/7, log_to_txt/8,
+ log_to_io/4, log_to_io/5, log_to_io/6, log_to_io/7,
change_log_size/2,
octet_string_to_bits/1, bits_to_octet_string/1,
@@ -90,6 +91,37 @@
]).
+-export_type([
+ dir/0,
+ snmp_timer/0,
+
+ engine_id/0,
+ tdomain/0,
+ community/0,
+ mms/0,
+ version/0,
+ sec_model/0,
+ sec_name/0,
+ sec_level/0,
+
+ oid/0,
+ varbind/0,
+ ivarbind/0,
+ asn1_type/0,
+ table_info/0,
+ variable_info/0,
+ me/0,
+ trap/0,
+ notification/0,
+ pdu/0,
+ trappdu/0,
+ mib/0,
+ mib_name/0,
+
+ void/0
+ ]).
+
+
%% This is for XREF
-deprecated([{c, 1, eventually},
{c, 2, eventually},
@@ -141,6 +173,42 @@
-define(APPLICATION, snmp).
+-define(ATL_BLOCK_DEFAULT, true).
+
+-include_lib("snmp/include/snmp_types.hrl").
+
+
+%%-----------------------------------------------------------------
+%% Types
+%%-----------------------------------------------------------------
+
+-type dir() :: string().
+-type snmp_timer() :: #snmp_incr_timer{}.
+
+-type engine_id() :: string().
+-type tdomain() :: transportDomainUdpIpv4 | transportDomainUdpIpv6.
+-type community() :: string().
+-type mms() :: non_neg_integer().
+-type version() :: v1 | v2 | v3.
+-type sec_model() :: any | v1 | v2c | usm.
+-type sec_name() :: string().
+-type sec_level() :: noAuthNoPriv | authNoPriv | authPriv.
+
+-type oid() :: [non_neg_integer()].
+-type varbind() :: #varbind{}.
+-type ivarbind() :: #ivarbind{}.
+-type asn1_type() :: #asn1_type{}.
+-type table_info() :: #table_info{}.
+-type variable_info() :: #variable_info{}.
+-type me() :: #me{}.
+-type trap() :: #trap{}.
+-type notification() :: #notification{}.
+-type mib() :: #mib{}.
+-type mib_name() :: string().
+-type pdu() :: #pdu{}.
+-type trappdu() :: #trappdu{}.
+
+-type void() :: term().
%%-----------------------------------------------------------------
@@ -505,9 +573,16 @@ print_mod_info(Prefix, {Module, Info}) ->
CompDate =
case key1search(compile_time, Info) of
{value, {Year, Month, Day, Hour, Min, Sec}} ->
- lists:flatten(
- io_lib:format("~w-~2..0w-~2..0w ~2..0w:~2..0w:~2..0w",
- [Year, Month, Day, Hour, Min, Sec]));
+ io_lib:format(
+ "~w-~2..0w-~2..0w ~2..0w:~2..0w:~2..0w",
+ [Year, Month, Day, Hour, Min, Sec]);
+ _ ->
+ "Not found"
+ end,
+ Digest =
+ case key1search(md5, Info) of
+ {value, MD5} when is_binary(MD5) ->
+ [io_lib:format("~2.16.0b", [Byte]) || <<Byte>> <= MD5];
_ ->
"Not found"
end,
@@ -515,12 +590,14 @@ print_mod_info(Prefix, {Module, Info}) ->
"~s Vsn: ~s~n"
"~s App vsn: ~s~n"
"~s Compiler ver: ~s~n"
- "~s Compile time: ~s~n",
+ "~s Compile time: ~s~n"
+ "~s MD5 digest: ~s~n",
[Prefix, Module,
Prefix, Vsn,
Prefix, AppVsn,
- Prefix, CompVer,
- Prefix, CompDate]),
+ Prefix, CompVer,
+ Prefix, CompDate,
+ Prefix, Digest]),
ok.
key1search(Key, Vals) ->
@@ -549,7 +626,7 @@ versions1() ->
Error ->
Error
end.
-
+
versions2() ->
case ms2() of
{ok, Mods} ->
@@ -557,25 +634,56 @@ versions2() ->
Error ->
Error
end.
-
+
version_info(Mods) ->
SysInfo = sys_info(),
OsInfo = os_info(),
ModInfo = [mod_version_info(Mod) || Mod <- Mods],
[{sys_info, SysInfo}, {os_info, OsInfo}, {mod_info, ModInfo}].
-
+
mod_version_info(Mod) ->
Info = Mod:module_info(),
- {value, {attributes, Attr}} = lists:keysearch(attributes, 1, Info),
- {value, {vsn, [Vsn]}} = lists:keysearch(vsn, 1, Attr),
- {value, {app_vsn, AppVsn}} = lists:keysearch(app_vsn, 1, Attr),
- {value, {compile, Comp}} = lists:keysearch(compile, 1, Info),
- {value, {version, Ver}} = lists:keysearch(version, 1, Comp),
- {value, {time, Time}} = lists:keysearch(time, 1, Comp),
- {Mod, [{vsn, Vsn},
- {app_vsn, AppVsn},
- {compiler_version, Ver},
- {compile_time, Time}]}.
+ {Mod,
+ case key1search(attributes, Info) of
+ {value, Attr} ->
+ case key1search(vsn, Attr) of
+ {value, [Vsn]} ->
+ [{vsn, Vsn}];
+ not_found ->
+ []
+ end ++
+ case key1search(app_vsn, Attr) of
+ {value, AppVsn} ->
+ [{app_vsn, AppVsn}];
+ not_found ->
+ []
+ end;
+ not_found ->
+ []
+ end ++
+ case key1search(compile, Info) of
+ {value, Comp} ->
+ case key1search(version, Comp) of
+ {value, Ver} ->
+ [{compiler_version, Ver}];
+ not_found ->
+ []
+ end ++
+ case key1search(time, Comp) of
+ {value, Ver} ->
+ [{compile_time, Ver}];
+ not_found ->
+ []
+ end;
+ not_found ->
+ []
+ end ++
+ case key1search(md5, Info) of
+ {value, Bin} ->
+ [{md5, Bin}];
+ not_found ->
+ []
+ end}.
sys_info() ->
SysArch = string:strip(erlang:system_info(system_architecture),right,$\n),
@@ -838,18 +946,60 @@ read_mib(FileName) ->
%%%-----------------------------------------------------------------
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) ->
- snmp_log:log_to_txt(LogName, LogFile, LogDir, Mibs, OutFile).
+ Block = ?ATL_BLOCK_DEFAULT,
+ Start = null,
+ Stop = null,
+ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop).
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ Start = null,
+ Stop = null,
+ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop);
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) ->
- snmp_log:log_to_txt(LogName, LogFile, LogDir, Mibs, OutFile, Start).
+ Block = ?ATL_BLOCK_DEFAULT,
+ Stop = null,
+ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop).
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ Stop = null,
+ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop);
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) ->
- snmp_log:log_to_txt(LogName, LogFile, LogDir, Mibs, OutFile, Start, Stop).
+ Block = ?ATL_BLOCK_DEFAULT,
+ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop).
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop) ->
+ snmp_log:log_to_txt(LogName, Block, LogFile, LogDir, Mibs, OutFile,
+ Start, Stop).
+
log_to_io(LogDir, Mibs, LogName, LogFile) ->
- snmp_log:log_to_io(LogName, LogFile, LogDir, Mibs).
+ Block = ?ATL_BLOCK_DEFAULT,
+ Start = null,
+ Stop = null,
+ log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop).
+
+log_to_io(LogDir, Mibs, LogName, LogFile, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ Start = null,
+ Stop = null,
+ log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop);
log_to_io(LogDir, Mibs, LogName, LogFile, Start) ->
- snmp_log:log_to_io(LogName, LogFile, LogDir, Mibs, Start).
+ Block = ?ATL_BLOCK_DEFAULT,
+ Stop = null,
+ log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop).
+
+log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ Stop = null,
+ log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop);
log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) ->
- snmp_log:log_to_io(LogName, LogFile, LogDir, Mibs, Start, Stop).
+ Block = ?ATL_BLOCK_DEFAULT,
+ log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop).
+
+log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop) ->
+ snmp_log:log_to_io(LogName, Block, LogFile, LogDir, Mibs, Start, Stop).
change_log_size(LogName, NewSize) ->
snmp_log:change_size(LogName, NewSize).
@@ -862,12 +1012,12 @@ change_log_size(LogName, NewSize) ->
%% Usage: erl -s snmp str_apply '{Mod,Func,ArgList}'
str_apply([Atom]) ->
Str = atom_to_list(Atom),
- {Mod,Func,Args} = to_erlang_term(Str),
- apply(Mod,Func,Args).
+ {Mod, Func, Args} = to_erlang_term(Str),
+ apply(Mod, Func, Args).
to_erlang_term(String) ->
{ok, Tokens, _} = erl_scan:string(lists:append([String, ". "])),
- {ok,Term} = erl_parse:parse_term(Tokens),
+ {ok, Term} = erl_parse:parse_term(Tokens),
Term.
diff --git a/lib/snmp/src/app/snmp_app.erl b/lib/snmp/src/app/snmp_app.erl
index deb42cc373..dbc1ec0b6d 100644
--- a/lib/snmp/src/app/snmp_app.erl
+++ b/lib/snmp/src/app/snmp_app.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -62,17 +63,17 @@ entities([], []) ->
?d("entities -> converted config: ~n~p", [Conf]),
[{agent, Conf}]
end;
-entities([], E) ->
+entities([], Acc) ->
?d("entities -> done", []),
- lists:reverse(E);
-entities([ET|ETs], E) ->
+ lists:reverse(Acc);
+entities([Ent|Ents], Acc) ->
?d("entities -> entry with"
- "~n ET: ~p", [ET]),
- case application:get_env(snmp, ET) of
+ "~n Ent: ~p", [Ent]),
+ case application:get_env(snmp, Ent) of
{ok, Conf} ->
- entities(ETs, [{ET, Conf}|E]);
+ entities(Ents, [{Ent, Conf}|Acc]);
_ ->
- entities(ETs, E)
+ entities(Ents, Acc)
end.
start_entities(_Type, []) ->
diff --git a/lib/snmp/src/app/snmp_app_sup.erl b/lib/snmp/src/app/snmp_app_sup.erl
index d0c190b51f..eb89cc5b6d 100644
--- a/lib/snmp/src/app/snmp_app_sup.erl
+++ b/lib/snmp/src/app/snmp_app_sup.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/app/snmp_internal.hrl b/lib/snmp/src/app/snmp_internal.hrl
index 5ff715e0b7..374767df15 100644
--- a/lib/snmp/src/app/snmp_internal.hrl
+++ b/lib/snmp/src/app/snmp_internal.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -24,6 +25,8 @@
-define(APPLICATION, snmp).
-endif.
+-define(STACK(), erlang:get_stacktrace()).
+
-define(snmp_info(C, F, A), ?snmp_msg(info_msg, C, F, A)).
-define(snmp_warning(C, F, A), ?snmp_msg(warning_msg, C, F, A)).
-define(snmp_error(C, F, A), ?snmp_msg(error_msg, C, F, A)).
diff --git a/lib/snmp/src/compile/Makefile b/lib/snmp/src/compile/Makefile
index f63fc18997..4093ffa9ca 100644
--- a/lib/snmp/src/compile/Makefile
+++ b/lib/snmp/src/compile/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/compile/depend.mk b/lib/snmp/src/compile/depend.mk
index 3ee8dc4bec..57b7c19daf 100644
--- a/lib/snmp/src/compile/depend.mk
+++ b/lib/snmp/src/compile/depend.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
@@ -45,5 +46,5 @@ $(EBIN)/snmpc_mib_gram.$(EMULATOR): \
snmpc_mib_gram.erl
$(BIN)/snmpc: snmpc.src ../../vsn.mk
- $(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@
- chmod 755 $@
+ $(vsn_verbose)$(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@
+ $(V_at)chmod 755 $@
diff --git a/lib/snmp/src/compile/modules.mk b/lib/snmp/src/compile/modules.mk
index 399e4f865e..9ca5ebb95a 100644
--- a/lib/snmp/src/compile/modules.mk
+++ b/lib/snmp/src/compile/modules.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/compile/snmpc.erl b/lib/snmp/src/compile/snmpc.erl
index d94810bc0a..416353508e 100644
--- a/lib/snmp/src/compile/snmpc.erl
+++ b/lib/snmp/src/compile/snmpc.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -63,7 +64,7 @@ compile(Input, _Output, Options) ->
{ok, _} ->
ok;
{error, Reason} ->
- io:format("~p", [Reason]),
+ io:format("~tp", [Reason]),
error
end.
@@ -125,7 +126,14 @@ compile(FileName) ->
%%----------------------------------------------------------------------
compile(FileName, Options) when is_list(FileName) ->
- true = snmpc_misc:is_string(FileName),
+ case snmpc_misc:check_file(FileName) of
+ true ->
+ compile_1(FileName, Options);
+ false ->
+ {error, {invalid_file, FileName}}
+ end.
+
+compile_1(FileName, Options) ->
DefOpts = [{deprecated, true},
{group_check, true},
{i, ["./"]},
@@ -409,8 +417,9 @@ get_verbosity(Options) ->
%%----------------------------------------------------------------------
init(From, MibFileName, Options) ->
- {A,B,C} = now(),
- random:seed(A,B,C),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
put(options, Options),
put(verbosity, get_verbosity(Options)),
put(description, get_description(Options)),
diff --git a/lib/snmp/src/compile/snmpc.hrl b/lib/snmp/src/compile/snmpc.hrl
index 1c0808d065..b3c66f4f3d 100644
--- a/lib/snmp/src/compile/snmpc.hrl
+++ b/lib/snmp/src/compile/snmpc.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/compile/snmpc.src b/lib/snmp/src/compile/snmpc.src
index 6eb95be35e..e64b6607c4 100644
--- a/lib/snmp/src/compile/snmpc.src
+++ b/lib/snmp/src/compile/snmpc.src
@@ -3,18 +3,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/compile/snmpc_lib.erl b/lib/snmp/src/compile/snmpc_lib.erl
index 5a661cf194..33ddd78308 100644
--- a/lib/snmp/src/compile/snmpc_lib.erl
+++ b/lib/snmp/src/compile/snmpc_lib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2017. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -98,7 +99,7 @@ make_ASN1type({{type_with_size,Type,{range,Lo,Hi}},Line}) ->
print_error("Undefined type '~w'",[Type],Line),
guess_string_type()
end;
-make_ASN1type({{integer_with_enum,Type,Enums},Line}) ->
+make_ASN1type({{type_with_enum,Type,Enums},Line}) ->
case lookup_vartype(Type) of
{value,ASN1type} -> ASN1type#asn1_type{assocList = [{enums, Enums}]};
false ->
@@ -139,6 +140,7 @@ allow_size_rfc1902('Integer32') -> true;
allow_size_rfc1902('Unsigned32') -> true;
allow_size_rfc1902('OCTET STRING') -> true;
allow_size_rfc1902('Gauge32') -> true;
+allow_size_rfc1902('Opaque') -> true;
allow_size_rfc1902(_) -> false.
guess_integer_type() ->
diff --git a/lib/snmp/src/compile/snmpc_lib.hrl b/lib/snmp/src/compile/snmpc_lib.hrl
index 35ec9abd03..8d76817cec 100644
--- a/lib/snmp/src/compile/snmpc_lib.hrl
+++ b/lib/snmp/src/compile/snmpc_lib.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/compile/snmpc_mib_gram.yrl b/lib/snmp/src/compile/snmpc_mib_gram.yrl
index 4fd504e34b..14a668127e 100644
--- a/lib/snmp/src/compile/snmpc_mib_gram.yrl
+++ b/lib/snmp/src/compile/snmpc_mib_gram.yrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -386,10 +387,12 @@ syntax -> type : {{type, cat('$1')},line_of('$1')}.
syntax -> type size : {{type_with_size, cat('$1'), '$2'},line_of('$1')}.
syntax -> usertype size : {{type_with_size,val('$1'), '$2'},line_of('$1')}.
syntax -> 'INTEGER' '{' namedbits '}' :
- {{integer_with_enum, 'INTEGER', '$3'}, line_of('$1')}.
+ {{type_with_enum, 'INTEGER', '$3'}, line_of('$1')}.
syntax -> 'BITS' '{' namedbits '}' :
ensure_ver(2,'$1'),
{{bits, '$3'}, line_of('$1')}.
+syntax -> usertype '{' namedbits '}' :
+ {{type_with_enum, 'INTEGER', '$3'}, line_of('$1')}.
syntax -> 'SEQUENCE' 'OF' usertype :
{{sequence_of,val('$3')},line_of('$1')}.
diff --git a/lib/snmp/src/compile/snmpc_mib_to_hrl.erl b/lib/snmp/src/compile/snmpc_mib_to_hrl.erl
index e8c46a0521..bc18afbdc9 100644
--- a/lib/snmp/src/compile/snmpc_mib_to_hrl.erl
+++ b/lib/snmp/src/compile/snmpc_mib_to_hrl.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/compile/snmpc_misc.erl b/lib/snmp/src/compile/snmpc_misc.erl
index 557f3e0f6b..312074f2e7 100644
--- a/lib/snmp/src/compile/snmpc_misc.erl
+++ b/lib/snmp/src/compile/snmpc_misc.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -28,7 +29,7 @@
bits_to_int/2,
ensure_trailing_dir_delimiter/1,
foreach/3,
- is_string/1,
+ check_file/1,
read_mib/1,
read_noexit/2,
strip_extension_from_filename/2,
@@ -85,21 +86,21 @@ to_upper([C|Cs]) -> [C|to_upper(Cs)];
to_upper([]) -> [].
-is_string([]) -> true;
-is_string([Tkn | Str])
- when is_integer(Tkn) andalso (Tkn >= 0) andalso (Tkn =< 255) ->
- is_string(Str);
-is_string(_) -> false.
-
-
+check_file(FileName) ->
+ case filename:extension(FileName) of
+ ".mib" ->
+ filelib:is_regular(FileName);
+ _ ->
+ filelib:is_regular(FileName ++ ".mib")
+ end.
+
+
foreach(Function, ExtraArgs, [H | T]) ->
apply(Function, [H | ExtraArgs]),
foreach(Function, ExtraArgs, T);
foreach(_Function, _ExtraArgs, []) ->
true.
-
-
%%----------------------------------------------------------------------
%% Returns: {ok, Mib}|{error, Reason}
%% The reason for having the function if this module is:
diff --git a/lib/snmp/src/compile/snmpc_misc.hrl b/lib/snmp/src/compile/snmpc_misc.hrl
index c29f2eb9e5..2df6d1863d 100644
--- a/lib/snmp/src/compile/snmpc_misc.hrl
+++ b/lib/snmp/src/compile/snmpc_misc.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/compile/snmpc_tok.erl b/lib/snmp/src/compile/snmpc_tok.erl
index e238b256d0..9114cc90de 100644
--- a/lib/snmp/src/compile/snmpc_tok.erl
+++ b/lib/snmp/src/compile/snmpc_tok.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/manager/Makefile b/lib/snmp/src/manager/Makefile
index c76dbacf90..0cc87492f1 100644
--- a/lib/snmp/src/manager/Makefile
+++ b/lib/snmp/src/manager/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/manager/depend.mk b/lib/snmp/src/manager/depend.mk
index 2e7783c8ed..7d8f81f55a 100644
--- a/lib/snmp/src/manager/depend.mk
+++ b/lib/snmp/src/manager/depend.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
@@ -50,10 +51,11 @@ $(EBIN)/snmpm_net_if.$(EMULATOR): \
snmpm_network_interface.erl
$(EBIN)/snmpm_net_if_mt.$(EMULATOR): \
+ snmpm_net_if_mt.erl \
../../include/snmp_types.hrl \
../misc/snmp_debug.hrl \
../misc/snmp_verbosity.hrl \
- snmpm_net_if_mt.erl \
+ snmpm_net_if.erl \
snmpm_network_interface.erl
$(EBIN)/snmpm_server.$(EMULATOR): \
diff --git a/lib/snmp/src/manager/modules.mk b/lib/snmp/src/manager/modules.mk
index d46545ea3f..ea9b52d653 100644
--- a/lib/snmp/src/manager/modules.mk
+++ b/lib/snmp/src/manager/modules.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/manager/snmpm.erl b/lib/snmp/src/manager/snmpm.erl
index f590892c66..cf8c95d69f 100644
--- a/lib/snmp/src/manager/snmpm.erl
+++ b/lib/snmp/src/manager/snmpm.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -75,11 +76,10 @@
%%
%% Logging
- log_to_txt/1,
- log_to_txt/2, log_to_txt/3, log_to_txt/4,
- log_to_txt/5, log_to_txt/6, log_to_txt/7,
- log_to_io/1, log_to_io/2, log_to_io/3,
- log_to_io/4, log_to_io/5, log_to_io/6,
+ log_to_txt/1, log_to_txt/2, log_to_txt/3, log_to_txt/4,
+ log_to_txt/5, log_to_txt/6, log_to_txt/7, log_to_txt/8,
+ log_to_io/1, log_to_io/2, log_to_io/3, log_to_io/4,
+ log_to_io/5, log_to_io/6, log_to_io/7,
change_log_size/1,
get_log_type/0,
set_log_type/1,
@@ -107,63 +107,15 @@
async_get_bulk/5, async_get_bulk/6, async_get_bulk/7, async_get_bulk/8
]).
-%% Backward compatibility exports (API version "1")
--deprecated({agent_info, 3}).
--deprecated({update_agent_info, 5}).
--deprecated({g, 3}).
--deprecated({g, 4}).
--deprecated({g, 5}).
--deprecated({g, 6}).
--deprecated({g, 7}).
--deprecated({ag, 3}).
--deprecated({ag, 4}).
--deprecated({ag, 5}).
--deprecated({ag, 6}).
--deprecated({ag, 7}).
--deprecated({gn, 3}).
--deprecated({gn, 4}).
--deprecated({gn, 5}).
--deprecated({gn, 6}).
--deprecated({gn, 7}).
--deprecated({agn, 3}).
--deprecated({agn, 4}).
--deprecated({agn, 5}).
--deprecated({agn, 6}).
--deprecated({agn, 7}).
--deprecated({gb, 5}).
--deprecated({gb, 6}).
--deprecated({gb, 7}).
--deprecated({gb, 8}).
--deprecated({gb, 9}).
--deprecated({agb, 5}).
--deprecated({agb, 6}).
--deprecated({agb, 7}).
--deprecated({agb, 8}).
--deprecated({agb, 9}).
--deprecated({s, 3}).
--deprecated({s, 4}).
--deprecated({s, 5}).
--deprecated({s, 6}).
--deprecated({s, 7}).
--deprecated({as, 3}).
--deprecated({as, 4}).
--deprecated({as, 5}).
--deprecated({as, 6}).
--deprecated({as, 7}).
--export([
- agent_info/3, update_agent_info/5,
- g/3, g/4, g/5, g/6, g/7,
- ag/3, ag/4, ag/5, ag/6, ag/7,
- gn/3, gn/4, gn/5, gn/6, gn/7,
- agn/3, agn/4, agn/5, agn/6, agn/7,
- gb/5, gb/6, gb/7, gb/8, gb/9,
- agb/5, agb/6, agb/7, agb/8, agb/9,
- s/3, s/4, s/5, s/6, s/7,
- as/3, as/4, as/5, as/6, as/7
- ]).
-
%% Application internal export
-export([start_link/3, snmpm_start_verify/2, snmpm_start_verify/3]).
+-export([target_name/1, target_name/2]).
+
+-export_type([
+ register_timeout/0,
+ agent_config/0,
+ target_name/0
+ ]).
-include_lib("snmp/src/misc/snmp_debug.hrl").
@@ -173,6 +125,26 @@
-include("snmp_verbosity.hrl").
-define(DEFAULT_AGENT_PORT, 161).
+-define(ATL_BLOCK_DEFAULT, true).
+
+
+%%-----------------------------------------------------------------
+%% Types
+%%-----------------------------------------------------------------
+
+-type register_timeout() :: pos_integer() | snmp:snmp_timer().
+-type agent_config() :: {engine_id, snmp:engine_id()} | % Mandatory
+ {address, inet:ip_address()} | % Mandatory
+ {port, inet:port_number()} | % Optional
+ {tdomain, snmp:tdomain()} | % Optional
+ {community, snmp:community()} | % Optional
+ {timeout, register_timeout()} | % Optional
+ {max_message_size, snmp:mms()} | % Optional
+ {version, snmp:version()} | % Optional
+ {sec_moduel, snmp:sec_model()} | % Optional
+ {sec_name, snmp:sec_name()} | % Optional
+ {sec_level, snmp:sec_level()}. % Optional
+-type target_name() :: string().
%% This function is called when the snmp application
@@ -408,21 +380,33 @@ register_agent(UserId, Addr) ->
register_agent(UserId, Addr, ?DEFAULT_AGENT_PORT, []).
%% Backward compatibility
-register_agent(UserId, Addr, Port, Config0) ->
+register_agent(UserId, Domain, Addr, Config0) when is_atom(Domain) ->
case lists:keymember(target_name, 1, Config0) of
false ->
- TargetName = mk_target_name(Addr, Port, Config0),
- Config = [{reg_type, addr_port},
- {address, Addr}, {port, Port} | Config0],
+ TargetName = mk_target_name(Domain, Addr, Config0),
+ Config =
+ [{reg_type, addr_port},
+ {tdomain, Domain}, {taddress, Addr} | Config0],
do_register_agent(UserId, TargetName, ensure_engine_id(Config));
true ->
{value, {_, TargetName}} =
lists:keysearch(target_name, 1, Config0),
Config1 = lists:keydelete(target_name, 1, Config0),
- Config2 = [{reg_type, addr_port},
- {address, Addr}, {port, Port} | Config1],
+ Config2 =
+ [{reg_type, addr_port},
+ {tdomain, Domain}, {taddress, Addr} | Config1],
register_agent(UserId, TargetName, ensure_engine_id(Config2))
- end.
+ end;
+register_agent(UserId, Ip, Port, Config) when is_integer(Port) ->
+ Domain = snmpm_config:default_transport_domain(),
+ Addr =
+ case snmp_conf:check_address(Domain, {Ip, Port}) of
+ ok ->
+ {Ip, Port};
+ {ok, FixedAddr} ->
+ FixedAddr
+ end,
+ register_agent(UserId, Domain, Addr, Config).
unregister_agent(UserId, TargetName) when is_list(TargetName) ->
snmpm_config:unregister_agent(UserId, TargetName);
@@ -431,40 +415,24 @@ unregister_agent(UserId, TargetName) when is_list(TargetName) ->
unregister_agent(UserId, Addr) ->
unregister_agent(UserId, Addr, ?DEFAULT_AGENT_PORT).
-unregister_agent(UserId, Addr, Port) ->
- case target_name(Addr, Port) of
+unregister_agent(UserId, DomainIp, AddressPort) ->
+ case target_name(DomainIp, AddressPort) of
{ok, TargetName} ->
unregister_agent(UserId, TargetName);
Error ->
Error
end.
+
agent_info(TargetName, Item) ->
snmpm_config:agent_info(TargetName, Item).
-%% Backward compatibility
-agent_info(Addr, Port, Item) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- agent_info(TargetName, Item);
- Error ->
- Error
- end.
-
update_agent_info(UserId, TargetName, Info) when is_list(Info) ->
snmpm_config:update_agent_info(UserId, TargetName, Info).
update_agent_info(UserId, TargetName, Item, Val) ->
update_agent_info(UserId, TargetName, [{Item, Val}]).
-%% Backward compatibility functions
-update_agent_info(UserId, Addr, Port, Item, Val) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- update_agent_info(UserId, TargetName, Item, Val);
- Error ->
- Error
- end.
which_agents() ->
snmpm_config:which_agents().
@@ -552,57 +520,8 @@ sync_get(UserId, TargetName, Context, Oids, Timeout, ExtraInfo) ->
%% </BACKWARD-COMPAT>
-%% <DEPRECATED>
-g(UserId, Addr, Oids) ->
- g(UserId, Addr, ?DEFAULT_AGENT_PORT, Oids).
-
-g(UserId, Addr, CtxName, Oids) when is_list(CtxName) andalso is_list(Oids) ->
- g(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, Oids);
-
-g(UserId, Addr, Port, Oids) when is_integer(Port) andalso is_list(Oids) ->
- g(UserId, Addr, Port, ?DEFAULT_CONTEXT, Oids);
-
-g(UserId, Addr, Oids, Timeout)
- when is_list(Oids) andalso is_integer(Timeout) ->
- g(UserId, Addr, ?DEFAULT_AGENT_PORT, Oids, Timeout).
-
-g(UserId, Addr, Port, CtxName, Oids)
- when is_integer(Port) andalso is_list(CtxName) andalso is_list(Oids) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_get(UserId, TargetName, CtxName, Oids);
- Error ->
- Error
- end;
-
-g(UserId, Addr, Port, Oids, Timeout)
- when is_integer(Port) andalso is_list(Oids) andalso is_integer(Timeout) ->
- g(UserId, Addr, Port, ?DEFAULT_CONTEXT, Oids, Timeout);
-
-g(UserId, Addr, CtxName, Oids, Timeout)
- when is_list(CtxName) andalso is_list(Oids) andalso is_integer(Timeout) ->
- g(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, Oids, Timeout).
-
-g(UserId, Addr, Port, CtxName, Oids, Timeout) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_get(UserId, TargetName, CtxName, Oids, Timeout);
- Error ->
- Error
- end.
-
-g(UserId, Addr, Port, CtxName, Oids, Timeout, ExtraInfo) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_get(UserId, TargetName, CtxName, Oids, Timeout, ExtraInfo);
- Error ->
- Error
- end.
-%% </DEPRECATED>
-
-
-%% --- asynchroneous get-request ---
+%% --- asynchronous get-request ---
%%
%% The reply will be delivered to the user
%% through a call to handle_pdu/5
@@ -637,55 +556,6 @@ async_get(UserId, TargetName, Context, Oids, Expire, ExtraInfo) ->
%% </BACKWARD-COMPAT>
-%% <DEPRECATED>
-ag(UserId, Addr, Oids) ->
- ag(UserId, Addr, ?DEFAULT_AGENT_PORT, Oids).
-
-ag(UserId, Addr, Port, Oids) when is_integer(Port) andalso is_list(Oids) ->
- ag(UserId, Addr, Port, ?DEFAULT_CONTEXT, Oids);
-
-ag(UserId, Addr, CtxName, Oids) when is_list(CtxName) andalso is_list(Oids) ->
- ag(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, Oids);
-
-ag(UserId, Addr, Oids, Expire) when is_list(Oids) andalso is_integer(Expire) ->
- ag(UserId, Addr, ?DEFAULT_AGENT_PORT, ?DEFAULT_CONTEXT, Oids, Expire).
-
-ag(UserId, Addr, Port, CtxName, Oids)
- when is_integer(Port) andalso is_list(CtxName) andalso is_list(Oids) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_get(UserId, TargetName, CtxName, Oids);
- Error ->
- Error
- end;
-
-ag(UserId, Addr, Port, Oids, Expire)
- when is_integer(Port) andalso is_list(Oids) andalso is_integer(Expire) ->
- ag(UserId, Addr, Port, ?DEFAULT_CONTEXT, Oids, Expire);
-
-ag(UserId, Addr, CtxName, Oids, Expire)
- when is_list(CtxName) andalso is_list(Oids) andalso is_integer(Expire) ->
- ag(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, Oids, Expire).
-
-ag(UserId, Addr, Port, CtxName, Oids, Expire) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_get(UserId, TargetName, CtxName, Oids, Expire);
- Error ->
- Error
- end.
-
-ag(UserId, Addr, Port, CtxName, Oids, Expire, ExtraInfo) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_get(UserId, TargetName, CtxName, Oids, Expire, ExtraInfo);
- Error ->
- Error
- end.
-%% </DEPRECATED>
-
-
-
%% --- synchroneous get_next-request ---
%%
@@ -719,56 +589,7 @@ sync_get_next(UserId, TargetName, Context, Oids, Timeout, ExtraInfo) ->
%% </BACKWARD-COMPAT>
-%% <DEPRECATED>
-gn(UserId, Addr, Oids) ->
- gn(UserId, Addr, ?DEFAULT_AGENT_PORT, Oids).
-
-gn(UserId, Addr, CtxName, Oids) when is_list(CtxName) andalso is_list(Oids) ->
- gn(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, Oids);
-
-gn(UserId, Addr, Port, Oids) when is_integer(Port) andalso is_list(Oids) ->
- gn(UserId, Addr, Port, ?DEFAULT_CONTEXT, Oids);
-
-gn(UserId, Addr, Oids, Timeout)
- when is_list(Oids) andalso is_integer(Timeout) ->
- gn(UserId, Addr, ?DEFAULT_AGENT_PORT, Oids, Timeout).
-
-gn(UserId, Addr, Port, CtxName, Oids)
- when is_integer(Port) andalso is_list(CtxName) andalso is_list(Oids) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_get_next(UserId, TargetName, CtxName, Oids);
- Error ->
- Error
- end;
-
-gn(UserId, Addr, Port, Oids, Timeout)
- when is_integer(Port) andalso is_list(Oids) andalso is_integer(Timeout) ->
- gn(UserId, Addr, Port, ?DEFAULT_CONTEXT, Oids, Timeout);
-gn(UserId, Addr, CtxName, Oids, Timeout)
- when is_list(CtxName) andalso is_list(Oids) andalso is_integer(Timeout) ->
- gn(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, Oids, Timeout).
-
-gn(UserId, Addr, Port, CtxName, Oids, Timeout) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_get_next(UserId, TargetName, CtxName, Oids, Timeout);
- Error ->
- Error
- end.
-
-gn(UserId, Addr, Port, CtxName, Oids, Timeout, ExtraInfo) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_get_next(UserId, TargetName, CtxName, Oids, Timeout, ExtraInfo);
- Error ->
- Error
- end.
-%% </DEPRECATED>
-
-
-
-%% --- asynchroneous get_next-request ---
+%% --- asynchronous get_next-request ---
%%
async_get_next2(UserId, TargetName, Oids) ->
@@ -801,56 +622,6 @@ async_get_next(UserId, TargetName, Context, Oids, Expire, ExtraInfo) ->
%% </BACKWARD-COMPAT>
-%% <DEPRECATED>
-agn(UserId, Addr, Oids) ->
- agn(UserId, Addr, ?DEFAULT_AGENT_PORT, Oids).
-
-agn(UserId, Addr, CtxName, Oids) when is_list(CtxName) andalso is_list(Oids) ->
- agn(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, Oids);
-
-agn(UserId, Addr, Port, Oids) when is_integer(Port) andalso is_list(Oids) ->
- agn(UserId, Addr, Port, ?DEFAULT_CONTEXT, Oids);
-
-agn(UserId, Addr, Oids, Expire)
- when is_list(Oids) andalso is_integer(Expire) ->
- agn(UserId, Addr, ?DEFAULT_AGENT_PORT, Oids, Expire).
-
-agn(UserId, Addr, Port, CtxName, Oids)
- when is_integer(Port) andalso is_list(CtxName) andalso is_list(Oids) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_get_next(UserId, TargetName, CtxName, Oids);
- Error ->
- Error
- end;
-
-agn(UserId, Addr, Port, Oids, Expire)
- when is_integer(Port) andalso is_list(Oids) andalso is_integer(Expire) ->
- agn(UserId, Addr, Port, ?DEFAULT_CONTEXT, Oids, Expire);
-agn(UserId, Addr, CtxName, Oids, Expire)
- when is_list(CtxName) andalso is_list(CtxName) andalso is_integer(Expire) ->
- agn(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, Oids, Expire).
-
-agn(UserId, Addr, Port, CtxName, Oids, Expire) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_get_next(UserId, TargetName, CtxName, Oids, Expire);
- Error ->
- Error
- end.
-
-agn(UserId, Addr, Port, CtxName, Oids, Expire, ExtraInfo) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_get_next(UserId, TargetName, CtxName, Oids, Expire,
- ExtraInfo);
- Error ->
- Error
- end.
-%% </DEPRECATED>
-
-
-
%% --- synchroneous set-request ---
%%
@@ -884,65 +655,7 @@ sync_set(UserId, TargetName, Context, VarsAndVals, Timeout, ExtraInfo) ->
%% </BACKWARD-COMPAT>
-%% <DEPRECATED>
-s(UserId, Addr, VarsAndVals) ->
- s(UserId, Addr, ?DEFAULT_AGENT_PORT, VarsAndVals).
-
-s(UserId, Addr, Port, VarsAndVals)
- when is_integer(Port) andalso is_list(VarsAndVals) ->
- s(UserId, Addr, Port, ?DEFAULT_CONTEXT, VarsAndVals);
-
-s(UserId, Addr, CtxName, VarsAndVals)
- when is_list(CtxName) andalso is_list(VarsAndVals) ->
- s(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, VarsAndVals);
-
-s(UserId, Addr, VarsAndVals, Timeout)
- when is_list(VarsAndVals) andalso is_integer(Timeout) ->
- s(UserId, Addr, ?DEFAULT_AGENT_PORT, VarsAndVals, Timeout).
-
-s(UserId, Addr, Port, CtxName, VarsAndVals)
- when is_integer(Port) andalso
- is_list(CtxName) andalso
- is_list(VarsAndVals) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_set(UserId, TargetName, CtxName, VarsAndVals);
- Error ->
- Error
- end;
-
-s(UserId, Addr, Port, VarsAndVals, Timeout)
- when is_integer(Port) andalso
- is_list(VarsAndVals) andalso
- is_integer(Timeout) ->
- s(UserId, Addr, Port, ?DEFAULT_CONTEXT, VarsAndVals, Timeout);
-
-s(UserId, Addr, CtxName, VarsAndVals, Timeout)
- when is_list(CtxName) andalso
- is_list(VarsAndVals) andalso
- is_integer(Timeout) ->
- s(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, VarsAndVals, Timeout).
-
-s(UserId, Addr, Port, CtxName, VarsAndVals, Timeout) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_set(UserId, TargetName, CtxName, VarsAndVals, Timeout);
- Error ->
- Error
- end.
-
-s(UserId, Addr, Port, CtxName, VarsAndVals, Timeout, ExtraInfo) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_set(UserId, TargetName, CtxName, VarsAndVals, Timeout, ExtraInfo);
- Error ->
- Error
- end.
-%% </DEPRECATED>
-
-
-
-%% --- asynchroneous set-request ---
+%% --- asynchronous set-request ---
%%
async_set2(UserId, TargetName, VarsAndVals) ->
@@ -975,63 +688,6 @@ async_set(UserId, TargetName, Context, VarsAndVals, Expire, ExtraInfo) ->
%% </BACKWARD-COMPAT>
-%% <DEPRECATED>
-as(UserId, Addr, VarsAndVals) ->
- as(UserId, Addr, ?DEFAULT_AGENT_PORT, VarsAndVals).
-
-as(UserId, Addr, Port, VarsAndVals)
- when is_integer(Port) andalso is_list(VarsAndVals) ->
- as(UserId, Addr, Port, ?DEFAULT_CONTEXT, VarsAndVals);
-
-as(UserId, Addr, CtxName, VarsAndVals)
- when is_list(CtxName) andalso is_list(VarsAndVals) ->
- as(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, VarsAndVals);
-
-as(UserId, Addr, VarsAndVals, Expire)
- when is_list(VarsAndVals) andalso is_integer(Expire) ->
- as(UserId, Addr, ?DEFAULT_AGENT_PORT, VarsAndVals, Expire).
-
-as(UserId, Addr, Port, CtxName, VarsAndVals)
- when is_integer(Port) andalso
- is_list(CtxName) andalso
- is_list(VarsAndVals) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_set(UserId, TargetName, CtxName, VarsAndVals);
- Error ->
- Error
- end;
-
-as(UserId, Addr, Port, VarsAndVals, Expire)
- when is_integer(Port) andalso
- is_list(VarsAndVals) andalso
- is_integer(Expire) ->
- as(UserId, Addr, Port, ?DEFAULT_CONTEXT, VarsAndVals, Expire);
-
-as(UserId, Addr, CtxName, VarsAndVals, Expire)
- when is_list(CtxName) andalso
- is_list(VarsAndVals) andalso
- is_integer(Expire) ->
- as(UserId, Addr, ?DEFAULT_AGENT_PORT, CtxName, VarsAndVals, Expire).
-
-as(UserId, Addr, Port, CtxName, VarsAndVals, Expire) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_set(UserId, TargetName, CtxName, VarsAndVals, Expire);
- Error ->
- Error
- end.
-
-as(UserId, Addr, Port, CtxName, VarsAndVals, Expire, ExtraInfo) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_set(UserId, TargetName, CtxName, VarsAndVals, Expire, ExtraInfo);
- Error ->
- Error
- end.
-%% </DEPRECATED>
-
-
%% --- synchroneous get-bulk ---
%%
@@ -1091,163 +747,7 @@ sync_get_bulk(UserId, TargetName, NonRep, MaxRep, Context, Oids, Timeout,
%% </BACKWARD-COMPAT>
-%% <DEPRECATED>
-gb(UserId, Addr, NonRep, MaxRep, Oids) ->
- %% p("gb -> entry with"
- %% "~n UserId: ~p"
- %% "~n Addr: ~p"
- %% "~n NonRep: ~p"
- %% "~n MaxRep: ~p"
- %% "~n Oids: ~p",
- %% [UserId, Addr, NonRep, MaxRep, Oids]),
- gb(UserId, Addr, ?DEFAULT_AGENT_PORT, NonRep, MaxRep, Oids).
-
-gb(UserId, Addr, Port, NonRep, MaxRep, Oids)
- when is_integer(Port) andalso
- is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(Oids) ->
- %% p("gb -> entry with"
- %% "~n UserId: ~p"
- %% "~n Addr: ~p"
- %% "~n Port: ~p"
- %% "~n NonRep: ~p"
- %% "~n MaxRep: ~p"
- %% "~n Oids: ~p",
- %% [UserId, Addr, Port, NonRep, MaxRep, Oids]),
- gb(UserId, Addr, Port, NonRep, MaxRep, ?DEFAULT_CONTEXT, Oids);
-
-gb(UserId, Addr, NonRep, MaxRep, CtxName, Oids)
- when is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(CtxName) andalso
- is_list(Oids) ->
- %% p("gb -> entry with"
- %% "~n UserId: ~p"
- %% "~n Addr: ~p"
- %% "~n NonRep: ~p"
- %% "~n MaxRep: ~p"
- %% "~n CtxName: ~p"
- %% "~n Oids: ~p",
- %% [UserId, Addr, NonRep, MaxRep, CtxName, Oids]),
- gb(UserId, Addr, ?DEFAULT_AGENT_PORT, NonRep, MaxRep, CtxName, Oids);
-
-gb(UserId, Addr, NonRep, MaxRep, Oids, Timeout)
- when is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(Oids) andalso
- is_integer(Timeout) ->
- %% p("gb -> entry with"
- %% "~n UserId: ~p"
- %% "~n Addr: ~p"
- %% "~n NonRep: ~p"
- %% "~n MaxRep: ~p"
- %% "~n Oids: ~p"
- %% "~n Timeout: ~p",
- %% [UserId, Addr, NonRep, MaxRep, Oids, Timeout]),
- gb(UserId, Addr, ?DEFAULT_AGENT_PORT, NonRep, MaxRep, Oids, Timeout).
-
-gb(UserId, Addr, Port, NonRep, MaxRep, CtxName, Oids)
- when is_integer(Port) andalso
- is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(CtxName) andalso
- is_list(Oids) ->
- %% p("gb -> entry with"
- %% "~n UserId: ~p"
- %% "~n Addr: ~p"
- %% "~n Port: ~p"
- %% "~n NonRep: ~p"
- %% "~n MaxRep: ~p"
- %% "~n CtxName: ~p"
- %% "~n Oids: ~p",
- %% [UserId, Addr, Port, NonRep, MaxRep, CtxName, Oids]),
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- %% p("gb -> TargetName: ~p", [TargetName]),
- sync_get_bulk(UserId, TargetName, NonRep, MaxRep, CtxName, Oids);
- Error ->
- Error
- end;
-
-gb(UserId, Addr, Port, NonRep, MaxRep, Oids, Timeout)
- when is_integer(Port) andalso
- is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(Oids) andalso
- is_integer(Timeout) ->
- %% p("gb -> entry with"
- %% "~n UserId: ~p"
- %% "~n Addr: ~p"
- %% "~n Port: ~p"
- %% "~n NonRep: ~p"
- %% "~n MaxRep: ~p"
- %% "~n Oids: ~p"
- %% "~n Timeout: ~p",
- %% [UserId, Addr, Port, NonRep, MaxRep, Oids, Timeout]),
- gb(UserId, Addr, Port, NonRep, MaxRep, ?DEFAULT_CONTEXT, Oids, Timeout);
-
-gb(UserId, Addr, NonRep, MaxRep, CtxName, Oids, Timeout)
- when is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(CtxName) andalso
- is_list(Oids) andalso
- is_integer(Timeout) ->
- %% p("gb -> entry with"
- %% "~n UserId: ~p"
- %% "~n Addr: ~p"
- %% "~n NonRep: ~p"
- %% "~n MaxRep: ~p"
- %% "~n CtxName: ~p"
- %% "~n Oids: ~p"
- %% "~n Timeout: ~p",
- %% [UserId, Addr, NonRep, MaxRep, CtxName, Oids, Timeout]),
- gb(UserId, Addr, ?DEFAULT_AGENT_PORT, NonRep, MaxRep, CtxName, Oids,
- Timeout).
-
-gb(UserId, Addr, Port, NonRep, MaxRep, CtxName, Oids, Timeout) ->
- %% p("gb -> entry with"
- %% "~n UserId: ~p"
- %% "~n Addr: ~p"
- %% "~n Port: ~p"
- %% "~n NonRep: ~p"
- %% "~n MaxRep: ~p"
- %% "~n CtxName: ~p"
- %% "~n Oids: ~p"
- %% "~n Timeout: ~p",
- %% [UserId, Addr, Port, NonRep, MaxRep, CtxName, Oids, Timeout]),
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_get_bulk(UserId, TargetName,
- NonRep, MaxRep, CtxName, Oids, Timeout);
- Error ->
- Error
- end.
-
-gb(UserId, Addr, Port, NonRep, MaxRep, CtxName, Oids, Timeout, ExtraInfo) ->
- %% p("gb -> entry with"
- %% "~n UserId: ~p"
- %% "~n Addr: ~p"
- %% "~n Port: ~p"
- %% "~n NonRep: ~p"
- %% "~n MaxRep: ~p"
- %% "~n CtxName: ~p"
- %% "~n Oids: ~p"
- %% "~n Timeout: ~p"
- %% "~n ExtraInfo: ~p",
- %% [UserId, Addr, Port, NonRep, MaxRep, CtxName, Oids, Timeout, ExtraInfo]),
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- sync_get_bulk(UserId, TargetName,
- NonRep, MaxRep, CtxName, Oids, Timeout, ExtraInfo);
- Error ->
- Error
- end.
-%% </DEPRECATED>
-
-
-
-%% --- asynchroneous get-bulk ---
+%% --- asynchronous get-bulk ---
%%
async_get_bulk2(UserId, TargetName, NonRep, MaxRep, Oids) ->
@@ -1291,81 +791,6 @@ async_get_bulk(UserId, TargetName, NonRep, MaxRep, Context, Oids, Expire,
%% </BACKWARD-COMPAT>
-%% <DEPRECATED>
-agb(UserId, Addr, NonRep, MaxRep, Oids) ->
- agb(UserId, Addr, ?DEFAULT_AGENT_PORT, NonRep, MaxRep, Oids).
-
-agb(UserId, Addr, Port, NonRep, MaxRep, Oids)
- when is_integer(Port) andalso
- is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(Oids) ->
- agb(UserId, Addr, Port, NonRep, MaxRep, ?DEFAULT_CONTEXT, Oids);
-
-agb(UserId, Addr, NonRep, MaxRep, CtxName, Oids)
- when is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(CtxName) andalso
- is_list(Oids) ->
- agb(UserId, Addr, ?DEFAULT_AGENT_PORT, NonRep, MaxRep, CtxName, Oids);
-
-agb(UserId, Addr, NonRep, MaxRep, Oids, Expire)
- when is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(Oids) andalso
- is_integer(Expire) ->
- agb(UserId, Addr, ?DEFAULT_AGENT_PORT, NonRep, MaxRep, Oids, Expire).
-
-agb(UserId, Addr, Port, NonRep, MaxRep, CtxName, Oids)
- when is_integer(Port) andalso
- is_integer(NonRep) andalso
- is_integer(MaxRep),
- is_list(CtxName) andalso
- is_list(Oids) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_get_bulk(UserId, TargetName,
- NonRep, MaxRep, CtxName, Oids);
- Error ->
- Error
- end;
-
-agb(UserId, Addr, Port, NonRep, MaxRep, Oids, Expire)
- when is_integer(Port) andalso
- is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(Oids) andalso
- is_integer(Expire) ->
- agb(UserId, Addr, Port, NonRep, MaxRep, ?DEFAULT_CONTEXT, Oids, Expire);
-
-agb(UserId, Addr, NonRep, MaxRep, CtxName, Oids, Expire)
- when is_integer(NonRep) andalso
- is_integer(MaxRep) andalso
- is_list(CtxName) andalso
- is_list(Oids) andalso
- is_integer(Expire) ->
- agb(UserId, Addr, ?DEFAULT_AGENT_PORT, NonRep, MaxRep, CtxName, Oids).
-
-agb(UserId, Addr, Port, NonRep, MaxRep, CtxName, Oids, Expire) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_get_bulk(UserId, TargetName,
- NonRep, MaxRep, CtxName, Oids, Expire);
- Error ->
- Error
- end.
-
-agb(UserId, Addr, Port, NonRep, MaxRep, CtxName, Oids, Expire, ExtraInfo) ->
- case target_name(Addr, Port) of
- {ok, TargetName} ->
- async_get_bulk(UserId, TargetName,
- NonRep, MaxRep, CtxName, Oids, Expire,
- ExtraInfo);
- Error ->
- Error
- end.
-%% </DEPRECATED>
-
cancel_async_request(UserId, ReqId) ->
snmpm_server:cancel_async_request(UserId, ReqId).
@@ -1375,43 +800,204 @@ cancel_async_request(UserId, ReqId) ->
%%% Audit Trail Log functions (for backward compatibility)
%%%-----------------------------------------------------------------
+-spec log_to_txt(LogDir :: snmp:dir()) ->
+ snmp:void().
+
log_to_txt(LogDir) ->
log_to_txt(LogDir, []).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()]) ->
+ snmp:void().
+
+log_to_txt(LogDir, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ Mibs = [],
+ OutFile = "snmpm_log.txt",
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
log_to_txt(LogDir, Mibs) ->
+ Block = ?ATL_BLOCK_DEFAULT,
+ OutFile = "snmpm_log.txt",
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
OutFile = "snmpm_log.txt",
LogName = ?audit_trail_log_name,
LogFile = ?audit_trail_log_file,
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile).
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
log_to_txt(LogDir, Mibs, OutFile) ->
+ Block = ?ATL_BLOCK_DEFAULT,
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
LogName = ?audit_trail_log_name,
LogFile = ?audit_trail_log_file,
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile).
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
log_to_txt(LogDir, Mibs, OutFile, LogName) ->
+ Block = ?ATL_BLOCK_DEFAULT,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
LogFile = ?audit_trail_log_file,
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile).
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) ->
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Block :: boolean()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Start :: snmp_log:log_time()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block);
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) ->
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Block :: boolean(),
+ Start :: snmp_log:log_time()) ->
+ snmp:void();
+ (LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Start :: snmp_log:log_time(),
+ Stop :: snmp_log:log_time()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start);
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) ->
- snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop).
+
+-spec log_to_txt(LogDir :: snmp:dir(),
+ Mibs :: [snmp:mib_name()],
+ OutFile :: file:filename(),
+ LogName :: string(),
+ LogFile :: string(),
+ Block :: boolean(),
+ Start :: snmp_log:log_time(),
+ Stop :: snmp_log:log_time()) ->
+ snmp:void().
+
+log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop) ->
+ snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop).
log_to_io(LogDir) ->
log_to_io(LogDir, []).
+
+log_to_io(LogDir, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ Mibs = [],
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block);
log_to_io(LogDir, Mibs) ->
LogName = ?audit_trail_log_name,
LogFile = ?audit_trail_log_file,
snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+
+log_to_io(LogDir, Mibs, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block);
log_to_io(LogDir, Mibs, LogName) ->
+ Block = ?ATL_BLOCK_DEFAULT,
LogFile = ?audit_trail_log_file,
- snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block).
+
+log_to_io(LogDir, Mibs, LogName, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block);
log_to_io(LogDir, Mibs, LogName, LogFile) ->
- snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block).
+
+log_to_io(LogDir, Mibs, LogName, LogFile, Block)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block);
log_to_io(LogDir, Mibs, LogName, LogFile, Start) ->
- snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start).
+
+log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start);
log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) ->
- snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop).
+ Block = ?ATL_BLOCK_DEFAULT,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop).
+
+log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop).
change_log_size(NewSize) ->
@@ -1457,7 +1043,7 @@ sys_up_time() ->
format_reason(Reason) ->
format_reason("", Reason).
-format_reason(Prefix, Reason) when is_integer(Prefix) and (Prefix >= 0) ->
+format_reason(Prefix, Reason) when is_integer(Prefix) andalso (Prefix >= 0) ->
format_reason(lists:duplicate(Prefix, $ ), Reason);
format_reason(Prefix, Reason) when is_list(Prefix) ->
case (catch do_format_reason(Prefix, Reason)) of
@@ -1691,11 +1277,17 @@ format_vb_value(Prefix, _Type, Val) ->
%% --- Internal utility functions ---
%%
-target_name(Addr, Port) ->
- snmpm_config:agent_info(Addr, Port, target_name).
+target_name(Ip) ->
+ target_name(Ip, ?DEFAULT_AGENT_PORT).
+
+target_name(DomainIp, AddressPort) ->
+ snmpm_config:agent_info(DomainIp, AddressPort, target_name).
mk_target_name(Addr, Port, Config) ->
- snmpm_config:mk_target_name(Addr, Port, Config).
+ R = snmpm_config:mk_target_name(Addr, Port, Config),
+ p(?MODULE_STRING":mk_target_name(~p, ~p, ~p) -> ~p.~n",
+ [Addr, Port, Config, R]),
+ R.
ensure_engine_id(Config) ->
case lists:keymember(engine_id, 1, Config) of
@@ -1711,5 +1303,5 @@ ensure_engine_id(Config) ->
%% p(F) ->
%% p(F, []).
-%% p(F, A) ->
-%% io:format("~w:" ++ F ++ "~n", [?MODULE | A]).
+p(F, A) ->
+ io:format("~w:" ++ F ++ "~n", [?MODULE | A]).
diff --git a/lib/snmp/src/manager/snmpm_atl.hrl b/lib/snmp/src/manager/snmpm_atl.hrl
index d99ee05ae6..988b75d9bd 100644
--- a/lib/snmp/src/manager/snmpm_atl.hrl
+++ b/lib/snmp/src/manager/snmpm_atl.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/manager/snmpm_conf.erl b/lib/snmp/src/manager/snmpm_conf.erl
index e50508c489..0421f49c88 100644
--- a/lib/snmp/src/manager/snmpm_conf.erl
+++ b/lib/snmp/src/manager/snmpm_conf.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -78,42 +79,25 @@ write_manager_config(Dir, Conf) ->
Hdr = header() ++ Comment,
write_manager_config(Dir, Hdr, Conf).
-write_manager_config(Dir, Hdr, Conf)
- when is_list(Dir) andalso is_list(Hdr) andalso is_list(Conf) ->
- Verify = fun() -> verify_manager_conf(Conf) end,
- Write = fun(Fid) -> write_manager_conf(Fid, Hdr, Conf) end,
- write_config_file(Dir, ?MANAGER_CONF_FILE, Verify, Write).
-
+write_manager_config(Dir, Hdr, Conf)
+ when is_list(Dir), is_list(Hdr), is_list(Conf) ->
+ Order = fun snmpm_config:order_manager_config/2,
+ Check = fun snmpm_config:check_manager_config/2,
+ Write = fun (Fd, Entries) -> write_manager_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, ?MANAGER_CONF_FILE, Order, Check, Write, Conf).
append_manager_config(Dir, Conf)
- when is_list(Dir) andalso is_list(Conf) ->
- Verify = fun() -> verify_manager_conf(Conf) end,
- Write = fun(Fid) -> write_manager_conf(Fid, Conf) end,
- append_config_file(Dir, ?MANAGER_CONF_FILE, Verify, Write).
-
-
-read_manager_config(Dir) ->
- Verify = fun(Entry) -> verify_manager_conf_entry(Entry) end,
- read_config_file(Dir, ?MANAGER_CONF_FILE, Verify).
+ when is_list(Dir), is_list(Conf) ->
+ Order = fun snmpm_config:order_manager_config/2,
+ Check = fun snmpm_config:check_manager_config/2,
+ Write = fun write_manager_conf/2,
+ append_config_file(Dir, ?MANAGER_CONF_FILE, Order, Check, Write, Conf).
+read_manager_config(Dir) when is_list(Dir) ->
+ Order = fun snmpm_config:order_manager_config/2,
+ Check = fun snmpm_config:check_manager_config/2,
+ read_config_file(Dir, ?MANAGER_CONF_FILE, Order, Check).
-verify_manager_conf([]) ->
- ok;
-verify_manager_conf([H|T]) ->
- verify_manager_conf_entry(H),
- verify_manager_conf(T);
-verify_manager_conf(X) ->
- error({bad_manager_config, X}).
-
-verify_manager_conf_entry(Entry) ->
- case snmpm_config:check_manager_config(Entry) of
- ok ->
- ok;
-%% {ok, _} ->
-%% ok;
- Error ->
- throw(Error)
- end.
write_manager_conf(Fd, "", Conf) ->
write_manager_conf(Fd, Conf);
@@ -127,14 +111,16 @@ write_manager_conf(Fd, [H|T]) ->
do_write_manager_conf(Fd, H),
write_manager_conf(Fd, T).
-do_write_manager_conf(Fd, {address = Tag, Val}) ->
+do_write_manager_conf(Fd, {Tag, Val})
+ when Tag =:= domain;
+ Tag =:= address;
+ Tag =:= port;
+ Tag =:= transports;
+ Tag =:= max_message_size ->
io:format(Fd, "{~w, ~w}.~n", [Tag, Val]);
-do_write_manager_conf(Fd, {port = Tag, Val} ) ->
- io:format(Fd, "{~w, ~w}.~n", [Tag, Val]);
-do_write_manager_conf(Fd, {engine_id = Tag, Val} ) ->
+do_write_manager_conf(Fd, {Tag, Val})
+ when Tag =:= engine_id ->
io:format(Fd, "{~w, \"~s\"}.~n", [Tag, Val]);
-do_write_manager_conf(Fd, {max_message_size = Tag, Val} ) ->
- io:format(Fd, "{~w, ~w}.~n", [Tag, Val]);
do_write_manager_conf(_Fd, Crap) ->
error({bad_manager_config, Crap}).
@@ -167,36 +153,29 @@ write_users_config(Dir, Conf) ->
Hdr = header() ++ Comment,
write_users_config(Dir, Hdr, Conf).
-write_users_config(Dir, Hdr, Conf)
+write_users_config(Dir, Hdr, Conf)
when is_list(Dir) andalso is_list(Hdr) andalso is_list(Conf) ->
- Verify = fun() -> verify_users_conf(Conf) end,
- Write = fun(Fd) -> write_users_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, ?USERS_CONF_FILE, Verify, Write).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_user_config/2,
+ Write = fun (Fd, Entries) -> write_users_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, ?USERS_CONF_FILE, Order, Check, Write, Conf).
-
-append_users_config(Dir, Conf)
+append_users_config(Dir, Conf)
when is_list(Dir) andalso is_list(Conf) ->
- Verify = fun() -> verify_users_conf(Conf) end,
- Write = fun(Fd) -> write_users_conf(Fd, Conf) end,
- append_config_file(Dir, ?USERS_CONF_FILE, Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_user_config/2,
+ Write = fun write_users_conf/2,
+ append_config_file(Dir, ?USERS_CONF_FILE, Order, Check, Write, Conf).
read_users_config(Dir) when is_list(Dir) ->
- Verify = fun(Entry) -> verify_users_conf_entry(Entry) end,
- read_config_file(Dir, ?USERS_CONF_FILE, Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_user_config/2,
+ read_config_file(Dir, ?USERS_CONF_FILE, Order, Check).
-
-verify_users_conf([]) ->
- ok;
-verify_users_conf([H|T]) ->
- verify_users_conf_entry(H),
- verify_users_conf(T);
-verify_users_conf(X) ->
- error({bad_users_conf, X}).
-
-verify_users_conf_entry(Entry) ->
- {ok, _} = snmpm_config:check_user_config(Entry),
- ok.
+
+check_user_config(Entry, State) ->
+ {check_ok(snmpm_config:check_user_config(Entry)),
+ State}.
write_users_conf(Fd, "", Conf) ->
write_users_conf(Fd, Conf);
@@ -222,9 +201,10 @@ do_write_users_conf(_Fd, Crap) ->
%% ------ agents.conf ------
%%
-agents_entry(UserId, TargetName, Comm, Ip, Port, EngineID, Timeout,
- MaxMessageSize, Version, SecModel, SecName, SecLevel) ->
- {UserId, TargetName, Comm, Ip, Port, EngineID, Timeout,
+agents_entry(
+ UserId, TargetName, Comm, Domain_or_Ip, Addr_or_Port, EngineID, Timeout,
+ MaxMessageSize, Version, SecModel, SecName, SecLevel) ->
+ {UserId, TargetName, Comm, Domain_or_Ip, Addr_or_Port, EngineID, Timeout,
MaxMessageSize, Version, SecModel, SecName, SecLevel}.
@@ -239,36 +219,29 @@ write_agents_config(Dir, Conf) ->
Hdr = header() ++ Comment,
write_agents_config(Dir, Hdr, Conf).
-write_agents_config(Dir, Hdr, Conf)
+write_agents_config(Dir, Hdr, Conf)
when is_list(Dir) andalso is_list(Hdr) andalso is_list(Conf) ->
- Verify = fun() -> verify_agents_conf(Conf) end,
- Write = fun(Fd) -> write_agents_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, ?AGENTS_CONF_FILE, Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_agent_config/2,
+ Write = fun (Fd, Entries) -> write_agents_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, ?AGENTS_CONF_FILE, Order, Check, Write, Conf).
-append_agents_config(Dir, Conf)
+append_agents_config(Dir, Conf)
when is_list(Dir) andalso is_list(Conf) ->
- Verify = fun() -> verify_agents_conf(Conf) end,
- Write = fun(Fd) -> write_agents_conf(Fd, Conf) end,
- append_config_file(Dir, ?AGENTS_CONF_FILE, Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_agent_config/2,
+ Write = fun write_agents_conf/2,
+ append_config_file(Dir, ?AGENTS_CONF_FILE, Order, Check, Write, Conf).
read_agents_config(Dir) ->
- Verify = fun(Entry) -> verify_agents_conf_entry(Entry) end,
- read_config_file(Dir, ?AGENTS_CONF_FILE, Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_agent_config/2,
+ read_config_file(Dir, ?AGENTS_CONF_FILE, Order, Check).
-verify_agents_conf([]) ->
- ok;
-verify_agents_conf([H|T]) ->
- verify_agents_conf_entry(H),
- verify_agents_conf(T);
-verify_agents_conf(X) ->
- error({bad_agents_config, X}).
-
-verify_agents_conf_entry(Entry) ->
- {ok, _} = snmpm_config:check_agent_config(Entry),
- ok.
+check_agent_config(Entry, State) ->
+ {check_ok(snmpm_config:check_agent_config(Entry)),
+ State}.
write_agents_conf(Fd, "", Conf) ->
write_agents_conf(Fd, Conf);
@@ -282,13 +255,15 @@ write_agents_conf(Fd, [H|T]) ->
do_write_agents_conf(Fd, H),
write_agents_conf(Fd, T).
-do_write_agents_conf(Fd,
- {UserId,
- TargetName, Comm, Ip, Port, EngineID,
- Timeout, MaxMessageSize, Version,
- SecModel, SecName, SecLevel} = _A) ->
- io:format(Fd,
- "{~w, \"~s\", \"~s\", ~w, ~w, \"~s\", ~w, ~w, ~w, ~w, \"~s\", ~w}.~n", [UserId, TargetName, Comm, Ip, Port, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel]);
+do_write_agents_conf(
+ Fd,
+ {UserId, TargetName, Comm, Ip, Port, EngineID,
+ Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel} = _A) ->
+ io:format(
+ Fd,
+ "{~w, \"~s\", \"~s\", ~w, ~w, \"~s\", ~w, ~w, ~w, ~w, \"~s\", ~w}.~n",
+ [UserId, TargetName, Comm, Ip, Port, EngineID,
+ Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel]);
do_write_agents_conf(_Fd, Crap) ->
error({bad_agents_config, Crap}).
@@ -314,37 +289,30 @@ write_usm_config(Dir, Conf) ->
Hdr = header() ++ Comment,
write_usm_config(Dir, Hdr, Conf).
-write_usm_config(Dir, Hdr, Conf)
+write_usm_config(Dir, Hdr, Conf)
when is_list(Dir) andalso is_list(Hdr) andalso is_list(Conf) ->
- Verify = fun() -> verify_usm_conf(Conf) end,
- Write = fun(Fd) -> write_usm_conf(Fd, Hdr, Conf) end,
- write_config_file(Dir, ?USM_USERS_CONF_FILE, Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_usm_user_config/2,
+ Write = fun (Fd, Entries) -> write_usm_conf(Fd, Hdr, Entries) end,
+ write_config_file(Dir, ?USM_USERS_CONF_FILE, Order, Check, Write, Conf).
-append_usm_config(Dir, Conf)
+append_usm_config(Dir, Conf)
when is_list(Dir) andalso is_list(Conf) ->
- Verify = fun() -> verify_usm_conf(Conf) end,
- Write = fun(Fd) -> write_usm_conf(Fd, Conf) end,
- append_config_file(Dir, ?USM_USERS_CONF_FILE, Verify, Write).
-
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_usm_user_config/2,
+ Write = fun write_usm_conf/2,
+ append_config_file(Dir, ?USM_USERS_CONF_FILE, Order, Check, Write, Conf).
read_usm_config(Dir)
when is_list(Dir) ->
- Verify = fun(Entry) -> verify_usm_conf_entry(Entry) end,
- read_config_file(Dir, ?USM_USERS_CONF_FILE, Verify).
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_usm_user_config/2,
+ read_config_file(Dir, ?USM_USERS_CONF_FILE, Order, Check).
-verify_usm_conf([]) ->
- ok;
-verify_usm_conf([H|T]) ->
- verify_usm_conf_entry(H),
- verify_usm_conf(T);
-verify_usm_conf(X) ->
- error({bad_usm_conf, X}).
-
-verify_usm_conf_entry(Entry) ->
- {ok, _} = snmpm_config:check_usm_user_config(Entry),
- ok.
+check_usm_user_config(Entry, State) ->
+ {check_ok(snmpm_config:check_usm_user_config(Entry)),
+ State}.
write_usm_conf(Fd, "", Conf) ->
write_usm_conf(Fd, Conf);
@@ -358,41 +326,49 @@ write_usm_conf(Fd, [H|T]) ->
do_write_usm_conf(Fd, H),
write_usm_conf(Fd, T).
-do_write_usm_conf(Fd,
- {EngineID, UserName, AuthP, AuthKey, PrivP, PrivKey}) ->
- io:format(Fd, "{\"~s\", \"~s\", ~w, ~w, ~w, ~w}.~n",
- [EngineID, UserName, AuthP, AuthKey, PrivP, PrivKey]);
-do_write_usm_conf(Fd,
- {EngineID, UserName, SecName,
- AuthP, AuthKey, PrivP, PrivKey}) ->
- io:format(Fd, "{\"~s\", \"~s\", \"~s\", �~w, ~w, ~w, ~w}.~n",
- [EngineID, UserName, SecName, AuthP, AuthKey, PrivP, PrivKey]);
+do_write_usm_conf(
+ Fd,
+ {EngineID, UserName, AuthP, AuthKey, PrivP, PrivKey}) ->
+ io:format(
+ Fd, "{\"~s\", \"~s\", ~w, ~w, ~w, ~w}.~n",
+ [EngineID, UserName, AuthP, AuthKey, PrivP, PrivKey]);
+do_write_usm_conf(
+ Fd,
+ {EngineID, UserName, SecName,
+ AuthP, AuthKey, PrivP, PrivKey}) ->
+ io:format(
+ Fd, "{\"~s\", \"~s\", \"~s\", í~w, ~w, ~w, ~w}.~n",
+ [EngineID, UserName, SecName, AuthP, AuthKey, PrivP, PrivKey]);
do_write_usm_conf(_Fd, Crap) ->
error({bad_usm_conf, Crap}).
%% ---- config file wrapper functions ----
-write_config_file(Dir, File, Verify, Write) ->
- snmp_config:write_config_file(Dir, File, Verify, Write).
+write_config_file(Dir, File, Order, Check, Write, Conf) ->
+ snmp_config:write_config_file(Dir, File, Order, Check, Write, Conf).
-append_config_file(Dir, File, Verify, Write) ->
- snmp_config:append_config_file(Dir, File, Verify, Write).
-
-read_config_file(Dir, File, Verify) ->
- snmp_config:read_config_file(Dir, File, Verify).
+append_config_file(Dir, File, Order, Check, Write, Conf) ->
+ snmp_config:append_config_file(Dir, File, Order, Check, Write, Conf).
+read_config_file(Dir, File, Order, Check) ->
+ snmp_config:read_config_file(Dir, File, Order, Check).
%% ---- config file utility functions ----
+check_ok(ok) ->
+ ok;
+check_ok({ok, _}) ->
+ ok.
+
header() ->
{Y,Mo,D} = date(),
{H,Mi,S} = time(),
- io_lib:format("%% This file was generated by "
- "~w (version-~s) ~w-~2.2.0w-~2.2.0w "
- "~2.2.0w:~2.2.0w:~2.2.0w\n",
- [?MODULE, ?version, Y, Mo, D, H, Mi, S]).
-
+ io_lib:format(
+ "%% This file was generated by "
+ "~w (version-~s) ~w-~2.2.0w-~2.2.0w "
+ "~2.2.0w:~2.2.0w:~2.2.0w\n",
+ [?MODULE, ?version, Y, Mo, D, H, Mi, S]).
error(R) ->
throw({error, R}).
diff --git a/lib/snmp/src/manager/snmpm_config.erl b/lib/snmp/src/manager/snmpm_config.erl
index 5bbf9e5542..118cdcd1df 100644
--- a/lib/snmp/src/manager/snmpm_config.erl
+++ b/lib/snmp/src/manager/snmpm_config.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -103,8 +104,10 @@
get_agent_mp_model/2
]).
--export([check_manager_config/1,
- check_user_config/1,
+-export([
+ order_manager_config/2,
+ check_manager_config/2,
+ check_user_config/1,
check_agent_config/1,
check_usm_user_config/1]).
@@ -165,7 +168,7 @@
%%%-------------------------------------------------------------------
default_transport_domain() ->
- transportDomainUdpIpv4.
+ snmpUDPDomain.
start_link(Opts) ->
@@ -190,7 +193,11 @@ register_user(UserId, UserMod, UserData, DefaultAgentConfig)
when (UserId =/= ?DEFAULT_USER) andalso is_list(DefaultAgentConfig) ->
case (catch verify_user_behaviour(UserMod)) of
ok ->
- Config = default_agent_config(DefaultAgentConfig),
+ {ok, SystemDefaultAgentConfig} = agent_info(),
+ Config =
+ ensure_config(SystemDefaultAgentConfig,
+ DefaultAgentConfig),
+%% Config = default_agent_config(DefaultAgentConfig),
call({register_user, UserId, UserMod, UserData, Config});
Error ->
Error
@@ -201,19 +208,19 @@ register_user(UserId, _UserMod, _UserData, DefaultAgentConfig)
register_user(UserId, _, _, _) ->
{error, {bad_user_id, UserId}}.
-default_agent_config(DefaultAgentConfig) ->
- {ok, SystemDefaultAgentConfig} = agent_info(),
- default_agent_config(SystemDefaultAgentConfig, DefaultAgentConfig).
+%% default_agent_config(DefaultAgentConfig) ->
+%% {ok, SystemDefaultAgentConfig} = agent_info(),
+%% default_agent_config(SystemDefaultAgentConfig, DefaultAgentConfig).
-default_agent_config([], DefaultAgentConfig) ->
- DefaultAgentConfig;
-default_agent_config([{Key, _} = Entry|T], DefaultAgentConfig) ->
- case lists:keysearch(Key, 1, DefaultAgentConfig) of
- {value, _} ->
- default_agent_config(T, DefaultAgentConfig);
- false ->
- default_agent_config(T, [Entry|DefaultAgentConfig])
- end.
+%% default_agent_config([], DefaultAgentConfig) ->
+%% DefaultAgentConfig;
+%% default_agent_config([{Key, _} = Entry|T], DefaultAgentConfig) ->
+%% case lists:keymember(Key, 1, DefaultAgentConfig) of
+%% true ->
+%% default_agent_config(T, DefaultAgentConfig);
+%% false ->
+%% default_agent_config(T, [Entry|DefaultAgentConfig])
+%% end.
verify_user_behaviour(UserMod) ->
@@ -280,9 +287,10 @@ do_user_info(_UserId, BadItem) ->
%% A target-name constructed in this way is a string with the following:
%% <IP-address>:<Port>-<Version>
-%% This is intended for backward compatibility and therefor has
+%% This is intended for backward compatibility and therefore has
%% only support for IPv4 addresses and *no* other transport domain.
-mk_target_name(Addr0, Port, Config) when is_list(Config) ->
+mk_target_name(Domain, Addr, Config)
+ when is_atom(Domain), is_list(Config) ->
Version =
case lists:keysearch(version, 1, Config) of
{value, {_, V}} ->
@@ -290,18 +298,35 @@ mk_target_name(Addr0, Port, Config) when is_list(Config) ->
false ->
select_lowest_supported_version()
end,
- case normalize_address(Addr0) of
- {A, B, C, D} ->
- lists:flatten(
- io_lib:format("~w.~w.~w.~w:~w-~w", [A, B, C, D, Port, Version]));
- [A, B, C, D] ->
+ try
+ lists:flatten(
+ io_lib:format(
+ "~s-~w", [snmp_conf:mk_addr_string({Domain, Addr}), Version]))
+ catch
+ _ ->
lists:flatten(
- io_lib:format("~w.~w.~w.~w:~w-~w", [A, B, C, D, Port, Version]));
- _ ->
+ io_lib:format("~p-~w", [Addr, Version]))
+ end;
+mk_target_name(Ip, Port, Config)
+ when is_integer(Port), is_list(Config) ->
+ Domain = default_transport_domain(),
+ try fix_address(Domain, {Ip, Port}) of
+ Address ->
+ mk_target_name(Domain, Address, Config)
+ catch
+ _ ->
+ Version =
+ case lists:keysearch(version, 1, Config) of
+ {value, {_, V}} ->
+ V;
+ false ->
+ select_lowest_supported_version()
+ end,
lists:flatten(
- io_lib:format("~p:~w-~w", [Addr0, Port, Version]))
+ io_lib:format("~p:~w-~w", [Ip, Port, Version]))
end.
-
+
+
select_lowest_supported_version() ->
{ok, Versions} = system_info(versions),
select_lowest_supported_version([v1, v2, v3], Versions).
@@ -335,27 +360,17 @@ register_agent(UserId, TargetName, Config0)
%% is not present
%% 3) Check that there are no invalid or erroneous configs
%% 4) Check that the manager is capable of using the selected version
- case verify_agent_config(Config0) of
- {ok, Config} ->
- call({register_agent, UserId, TargetName, Config});
- Error ->
- Error
- end.
-
-
-verify_agent_config(Conf0) ->
try
- begin
- verify_mandatory(Conf0, [engine_id, address, reg_type]),
- verify_invalid(Conf0, [user_id]),
- Conf = verify_agent_config3(Conf0),
- Vsns = versions(),
- Vsn = which_version(Conf),
- verify_version(Vsn, Vsns),
- {ok, Conf}
- end
+ verify_mandatory(Config0, [engine_id, reg_type]),
+ verify_someof(Config0, [address, taddress]),
+ verify_illegal(Config0, [user_id]),
+ Config = verify_agent_config(Config0),
+ Vsns = versions(),
+ Vsn = which_version(Config),
+ verify_version(Vsn, Vsns),
+ call({register_agent, UserId, TargetName, Config})
catch
- throw:Error ->
+ Error ->
Error
end.
@@ -381,52 +396,43 @@ verify_version(Vsn, Vsns) ->
ok;
false ->
Reason = {version_not_supported_by_manager, Vsn, Vsns},
- throw({error, Reason})
- end.
-
-verify_agent_config3(Conf0) ->
- %% Fix (transport) address and domain
- {TDomain, Conf1} =
- case lists:keysearch(tdomain, 1, Conf0) of
- {value, {tdomain, Dom}} ->
- {Dom, Conf0};
- false ->
- Dom = default_transport_domain(),
- {Dom, [{tdomain, Dom} | Conf0]}
- end,
- Conf2 = case lists:keysearch(address, 1, Conf1) of
- {value, {address, Address}} ->
- lists:keyreplace(address, 1, Conf1,
- {address, {TDomain, Address}});
- false ->
- %% This is a mandatory config option,
- %% a later test will detect this
- Conf1
- end,
- case verify_agent2(Conf2) of
- {ok, Conf} ->
- Conf;
- {error, _} = ERROR ->
- throw(ERROR)
+ error(Reason)
end.
-verify_agent_config2(Conf) ->
- verify_agent2(Conf).
unregister_agent(UserId, TargetName) ->
call({unregister_agent, UserId, TargetName}).
%% This is the old style agent unregistration (using Addr and Port).
-unregister_agent(UserId, Addr0, Port) ->
- Addr = normalize_address(Addr0),
- case do_agent_info(Addr, Port, target_name) of
+unregister_agent(UserId, Domain, Address) when is_atom(Domain) ->
+ try fix_address(Domain, Address) of
+ NAddress ->
+ do_unregister_agent(UserId, Domain, NAddress)
+ catch
+ _ ->
+ {error, not_found}
+ end;
+unregister_agent(UserId, Ip, Port) when is_integer(Port) ->
+ Domain = default_transport_domain(),
+ try fix_address(Domain, {Ip, Port}) of
+ Address ->
+ do_unregister_agent(UserId, Domain, Address)
+ catch
+ _ ->
+ {error, not_found}
+ end.
+
+do_unregister_agent(UserId, Domain, Address) ->
+ case do_agent_info(Domain, Address, target_name) of
{ok, TargetName} ->
unregister_agent(UserId, TargetName);
Error ->
Error
end.
+
+
agent_info() ->
agent_info(?DEFAULT_TARGETNAME, all).
@@ -437,27 +443,76 @@ agent_info(TargetName, all) ->
All ->
{ok, [{Item, Val} || {{_, Item}, Val} <- All]}
end;
+%% Begin backwards compatibility
+agent_info(TargetName, address) ->
+ case agent_info({TargetName, taddress}) of
+ {ok, Val} ->
+ {Addr, _} = Val,
+ {ok, Addr};
+ _ ->
+ %% This should be redundant since 'taddress' should exist
+ agent_info({TargetName, address})
+ end;
+agent_info(TargetName, port) ->
+ case agent_info({TargetName, taddress}) of
+ {ok, Val} ->
+ {_, Port} = Val,
+ {ok, Port};
+ _ ->
+ %% This should be redundant since 'taddress' should exist
+ agent_info({TargetName, port})
+ end;
+%% End backwards compatibility
agent_info(TargetName, Item) ->
- case ets:lookup(snmpm_agent_table, {TargetName, Item}) of
+ agent_info({TargetName, Item}).
+
+agent_info(Key) ->
+ case ets:lookup(snmpm_agent_table, Key) of
[{_, Val}] ->
{ok, Val};
[] ->
{error, not_found}
end.
-
-agent_info(Addr0, Port, Item) ->
- Addr = normalize_address(Addr0),
- do_agent_info(Addr, Port, Item).
-do_agent_info(Addr, Port, target_name = Item) ->
- case ets:lookup(snmpm_agent_table, {Addr, Port, Item}) of
+agent_info(Domain, Address, Item) when is_atom(Domain) ->
+ try fix_address(Domain, Address) of
+ NAddress ->
+ do_agent_info(Domain, NAddress, Item)
+ catch
+ _Thrown ->
+ %% p(?MODULE_STRING":agent_info(~p, ~p, ~p) throwed ~p at.~n"
+ %% " ~p",
+ %% [Domain, Address, Item, _Thrown, erlang:get_stacktrace()]),
+ {error, not_found}
+ end;
+agent_info(Ip, Port, Item) when is_integer(Port) ->
+ %% p(?MODULE_STRING":agent_info(~p, ~p, ~p) entry~n",
+ %% [Ip, Port, Item]),
+ Domain = default_transport_domain(),
+ try fix_address(Domain, {Ip, Port}) of
+ Address ->
+ do_agent_info(Domain, Address, Item)
+ catch
+ _Thrown ->
+ %% p(?MODULE_STRING":agent_info(~p, ~p, ~p) throwed ~p at.~n"
+ %% " ~p",
+ %% [Ip, Port, Item, _Thrown, erlang:get_stacktrace()]),
+ {error, not_found}
+ end.
+
+do_agent_info(Domain, Address, target_name = Item) ->
+ %% p(?MODULE_STRING":do_agent_info(~p, ~p, ~p) entry~n",
+ %% [Domain, Address, Item]),
+ case ets:lookup(snmpm_agent_table, {Domain, Address, Item}) of
[{_, Val}] ->
{ok, Val};
[] ->
{error, not_found}
end;
-do_agent_info(Addr, Port, Item) ->
- case do_agent_info(Addr, Port, target_name) of
+do_agent_info(Domain, Address, Item) ->
+ %% p(?MODULE_STRING":do_agent_info(~p, ~p, ~p) entry~n",
+ %% [Domain, Address, Item]),
+ case do_agent_info(Domain, Address, target_name) of
{ok, TargetName} ->
agent_info(TargetName, Item);
Error ->
@@ -465,6 +520,19 @@ do_agent_info(Addr, Port, Item) ->
end.
+ensure_agent_info(_, [], Info) ->
+ Info;
+ensure_agent_info(TargetName, [Item|Items], Info) ->
+ case lists:keymember(Item, 1, Info) of
+ true ->
+ ensure_agent_info(TargetName, Items, Info);
+ false ->
+ {ok, Value} = agent_info(TargetName, Item),
+ ensure_agent_info(TargetName, Items, [{Item, Value}|Info])
+ end.
+
+
+
which_agents() ->
which_agents('_').
@@ -474,38 +542,6 @@ which_agents(UserId) ->
[TargetName || [TargetName] <- Agents].
-verify_agent_info(TargetName, Info0) ->
- try
- begin
- verify_invalid(Info0, [user_id]),
- %% Check if address is part of the list and
- %% if so update it with the domain info.
- Info =
- case lists:keysearch(address, 1, Info0) of
- {value, {address, Addr}} ->
- %% If domain is part of the info, then use it.
- %% If not, lookup what is already stored for
- %% this agent and use that.
- Domain =
- case lists:keysearch(tdomain, 1, Info0) of
- {value, {tdomain, Dom}} ->
- Dom;
- false ->
- {ok, Dom} =
- agent_info(TargetName, tdomain),
- Dom
- end,
- Addr2 = {Domain, Addr},
- lists:keyreplace(address, 1, Info0, {address, Addr2});
- false ->
- Info0
- end,
- verify_agent2(Info)
- end
- catch
- throw:Error ->
- Error
- end.
update_agent_info(UserId, TargetName, Info) ->
call({update_agent_info, UserId, TargetName, Info}).
@@ -740,7 +776,7 @@ verify_usm_user_config(EngineID, Name, Config) ->
try
begin
verify_mandatory(Config, []),
- verify_invalid(Config, [engine_id, name]),
+ verify_illegal(Config, [engine_id, name]),
verify_usm_user_config2(EngineID, Name, Config)
end
catch
@@ -1073,7 +1109,11 @@ do_init(Opts) ->
%% -- Prio (optional) --
Prio = get_opt(priority, Opts, normal),
ets:insert(snmpm_config_table, {prio, Prio}),
- process_flag(priority, Prio),
+ try process_flag(priority, Prio)
+ catch
+ error:badarg ->
+ error({invalid_priority,Prio})
+ end,
%% -- Server (optional) --
ServerOpts = get_opt(server, Opts, []),
@@ -1215,6 +1255,12 @@ dets_open(Dir, DbInitError, Repair, AutoSave) ->
end
end;
_ ->
+ case DbInitError of
+ create_db_and_dir ->
+ ok = filelib:ensure_dir(Filename);
+ _ ->
+ ok
+ end,
case do_dets_open(Name, Filename, Repair, AutoSave) of
{ok, _Dets} ->
ok;
@@ -1265,36 +1311,6 @@ verify_options(Opts, Mandatory) ->
verify_mandatory_options(Opts, Mandatory),
verify_options(Opts).
-%% mandatory() -> [mand()]
-%% mand() -> atom() | {atom, [atom()]}
-verify_mandatory_options(_Opts, []) ->
- ok;
-verify_mandatory_options(Opts, [Mand|Mands]) ->
- verify_mandatory_option(Opts, Mand),
- verify_mandatory_options(Opts, Mands).
-
-verify_mandatory_option(Opts, {Mand, MandSubOpts}) ->
- ?d("verify_mandatory_option -> entry with"
- "~n Mand: ~p"
- "~n MandSubObjs: ~p", [Mand, MandSubOpts]),
- case lists:keysearch(Mand, 1, Opts) of
- {value, {Mand, SubOpts}} ->
- verify_mandatory_options(SubOpts, MandSubOpts);
- false ->
- ?d("missing mandatory option: ~w [~p]", [Mand, MandSubOpts]),
- error({missing_mandatory, Mand, MandSubOpts})
- end;
-verify_mandatory_option(Opts, Mand) ->
- ?d("verify_mandatory_option -> entry with"
- "~n Mand: ~p", [Mand]),
- case lists:keymember(Mand, 1, Opts) of
- true ->
- ok;
- false ->
- ?d("missing mandatory option: ~w", [Mand]),
- error({missing_mandatory, Mand})
- end.
-
verify_options([]) ->
?d("verify_options -> done", []),
ok;
@@ -1316,7 +1332,14 @@ verify_option({server, ServerOpts}) ->
verify_server_opts(ServerOpts);
verify_option({note_store, NoteStoreOpts}) ->
verify_note_store_opts(NoteStoreOpts);
-verify_option({config, ConfOpts}) ->
+verify_option({config, ConfOpts0}) ->
+ %% Make sure any db_dir option is first in the options list to make it
+ %% easier to check if the db_init_error option specifies that a missing
+ %% db_dir should be created.
+ ConfOpts = case lists:keytake(db_dir, 1, ConfOpts0) of
+ false -> ConfOpts0;
+ {value, Result, OtherOpts} -> [Result|OtherOpts]
+ end,
verify_config_opts(ConfOpts);
verify_option({versions, Vsns}) ->
verify_versions(Vsns);
@@ -1365,7 +1388,12 @@ verify_config_opts([{dir, Dir}|Opts]) ->
verify_conf_dir(Dir),
verify_config_opts(Opts);
verify_config_opts([{db_dir, Dir}|Opts]) ->
- verify_conf_db_dir(Dir),
+ case lists:keyfind(db_init_error, 1, Opts) of
+ {db_init_error, create_db_and_dir} ->
+ verify_conf_db_dir(Dir, false);
+ _ ->
+ verify_conf_db_dir(Dir, true)
+ end,
verify_config_opts(Opts);
verify_config_opts([{db_init_error, DbInitErr}|Opts]) ->
verify_conf_db_init_error(DbInitErr),
@@ -1443,7 +1471,7 @@ verify_conf_dir(Dir) ->
error({invalid_conf_dir, Dir})
end.
-verify_conf_db_dir(Dir) ->
+verify_conf_db_dir(Dir, true) ->
case (catch verify_dir(Dir)) of
ok ->
ok;
@@ -1451,13 +1479,16 @@ verify_conf_db_dir(Dir) ->
error({invalid_conf_db_dir, Dir, Reason});
_ ->
error({invalid_conf_db_dir, Dir})
- end.
-
+ end;
+verify_conf_db_dir(_Dir, false) ->
+ ok.
verify_conf_db_init_error(terminate) ->
ok;
verify_conf_db_init_error(create) ->
ok;
+verify_conf_db_init_error(create_db_and_dir) ->
+ ok;
verify_conf_db_init_error(InvalidDbInitError) ->
error({invalid_conf_db_init_error, InvalidDbInitError}).
@@ -1485,7 +1516,9 @@ verify_versions([]) ->
ok;
verify_versions([Vsn|Vsns]) ->
verify_version(Vsn),
- verify_versions(Vsns).
+ verify_versions(Vsns);
+verify_versions(Vsns) ->
+ error({invalid_versions, Vsns}).
verify_version(v1) ->
ok;
@@ -1593,7 +1626,38 @@ verify_verbosity(Verbosity) ->
_ ->
error({invalid_verbosity, Verbosity})
end.
+
+%% mandatory() -> [mand()]
+%% mand() -> atom() | {atom, [atom()]}
+verify_mandatory_options(_Opts, []) ->
+ ok;
+verify_mandatory_options(Opts, [Mand|Mands]) ->
+ verify_mandatory_option(Opts, Mand),
+ verify_mandatory_options(Opts, Mands).
+
+verify_mandatory_option(Opts, {Mand, MandSubOpts}) ->
+ ?d("verify_mandatory_option -> entry with"
+ "~n Mand: ~p"
+ "~n MandSubObjs: ~p", [Mand, MandSubOpts]),
+ case lists:keysearch(Mand, 1, Opts) of
+ {value, {Mand, SubOpts}} ->
+ verify_mandatory_options(SubOpts, MandSubOpts);
+ false ->
+ ?d("missing mandatory option: ~w [~p]", [Mand, MandSubOpts]),
+ error({missing_mandatory, Mand, MandSubOpts})
+ end;
+verify_mandatory_option(Opts, Mand) ->
+ ?d("verify_mandatory_option -> entry with"
+ "~n Mand: ~p", [Mand]),
+ case lists:keymember(Mand, 1, Opts) of
+ true ->
+ ok;
+ false ->
+ ?d("missing mandatory option: ~w", [Mand]),
+ error({missing_mandatory, Mand})
+ end.
+
%% ------------------------------------------------------------------------
init_manager_config([]) ->
@@ -1608,181 +1672,91 @@ init_agent_default() ->
%% The purpose of the default_agent is only to have a place
%% to store system wide default values related to agents.
%%
-
- %% Port
- init_agent_default(port, ?DEFAULT_AGENT_PORT),
-
- %% Timeout
- init_agent_default(timeout, 10000),
-
- %% Max message (packet) size
- init_agent_default(max_message_size, 484),
-
- %% MPModel
- init_agent_default(version, v2),
-
- %% SecModel
- init_agent_default(sec_model, v2c),
-
- %% SecName
- init_agent_default(sec_name, "initial"),
-
- %% SecLevel
- init_agent_default(sec_level, noAuthNoPriv),
-
- %% Community
- init_agent_default(community, "all-rights"),
- ok.
-
-
-init_agent_default(Item, Val) when Item =/= user_id ->
- case do_update_agent_info(default_agent, Item, Val) of
- ok ->
- ok;
- {error, Reason} ->
- error(Reason)
- end.
-
+ AgentDefaultConfig =
+ [{port, ?DEFAULT_AGENT_PORT}, % Port
+ {timeout, 10000}, % Timeout
+ {max_message_size, 484}, % Max message (packet) size
+ {version, v2}, % MPModel
+ {sec_model, v2c}, % SecModel
+ {sec_name, "initial"}, % SecName
+ {sec_level, noAuthNoPriv}, % SecLevel
+ {community, "all-rights"}], % Community
+ do_update_agent_info(default_agent, AgentDefaultConfig).
read_agents_config_file(Dir) ->
- Check = fun(C) -> check_agent_config2(C) end,
- case read_file(Dir, "agents.conf", Check, []) of
- {ok, Conf} ->
- Conf;
- Error ->
+ Order = fun snmp_conf:no_order/2,
+ Check = fun check_agent_config/2,
+ try read_file(Dir, "agents.conf", Order, Check, [])
+ catch
+ throw:Error ->
?vlog("agent config error: ~p", [Error]),
- throw(Error)
+ erlang:raise(throw, Error, erlang:get_stacktrace())
end.
-check_agent_config2(Agent) ->
- case (catch check_agent_config(Agent)) of
- {ok, {UserId, TargetName, Conf, Version}} ->
- {ok, Vsns} = system_info(versions),
- case lists:member(Version, Vsns) of
- true ->
- {ok, {UserId, TargetName, Conf}};
- false ->
- error({version_not_supported_by_manager,
- Version, Vsns})
- end;
- Err ->
- throw(Err)
+check_agent_config(Agent, State) ->
+ {ok, {UserId, TargetName, Conf, Version}} = check_agent_config(Agent),
+ {ok, Vsns} = system_info(versions),
+ case lists:member(Version, Vsns) of
+ true ->
+ {{ok, {UserId, TargetName, Conf}}, State};
+ false ->
+ error({version_not_supported_by_manager, Version, Vsns})
end.
%% For backward compatibility
-check_agent_config({UserId,
- TargetName,
- Community,
- Ip, Port,
- EngineId,
- Timeout, MaxMessageSize,
- Version, SecModel, SecName, SecLevel}) ->
- TDomain = default_transport_domain(),
- check_agent_config({UserId,
- TargetName,
- Community,
- TDomain, Ip, Port,
- EngineId,
- Timeout, MaxMessageSize,
- Version, SecModel, SecName, SecLevel});
-
-check_agent_config({UserId,
- TargetName,
- Community,
- TDomain, Ip, Port,
- EngineId,
- Timeout, MaxMessageSize,
- Version, SecModel, SecName, SecLevel}) ->
- ?vtrace("check_agent_config -> entry with"
- "~n UserId: ~p"
- "~n TargetName: ~p"
- "~n Community: ~p"
- "~n TDomain: ~p"
- "~n Ip: ~p"
- "~n Port: ~p"
- "~n EngineId: ~p"
- "~n Timeout: ~p"
- "~n MaxMessageSize: ~p"
- "~n Version: ~p"
- "~n SecModel: ~p"
- "~n SecName: ~p"
- "~n SecLevel: ~p",
- [UserId, TargetName, Community,
- TDomain, Ip, Port,
- EngineId, Timeout, MaxMessageSize,
- Version, SecModel, SecName, SecLevel]),
- Addr = normalize_address(TDomain, Ip),
- ?vtrace("check_agent_config -> Addr: ~p", [Addr]),
- Agent = {UserId,
- TargetName,
- Community,
- TDomain, Addr, Port,
- EngineId,
- Timeout, MaxMessageSize,
- Version, SecModel, SecName, SecLevel},
- {ok, verify_agent(Agent)};
+check_agent_config(
+ {UserId, TargetName, Community, Domain, Addr,
+ EngineId, Timeout, MaxMessageSize,
+ Version, SecModel, SecName, SecLevel}) when is_atom(Domain) ->
+ check_agent_config(
+ UserId, TargetName, Community, Domain, Addr,
+ EngineId, Timeout, MaxMessageSize,
+ Version, SecModel, SecName, SecLevel);
+check_agent_config(
+ {UserId, TargetName, Community, Ip, Port,
+ EngineId, Timeout, MaxMessageSize,
+ Version, SecModel, SecName, SecLevel}) when is_integer(Port) ->
+ Domain = default_transport_domain(),
+ Addr = {Ip, Port},
+ check_agent_config(
+ UserId, TargetName, Community, Domain, Addr,
+ EngineId, Timeout, MaxMessageSize,
+ Version, SecModel, SecName, SecLevel);
+check_agent_config(
+ {_UserId, _TargetName, _Community, Domain, Addr,
+ _EngineId, _Timeout, _MaxMessageSize,
+ _Version, _SecModel, _SecName, _SecLevel}) ->
+ error({bad_address, {Domain, Addr}});
+check_agent_config(
+ {UserId, TargetName, Community, Domain, Ip, Port,
+ EngineId, Timeout, MaxMessageSize,
+ Version, SecModel, SecName, SecLevel}) ->
+ Addr = {Ip, Port},
+ check_agent_config(
+ UserId, TargetName, Community, Domain, Addr,
+ EngineId, Timeout, MaxMessageSize,
+ Version, SecModel, SecName, SecLevel);
check_agent_config(Agent) ->
error({bad_agent_config, Agent}).
-
-init_agents_config([]) ->
- ok;
-init_agents_config([Agent|Agents]) ->
- init_agent_config(Agent),
- init_agents_config(Agents).
-
-init_agent_config({_UserId, ?DEFAULT_TARGETNAME = TargetName, _Config}) ->
- throw({error, {invalid_target_name, TargetName}});
-init_agent_config({UserId, TargetName, Config}) ->
- case handle_register_agent(UserId, TargetName, Config) of
- ok ->
- ok;
- Error ->
- throw(Error)
- end.
-
-
-%% For backward compatibility
-verify_agent({UserId,
- TargetName,
- Comm,
- Ip, Port,
- EngineId,
- Timeout, MMS,
- Version, SecModel, SecName, SecLevel}) ->
- TDomain = default_transport_domain(),
- verify_agent({UserId,
- TargetName,
- Comm,
- TDomain, Ip, Port,
- EngineId,
- Timeout, MMS,
- Version, SecModel, SecName, SecLevel});
-
-verify_agent({UserId,
- TargetName,
- Comm,
- TDomain, Ip, Port,
- EngineId,
- Timeout, MMS,
- Version, SecModel, SecName, SecLevel}) ->
- ?vdebug("verify_agent -> entry with"
+check_agent_config(
+ UserId, TargetName, Comm, Domain, Addr,
+ EngineId, Timeout, MMS,
+ Version, SecModel, SecName, SecLevel) ->
+ ?vdebug("check_agent_config -> entry with"
"~n UserId: ~p"
"~n TargetName: ~p", [UserId, TargetName]),
snmp_conf:check_string(TargetName, {gt, 0}),
- snmp_conf:check_integer(Port, {gt, 0}),
%% Note that the order of Conf *is* important.
%% Some properties may depend on others, so that
%% in order to verify one property, another must
%% be already verified (and present). An example
- %% of this is the property 'address', for which
+ %% of this is the property 'taddress', for which
%% the property tdomain is needed.
- Conf0 =
+ Conf =
[{reg_type, target_name},
- {tdomain, TDomain},
- %% This should be taddress, but what the*...
- {address, {TDomain, Ip}},
- {port, Port},
+ {tdomain, Domain},
+ {taddress, fix_address(Domain, Addr)},
{community, Comm},
{engine_id, EngineId},
{timeout, Timeout},
@@ -1792,40 +1766,180 @@ verify_agent({UserId,
{sec_name, SecName},
{sec_level, SecLevel}
],
- case verify_agent2(Conf0) of
- {ok, Conf} ->
- {UserId, TargetName, Conf, Version};
- Err ->
- throw(Err)
+ {ok, {UserId, TargetName, verify_agent_config(Conf), Version}}.
+
+
+
+init_agents_config([]) ->
+ ok;
+init_agents_config([Agent|Agents]) ->
+ init_agent_config(Agent),
+ init_agents_config(Agents).
+
+init_agent_config({_UserId, ?DEFAULT_TARGETNAME = TargetName, _Config}) ->
+ error({invalid_target_name, TargetName});
+init_agent_config({UserId, TargetName, Config}) ->
+ case handle_register_agent(UserId, TargetName, Config) of
+ ok ->
+ ok;
+ Error ->
+ throw(Error)
end.
-verify_agent2(Conf) ->
- verify_agent2(Conf, []).
-verify_agent2([], VerifiedConf) ->
- {ok, VerifiedConf};
-verify_agent2([{Item, Val0}|Items], VerifiedConf) ->
- case verify_val(Item, Val0) of
- {ok, Val} ->
- verify_agent2(Items, [{Item, Val} | VerifiedConf]);
- Err ->
- Err
+
+%% Sort 'tdomain' first then 'port' to ensure both
+%% sorts before 'taddress'. Keep the order of other items.
+order_agent(ItemA, ItemB) ->
+ snmp_conf:keyorder(1, ItemA, ItemB, [tdomain, port]).
+
+fix_agent_config(Conf) ->
+ ?vdebug("fix_agent_config -> entry with~n~n"
+ " Conf: ~p", [Conf]),
+ fix_agent_config(lists:sort(fun order_agent/2, Conf), []).
+
+fix_agent_config([], FixedConf) ->
+ Ret = lists:reverse(FixedConf),
+ ?vdebug("fix_agent_config -> returns:~n"
+ " ~p", [Ret]),
+ Ret;
+fix_agent_config([{taddress = Item, Address} = Entry|Conf], FixedConf) ->
+ {value, {tdomain, TDomain}} = lists:keysearch(tdomain, 1, FixedConf),
+ {value, {port, DefaultPort}} = lists:keysearch(port, 1, FixedConf),
+ case snmp_conf:check_address(TDomain, Address, DefaultPort) of
+ ok ->
+ fix_agent_config(Conf, [Entry|FixedConf]);
+ {ok, NAddress} ->
+ fix_agent_config(Conf, [{Item, NAddress}|FixedConf])
+ end;
+fix_agent_config([Entry|Conf], FixedConf) ->
+ fix_agent_config(Conf, [Entry|FixedConf]).
+
+
+
+verify_agent_config(Conf) ->
+ verify_agent_config(lists:sort(fun order_agent/2, Conf), []).
+
+verify_agent_config([], VerifiedConf) ->
+ Ret = lists:reverse(VerifiedConf),
+ ?vdebug("verify_agent_config -> returns:~n"
+ " ~p", [Ret]),
+ Ret;
+verify_agent_config([{Item, _} = Entry|Conf], VerifiedConf) ->
+ verify_illegal(VerifiedConf, [Item]), % Duplicates are hereby illegal
+ verify_agent_config(Conf, VerifiedConf, Entry);
+verify_agent_config([Bad|_], _VerifiedConf) ->
+ error({bad_agent_config, Bad}).
+
+verify_agent_config(
+ Conf, VerifiedConf, {taddress = Item, Address} = Entry) ->
+ verify_illegal(VerifiedConf, [address]),
+ {TDomain, VC} =
+ case lists:keysearch(tdomain, 1, VerifiedConf) of
+ {value, {tdomain,TD}} ->
+ {TD, VerifiedConf};
+ _ ->
+ %% Insert tdomain since it is missing
+ %% Note: not default_transport_domain() since
+ %% taddress is the new format hence the application
+ %% should be tdomain aware and therefore addresses
+ %% on the Domain, Addr format should be used and understood.
+ TD = transportDomainUdpIpv4,
+ {TD, [{tdomain, TD}|VerifiedConf]}
+ end,
+ case snmp_conf:check_address(TDomain, Address, 0) of
+ ok ->
+ verify_agent_config(Conf, [Entry|VC]);
+ {ok, NAddress} ->
+ verify_agent_config(Conf, [{Item, NAddress}|VC])
end;
-verify_agent2([Bad|_], _VerifiedConf) ->
- {error, {bad_agent_config, Bad}}.
+verify_agent_config(Conf, VerifiedConf, {address, Address}) ->
+ Item = taddress,
+ verify_illegal(VerifiedConf, [Item]),
+ {TDomain, VC} =
+ case lists:keysearch(tdomain, 1, VerifiedConf) of
+ {value, {tdomain, TD}} ->
+ {TD, VerifiedConf};
+ _ ->
+ %% Insert tdomain since it is missing
+ TD = default_transport_domain(),
+ {TD, [{tdomain, TD}|VerifiedConf]}
+ end,
+ case snmp_conf:check_address(TDomain, Address, 0) of
+ ok ->
+ verify_agent_config(Conf, [{Item, Address}|VC]);
+ {ok, NAddress} ->
+ verify_agent_config(Conf, [{Item, NAddress}|VC])
+ end;
+verify_agent_config(Conf, VerifiedConf, {Item, Val} = Entry) ->
+ case verify_agent_entry(Item, Val) of
+ ok ->
+ verify_agent_config(Conf, [Entry|VerifiedConf]);
+ {ok, NewVal} ->
+ verify_agent_config(Conf, [{Item, NewVal}|VerifiedConf])
+ end.
+
+verify_agent_entry(user_id, _UserId) ->
+ ok;
+verify_agent_entry(reg_type, RegType) ->
+ if
+ RegType =:= addr_port;
+ RegType =:= target_name ->
+ ok;
+ true ->
+ error({bad_reg_type, RegType})
+ end;
+verify_agent_entry(tdomain, TDomain) ->
+ snmp_conf:check_domain(TDomain);
+verify_agent_entry(port, Port) ->
+ snmp_conf:check_port(Port);
+verify_agent_entry(community, Comm) ->
+ snmp_conf:check_string(Comm);
+verify_agent_entry(engine_id, EngineId) ->
+ case EngineId of
+ discovery ->
+ ok;
+ _ ->
+ snmp_conf:check_string(EngineId)
+ end;
+verify_agent_entry(timeout, Timeout) ->
+ snmp_conf:check_timer(Timeout);
+verify_agent_entry(max_message_size, MMS) ->
+ snmp_conf:check_packet_size(MMS);
+verify_agent_entry(version, V) ->
+ if
+ V =:= v1;
+ V =:= v2;
+ V =:= v3 ->
+ ok;
+ true ->
+ error({bad_version, V})
+ end;
+verify_agent_entry(sec_model, Model) ->
+ snmp_conf:check_sec_model(Model);
+verify_agent_entry(sec_name, Name) ->
+ try snmp_conf:check_string(Name)
+ catch
+ _ ->
+ error({bad_sec_name, Name})
+ end;
+verify_agent_entry(sec_level, Level) ->
+ snmp_conf:check_sec_level(Level);
+verify_agent_entry(Item, _) ->
+ error({unknown_item, Item}).
+
read_users_config_file(Dir) ->
- Check = fun(C) -> check_user_config(C) end,
- case read_file(Dir, "users.conf", Check, []) of
- {ok, Conf} ->
- Conf;
- Error ->
+ Order = fun snmp_conf:no_order/2,
+ Check = fun (User, State) -> {check_user_config(User), State} end,
+ try read_file(Dir, "users.conf", Order, Check, [])
+ catch
+ throw:Error ->
?vlog("failure reading users config file: ~n ~p", [Error]),
- throw(Error)
+ erlang:raise(throw, Error, erlang:get_stacktrace())
end.
-
check_user_config({Id, Mod, Data}) ->
?vtrace("check_user_config -> entry with"
"~n Id: ~p"
@@ -1843,21 +1957,18 @@ check_user_config({Id, Mod, Data, DefaultAgentConfig} = _User)
case (catch verify_user_behaviour(Mod)) of
ok ->
?vtrace("check_user_config -> user behaviour verified", []),
- case verify_user_agent_config(DefaultAgentConfig) of
- {ok, DefAgentConf} ->
- ?vtrace("check_user_config -> "
- "user agent (default) config verified", []),
- User2 = {Id, Mod, Data, DefAgentConf},
- {ok, User2};
- {error, Reason} ->
- error({bad_default_agent_config, Reason})
- end;
+ DefAgentConf =
+ verify_default_agent_config(DefaultAgentConfig),
+ ?vtrace("check_user_config -> "
+ "user agent (default) config verified", []),
+ User2 = {Id, Mod, Data, DefAgentConf},
+ {ok, User2};
Error ->
throw(Error)
end;
check_user_config({Id, _Mod, _Data, DefaultAgentConfig})
when (Id =/= ?DEFAULT_USER) ->
- {error, {bad_default_agent_config, DefaultAgentConfig}};
+ error({bad_default_agent_config, DefaultAgentConfig});
check_user_config({Id, _Mod, _Data, _DefaultAgentConfig}) ->
error({bad_user_id, Id});
check_user_config(User) ->
@@ -1883,7 +1994,7 @@ init_user_config(User) ->
error_msg("user config check failed: "
"~n~w~n~w", [User, Reason])
end.
-
+
verify_user({Id, UserMod, UserData}) ->
verify_user({Id, UserMod, UserData, []});
verify_user({Id, UserMod, UserData, DefaultAgentConfig})
@@ -1896,15 +2007,24 @@ verify_user({Id, UserMod, UserData, DefaultAgentConfig})
[Id, UserMod, UserData, DefaultAgentConfig]),
case (catch verify_user_behaviour(UserMod)) of
ok ->
- case verify_user_agent_config(DefaultAgentConfig) of
- {ok, DefAgentConf} ->
- Config = default_agent_config(DefAgentConf),
- {ok, #user{id = Id,
- mod = UserMod,
- data = UserData,
- default_agent_config = Config}};
- {error, Reason} ->
- error({bad_default_agent_config, Reason})
+ try
+ {ok, SystemDefaultAgentConfig} = agent_info(),
+ Config =
+ ensure_config(
+ SystemDefaultAgentConfig,
+ verify_default_agent_config(DefaultAgentConfig)),
+%% Config =
+%% default_agent_config(
+%% verify_default_agent_config(DefaultAgentConfig)),
+ {ok, #user{id = Id,
+ mod = UserMod,
+ data = UserData,
+ default_agent_config = Config}}
+ catch
+ Error ->
+ ?vdebug("verify_user default_agent_config -> throw"
+ "~n Error: ~p", [Error]),
+ error({bad_default_agent_config, Error})
end;
Error ->
throw(Error)
@@ -1915,27 +2035,24 @@ verify_user({Id, _UserMod, _UserData, DefaultAgentConfig})
verify_user({Id, _, _, _}) ->
{error, {bad_user_id, Id}}.
-verify_user_agent_config(Conf) ->
+verify_default_agent_config(Conf) ->
try
- begin
- verify_invalid(Conf, [user_id, engine_id, address]),
- verify_agent_config2(Conf)
- end
+ verify_illegal(
+ Conf,
+ [user_id, engine_id, address, tdomain, taddress]),
+ verify_agent_config(Conf)
catch
- throw:Error ->
- ?vdebug("verify_user_agent_config -> throw"
+ Error ->
+ ?vdebug("verify_default_agent_config -> throw"
"~n Error: ~p", [Error]),
- Error
+ error({bad_default_agent_config, Error})
end.
+
read_usm_config_file(Dir) ->
- Check = fun(C) -> check_usm_user_config(C) end,
- case read_file(Dir, "usm.conf", Check, []) of
- {ok, Conf} ->
- Conf;
- Error ->
- throw(Error)
- end.
+ Order = fun snmp_conf:no_order/2,
+ Check = fun (User, State) -> {check_usm_user_config(User), State} end,
+ read_file(Dir, "usm.conf", Order, Check, []).
%% Identity-function
check_usm_user_config({EngineId, Name,
@@ -2028,7 +2145,7 @@ verify_usm_user_auth(usmNoAuthProtocol, AuthKey) ->
end;
verify_usm_user_auth(usmHMACMD5AuthProtocol, AuthKey)
when is_list(AuthKey) andalso (length(AuthKey) =:= 16) ->
- case is_crypto_supported(md5_mac_96) of
+ case is_crypto_supported(md5) of
true ->
case snmp_conf:all_integer(AuthKey) of
true ->
@@ -2037,7 +2154,7 @@ verify_usm_user_auth(usmHMACMD5AuthProtocol, AuthKey)
error({invalid_auth_key, usmHMACMD5AuthProtocol})
end;
false ->
- error({unsupported_crypto, md5_mac_96})
+ error({unsupported_crypto, md5})
end;
verify_usm_user_auth(usmHMACMD5AuthProtocol, AuthKey) when is_list(AuthKey) ->
Len = length(AuthKey),
@@ -2046,7 +2163,7 @@ verify_usm_user_auth(usmHMACMD5AuthProtocol, _AuthKey) ->
error({invalid_auth_key, usmHMACMD5AuthProtocol});
verify_usm_user_auth(usmHMACSHAAuthProtocol, AuthKey)
when is_list(AuthKey) andalso (length(AuthKey) =:= 20) ->
- case is_crypto_supported(sha_mac_96) of
+ case is_crypto_supported(sha) of
true ->
case snmp_conf:all_integer(AuthKey) of
true ->
@@ -2055,7 +2172,7 @@ verify_usm_user_auth(usmHMACSHAAuthProtocol, AuthKey)
error({invalid_auth_key, usmHMACSHAAuthProtocol})
end;
false ->
- error({unsupported_crypto, sha_mac_96})
+ error({unsupported_crypto, sha})
end;
verify_usm_user_auth(usmHMACSHAAuthProtocol, AuthKey) when is_list(AuthKey) ->
Len = length(AuthKey),
@@ -2074,7 +2191,7 @@ verify_usm_user_priv(usmNoPrivProtocol, PrivKey) ->
end;
verify_usm_user_priv(usmDESPrivProtocol, PrivKey)
when (length(PrivKey) =:= 16) ->
- case is_crypto_supported(des_cbc_decrypt) of
+ case is_crypto_supported(des_cbc) of
true ->
case snmp_conf:all_integer(PrivKey) of
true ->
@@ -2083,7 +2200,7 @@ verify_usm_user_priv(usmDESPrivProtocol, PrivKey)
error({invalid_priv_key, usmDESPrivProtocol})
end;
false ->
- error({unsupported_crypto, des_cbc_decrypt})
+ error({unsupported_crypto, des_cbc})
end;
verify_usm_user_priv(usmDESPrivProtocol, PrivKey) when is_list(PrivKey) ->
Len = length(PrivKey),
@@ -2092,7 +2209,7 @@ verify_usm_user_priv(usmDESPrivProtocol, _PrivKey) ->
error({invalid_priv_key, usmDESPrivProtocol});
verify_usm_user_priv(usmAesCfb128Protocol, PrivKey)
when (length(PrivKey) =:= 16) ->
- case is_crypto_supported(aes_cfb_128_decrypt) of
+ case is_crypto_supported(aes_cfb128) of
true ->
case snmp_conf:all_integer(PrivKey) of
true ->
@@ -2101,7 +2218,7 @@ verify_usm_user_priv(usmAesCfb128Protocol, PrivKey)
error({invalid_priv_key, usmAesCfb128Protocol})
end;
false ->
- error({unsupported_crypto, aes_cfb_128_decrypt})
+ error({unsupported_crypto, aes_cfb128})
end;
verify_usm_user_priv(usmAesCfb128Protocol, PrivKey) when is_list(PrivKey) ->
Len = length(PrivKey),
@@ -2111,135 +2228,135 @@ verify_usm_user_priv(usmAesCfb128Protocol, _PrivKey) ->
verify_usm_user_priv(PrivP, _PrivKey) ->
error({invalid_priv_protocol, PrivP}).
+
+-compile({inline, [{is_crypto_supported,1}]}).
is_crypto_supported(Func) ->
- %% The 'catch' handles the case when 'crypto' is
- %% not present in the system (or not started).
- case (catch lists:member(Func, crypto:info())) of
- true -> true;
- _ -> false
- end.
+ snmp_misc:is_crypto_supported(Func).
read_manager_config_file(Dir) ->
- Check = fun(Conf) -> check_manager_config(Conf) end,
- case read_file(Dir, "manager.conf", Check) of
- {ok, Conf} ->
- ?d("read_manager_config_file -> ok: "
- "~n Conf: ~p", [Conf]),
- %% If the address is not specified, then we assume
- %% it should be the local host.
- %% If the address is not possible to determine
- %% that way, then we give up...
- check_mandatory_manager_config(Conf),
- ensure_manager_config(Conf);
- Error ->
- throw(Error)
- end.
+ Order = fun order_manager_config/2,
+ Check = fun check_manager_config/2,
+ Conf = read_file(Dir, "manager.conf", Order, Check),
+ ?d("read_manager_config_file -> ok: "
+ "~n Conf: ~p", [Conf]),
+ %% If the address is not specified, then we assume
+ %% it should be the local host.
+ %% If the address is not possible to determine
+ %% that way, then we give up...
+ verify_someof(Conf, [port, transports]),
+ verify_mandatory(Conf, [engine_id, max_message_size]),
+ default_manager_config(Conf).
+
+default_manager_config(Conf) ->
+ %% Ensure valid transports entry
+ case lists:keyfind(transports, 1, Conf) of
+ false ->
+ {port, Port} = lists:keyfind(port, 1, Conf),
+ Domain =
+ case lists:keyfind(domain, 1, Conf) of
+ false ->
+ default_transport_domain();
+ {_, D} ->
+ D
+ end,
+ Family = snmp_conf:tdomain_to_family(Domain),
+ {ok, Hostname} = inet:gethostname(),
+ case inet:getaddr(Hostname, Family) of
+ {ok, Address} ->
+ lists:sort(
+ fun order_manager_config/2,
+ [{transports, [{Domain, {Address, Port}}]} | Conf]);
+ {error, _Reason} ->
+ ?d("default_manager_config -> "
+ "failed getting ~w address for ~s:~n"
+ " _Reason: ~p", [Family, Hostname, _Reason]),
+ Conf
+ end;
+ _ ->
+ Conf
+ end.
+
+order_manager_config(EntryA, EntryB) ->
+ snmp_conf:keyorder(1, EntryA, EntryB, [domain, port]).
+
+check_manager_config(Entry, undefined) ->
+ check_manager_config(Entry, {default_transport_domain(), undefined});
+check_manager_config({domain, Domain}, {_, Port}) ->
+ {snmp_conf:check_domain(Domain), {Domain, Port}};
+check_manager_config({port, Port}, {Domain, _}) ->
+ {ok = snmp_conf:check_port(Port), {Domain, Port}};
+check_manager_config({address, _}, {_, undefined}) ->
+ error({missing_mandatory, port});
+check_manager_config({address = Tag, Ip} = Entry, {Domain, Port} = State) ->
+ {case snmp_conf:check_ip(Domain, Ip) of
+ ok ->
+ [Entry,
+ {transports, [{Domain, {Ip, Port}}]}];
+ {ok, FixedIp} ->
+ [{Tag, FixedIp},
+ {transports, [{Domain, {FixedIp, Port}}]}]
+ end, State};
+check_manager_config({transports = Tag, Transports}, {_, Port} = State)
+ when is_list(Transports) ->
+ CheckedTransports =
+ [case Transport of
+ {Domain, Address} ->
+ case
+ case Port of
+ undefined ->
+ snmp_conf:check_address(Domain, Address);
+ _ ->
+ snmp_conf:check_address(Domain, Address, Port)
+ end
+ of
+ ok ->
+ Transport;
+ {ok, FixedAddress} ->
+ {Domain, FixedAddress}
+ end;
+ _Domain when Port =:= undefined->
+ error({missing_mandatory, port});
+ Domain ->
+ Family = snmp_conf:tdomain_to_family(Domain),
+ {ok, Hostname} = inet:gethostname(),
+ case inet:getaddr(Hostname, Family) of
+ {ok, IpAddr} ->
+ {Domain, {IpAddr, Port}};
+ {error, _} ->
+ error({bad_address, {Domain, Hostname}})
+ end
+ end
+ || Transport <- Transports],
+ {{ok, {Tag, CheckedTransports}}, State};
+check_manager_config(Entry, State) ->
+ {check_manager_config(Entry), State}.
-default_manager_config() ->
- {ok, HostName} = inet:gethostname(),
- case inet:getaddr(HostName, inet) of
- {ok, A} ->
- [{address, tuple_to_list(A)}];
- {error, _Reason} ->
- ?d("default_manager_config -> failed getting address: "
- "~n _Reason: ~p", [_Reason]),
- []
- end.
-
-check_manager_config({address, Addr}) ->
- snmp_conf:check_ip(Addr);
-check_manager_config({port, Port}) ->
- snmp_conf:check_integer(Port, {gt, 0});
check_manager_config({engine_id, EngineID}) ->
snmp_conf:check_string(EngineID);
check_manager_config({max_message_size, Max}) ->
snmp_conf:check_integer(Max, {gte, 484});
check_manager_config(Conf) ->
- {error, {unknown_config, Conf}}.
-
+ error({unknown_config, Conf}).
-check_mandatory_manager_config(Conf) ->
- Mand = [port, engine_id, max_message_size],
- check_mandatory_manager_config(Mand, Conf).
-
-check_mandatory_manager_config([], _Conf) ->
- ok;
-check_mandatory_manager_config([Item|Mand], Conf) ->
- case lists:keysearch(Item, 1, Conf) of
- false ->
- error({missing_mandatory_manager_config, Item});
- _ ->
- check_mandatory_manager_config(Mand, Conf)
- end.
-
-ensure_manager_config(Confs) ->
- ensure_manager_config(Confs, default_manager_config()).
-
-ensure_manager_config(Confs, []) ->
- Confs;
-ensure_manager_config(Confs, [{Key,_} = DefKeyVal|Defs]) ->
- case lists:keysearch(Key, 1, Confs) of
- false ->
- ensure_manager_config([DefKeyVal|Confs], Defs);
- {value, _Conf} ->
- ensure_manager_config(Confs, Defs)
- end.
-
-% ensure_manager_config([], Defs, Confs) ->
-% Confs ++ Defs;
-% ensure_manager_config(Confs0, [{Key, DefVal}|Defs], Acc) ->
-% case lists:keysearch(Key, 1, Confs0) of
-% false ->
-% ensure_manager_config(Confs0, Defs, [{Key, DefVal}|Acc]);
-% {value, Conf} ->
-% Confs = lists:keydelete(Key, 1, Confs0),
-% ensure_manager_config(Confs, Defs, [Conf|Acc])
-% end.
-
-
-
-read_file(Dir, FileName, Check, Default) ->
- File = filename:join(Dir, FileName),
- case file:read_file_info(File) of
- {ok, _} ->
- case (catch do_read(File, Check)) of
- {ok, Conf} ->
- {ok, Conf};
- Error ->
- ?vtrace("read_file -> read failed:"
- "~n Error: ~p", [Error]),
- Error
- end;
- {error, Reason} ->
+read_file(Dir, FileName, Order, Check, Default) ->
+ try snmp_conf:read(filename:join(Dir, FileName), Order, Check)
+ catch
+ {error, Reason} when element(1, Reason) =:= failed_open ->
?vlog("failed reading config from ~s: ~p", [FileName, Reason]),
- {ok, Default}
+ Default
end.
-read_file(Dir, FileName, Check) ->
- File = filename:join(Dir, FileName),
- case file:read_file_info(File) of
- {ok, _} ->
- case (catch do_read(File, Check)) of
- {ok, Conf} ->
- ?vtrace("read_file -> read ok"
- "~n Conf: ~p", [Conf]),
- {ok, Conf};
- Error ->
- ?vtrace("read_file -> read failed:"
- "~n Error: ~p", [Error]),
- Error
- end;
- {error, Reason} ->
+read_file(Dir, FileName, Order, Check) ->
+ try snmp_conf:read(filename:join(Dir, FileName), Order, Check)
+ catch
+ throw:{error, Reason} = Error
+ when element(1, Reason) =:= failed_open ->
error_msg("failed reading config from ~s: ~p", [FileName, Reason]),
- {error, {failed_reading, FileName, Reason}}
+ erlang:raise(throw, Error, erlang:get_stacktrace())
end.
-do_read(File, Check) ->
- {ok, snmp_conf:read(File, Check)}.
-
-
%%--------------------------------------------------------------------
%% Func: handle_call/3
%% Returns: {reply, Reply, State} |
@@ -2666,30 +2783,50 @@ handle_register_agent(UserId, TargetName, Config) ->
"~n Config: ~p", [UserId, TargetName, Config]),
case (catch agent_info(TargetName, user_id)) of
{error, _} ->
- ?vtrace("handle_register_agent -> user_id not found in config", []),
+ ?vtrace(
+ "handle_register_agent -> user_id not found in config", []),
case ets:lookup(snmpm_user_table, UserId) of
[#user{default_agent_config = DefConfig}] ->
- ?vtrace("handle_register_agent -> "
- "~n DefConfig: ~p", [DefConfig]),
- %% First, insert this users default config
- ?vtrace("handle_register_agent -> store default config", []),
- do_handle_register_agent(TargetName, DefConfig),
- %% Second, insert the config for this agent
- ?vtrace("handle_register_agent -> store config", []),
- do_handle_register_agent(TargetName,
- [{user_id, UserId}|Config]),
+ ?vtrace("handle_register_agent ->~n"
+ " DefConfig: ~p", [DefConfig]),
+ FixedConfig =
+ fix_agent_config(ensure_config(DefConfig, Config)),
+ ?vtrace("handle_register_agent ->~n"
+ " FixedConfig: ~p", [FixedConfig]),
+ do_handle_register_agent(
+ TargetName, [{user_id, UserId}|FixedConfig]),
%% <DIRTY-BACKWARD-COMPATIBILLITY>
- %% And now for some (backward compatibillity)
+ %% And now for some (backward compatibillity)
%% dirty crossref stuff
- ?vtrace("handle_register_agent -> lookup address", []),
- {ok, Addr} = agent_info(TargetName, address),
- ?vtrace("handle_register_agent -> Addr: ~p, lookup Port",
- [Addr]),
- {ok, Port} = agent_info(TargetName, port),
- ?vtrace("handle_register_agent -> register cross-ref fix", []),
- ets:insert(snmpm_agent_table,
- {{Addr, Port, target_name}, TargetName}),
+ {value, {_, Domain}} =
+ lists:keysearch(tdomain, 1, FixedConfig),
+ {value, {_, Address}} =
+ lists:keysearch(taddress, 1, FixedConfig),
+ ?vtrace(
+ "handle_register_agent -> register cross-ref fix", []),
+ ets:insert(snmpm_agent_table,
+ {{Domain, Address, target_name}, TargetName}),
%% </DIRTY-BACKWARD-COMPATIBILLITY>
+
+%% %% First, insert this users default config
+%% ?vtrace("handle_register_agent -> store default config", []),
+%% do_handle_register_agent(TargetName, DefConfig),
+%% %% Second, insert the config for this agent
+%% ?vtrace("handle_register_agent -> store config", []),
+%% do_handle_register_agent(TargetName,
+%% [{user_id, UserId}|Config]),
+%% %% <DIRTY-BACKWARD-COMPATIBILLITY>
+%% %% And now for some (backward compatibillity)
+%% %% dirty crossref stuff
+%% ?vtrace("handle_register_agent -> lookup taddress", []),
+%% {ok, {Addr, Port} = TAddress} =
+%% agent_info(TargetName, taddress),
+%% ?vtrace("handle_register_agent -> taddress: ~p",
+%% [TAddress]),
+%% ?vtrace("handle_register_agent -> register cross-ref fix", []),
+%% ets:insert(snmpm_agent_table,
+%% {{Addr, Port, target_name}, TargetName}),
+%% %% </DIRTY-BACKWARD-COMPATIBILLITY>
ok;
_ ->
{error, {not_found, UserId}}
@@ -2711,7 +2848,7 @@ handle_register_agent(UserId, TargetName, Config) ->
do_handle_register_agent(_TargetName, []) ->
ok;
do_handle_register_agent(TargetName, [{Item, Val}|Rest]) ->
- ?vtrace("handle_register_agent -> entry with"
+ ?vtrace("do_handle_register_agent -> entry with"
"~n TargetName: ~p"
"~n Item: ~p"
"~n Val: ~p"
@@ -2720,7 +2857,7 @@ do_handle_register_agent(TargetName, [{Item, Val}|Rest]) ->
ok ->
do_handle_register_agent(TargetName, Rest);
{error, Reason} ->
- ?vtrace("handle_register_agent -> failed updating ~p"
+ ?vtrace("do_handle_register_agent -> failed updating ~p"
"~n Item: ~p"
"~n Reason: ~p", [Item, Reason]),
ets:match_delete(snmpm_agent_table, {TargetName, '_'}),
@@ -2744,9 +2881,9 @@ handle_unregister_agent(UserId, TargetName) ->
%% <DIRTY-BACKWARD-COMPATIBILLITY>
%% And now for some (backward compatibillity)
%% dirty crossref stuff
- {ok, Addr} = agent_info(TargetName, address),
- {ok, Port} = agent_info(TargetName, port),
- ets:delete(snmpm_agent_table, {Addr, Port, target_name}),
+ {ok, Domain} = agent_info(TargetName, tdomain),
+ {ok, Address} = agent_info(TargetName, taddress),
+ ets:delete(snmpm_agent_table, {Domain, Address, target_name}),
%% </DIRTY-BACKWARD-COMPATIBILLITY>
ets:match_delete(snmpm_agent_table, {{TargetName, '_'}, '_'}),
ok;
@@ -2772,21 +2909,26 @@ handle_update_agent_info(UserId, TargetName, Info) ->
Error
end.
-handle_update_agent_info(TargetName, Info0) ->
+handle_update_agent_info(TargetName, Info) ->
?vtrace("handle_update_agent_info -> entry with"
"~n TargetName: ~p"
- "~n Info0: ~p", [TargetName, Info0]),
+ "~n Info: ~p", [TargetName, Info]),
%% Verify info
- try verify_agent_info(TargetName, Info0) of
- {ok, Info} ->
- do_update_agent_info(TargetName, Info);
+ try
+ verify_illegal(Info, [user_id]),
+ %% If port or domain is part of the info, then use it.
+ %% If not, lookup what is already stored for
+ %% this agent and use that.
+ do_update_agent_info(
+ TargetName,
+ fix_agent_config(
+ verify_agent_config(
+ ensure_agent_info(TargetName, [port,tdomain], Info))))
+ catch
Error ->
- Error
- catch
- throw:Error ->
Error;
T:E ->
- {error, {failed_info_verification, Info0, T, E}}
+ {error, {failed_info_verification, Info, T, E}}
end.
handle_update_agent_info(UserId, TargetName, Item, Val) ->
@@ -2798,6 +2940,9 @@ handle_update_agent_info(UserId, TargetName, Item, Val) ->
handle_update_agent_info(TargetName, [{Item, Val}]).
do_update_agent_info(TargetName, Info) ->
+ ?vtrace("do_update_agent_info -> entry with~n"
+ " TargetName: ~p~n"
+ " Info: ~p", [TargetName,Info]),
InsertItem =
fun({Item, Val}) ->
ets:insert(snmpm_agent_table, {{TargetName, Item}, Val})
@@ -2879,11 +3024,11 @@ do_update_usm_user_info(Key,
#usm_user{auth = usmHMACMD5AuthProtocol} = User,
auth_key, Val)
when length(Val) =:= 16 ->
- case is_crypto_supported(md5_mac_96) of
+ case is_crypto_supported(md5) of
true ->
do_update_usm_user_info(Key, User#usm_user{auth_key = Val});
false ->
- {error, {unsupported_crypto, md5_mac_96}}
+ {error, {unsupported_crypto, md5}}
end;
do_update_usm_user_info(_Key,
#usm_user{auth = usmHMACMD5AuthProtocol},
@@ -2898,11 +3043,11 @@ do_update_usm_user_info(Key,
#usm_user{auth = usmHMACSHAAuthProtocol} = User,
auth_key, Val)
when length(Val) =:= 20 ->
- case is_crypto_supported(sha_mac_96) of
+ case is_crypto_supported(sha) of
true ->
do_update_usm_user_info(Key, User#usm_user{auth_key = Val});
false ->
- {error, {unsupported_crypto, sha_mac_96}}
+ {error, {unsupported_crypto, sha}}
end;
do_update_usm_user_info(_Key,
#usm_user{auth = usmHMACSHAAuthProtocol},
@@ -2933,21 +3078,21 @@ do_update_usm_user_info(Key,
#usm_user{priv = usmDESPrivProtocol} = User,
priv_key, Val)
when length(Val) =:= 16 ->
- case is_crypto_supported(des_cbc_decrypt) of
+ case is_crypto_supported(des_cbc) of
true ->
do_update_usm_user_info(Key, User#usm_user{priv_key = Val});
false ->
- {error, {unsupported_crypto, des_cbc_decrypt}}
+ {error, {unsupported_crypto, des_cbc}}
end;
do_update_usm_user_info(Key,
#usm_user{priv = usmAesCfb128Protocoll} = User,
priv_key, Val)
when length(Val) =:= 16 ->
- case is_crypto_supported(aes_cfb_128_decrypt) of
+ case is_crypto_supported(aes_cfb128) of
true ->
do_update_usm_user_info(Key, User#usm_user{priv_key = Val});
false ->
- {error, {unsupported_crypto, aes_cfb_128_decrypt}}
+ {error, {unsupported_crypto, aes_cfb128}}
end;
do_update_usm_user_info(_Key,
#usm_user{auth = usmHMACSHAAuthProtocol},
@@ -2979,109 +3124,42 @@ verify_mandatory(Conf, [Mand|Mands]) ->
true ->
verify_mandatory(Conf, Mands);
false ->
- throw({error, {missing_mandatory_config, Mand}})
+ error({missing_mandatory_config, Mand})
end.
-verify_invalid(_, []) ->
+verify_illegal(_, []) ->
ok;
-verify_invalid(Conf, [Inv|Invs]) ->
+verify_illegal(Conf, [Inv|Invs]) ->
case lists:member(Inv, Conf) of
false ->
- verify_invalid(Conf, Invs);
+ verify_illegal(Conf, Invs);
true ->
- throw({error, {illegal_config, Inv}})
+ error({illegal_config, Inv})
end.
-
-verify_val(user_id, UserId) ->
- {ok, UserId};
-verify_val(reg_type, RegType)
- when (RegType =:= addr_port) orelse (RegType =:= target_name) ->
- {ok, RegType};
-verify_val(tdomain = Item, snmpUDPDomain = _Domain) ->
- verify_val(Item, transportDomainUdpIpv4);
-verify_val(tdomain, Domain) ->
- case lists:member(Domain, ?SUPPORTED_DOMAINS) of
+verify_someof(Conf, [Mand|Mands]) ->
+ case lists:keymember(Mand, 1, Conf) of
true ->
- {ok, Domain};
+ ok;
false ->
- case lists:member(Domain, snmp_conf:all_domains()) of
- true ->
- error({unsupported_domain, Domain});
- false ->
- error({unknown_domain, Domain})
+ case Mands of
+ [] ->
+ error({missing_mandatory_config, Mand});
+ _ ->
+ verify_someof(Conf, Mands)
end
- end;
-verify_val(address, {Domain, Addr0}) ->
- case normalize_address(Domain, Addr0) of
- {_A1, _A2, _A3, _A4} = Addr ->
- {ok, Addr};
- {_A1, _A2, _A3, _A4, _A5, _A6, _A7, _A8} = Addr ->
- {ok, Addr};
- _ when is_list(Addr0) ->
- case (catch snmp_conf:check_ip(Addr0)) of
- ok ->
- {ok, list_to_tuple(Addr0)};
- Err ->
- Err
- end;
- _ ->
- error({bad_address, Addr0})
- end;
-verify_val(address, BadAddress) ->
- error({bad_address, BadAddress});
-verify_val(port, Port) ->
- case (catch snmp_conf:check_integer(Port, {gt, 0})) of
- ok ->
- {ok, Port};
- Err ->
- Err
- end;
-verify_val(community, Comm) ->
- case (catch snmp_conf:check_string(Comm)) of
- ok ->
- {ok, Comm};
- Err ->
- Err
- end;
-verify_val(engine_id, discovery = EngineId) ->
- {ok, EngineId};
-verify_val(engine_id, EngineId) ->
- case (catch snmp_conf:check_string(EngineId)) of
- ok ->
- {ok, EngineId};
- Err ->
- Err
- end;
-verify_val(timeout, Timeout) ->
- (catch snmp_conf:check_timer(Timeout));
-verify_val(max_message_size, MMS) ->
- case (catch snmp_conf:check_packet_size(MMS)) of
- ok ->
- {ok, MMS};
- Err ->
- Err
- end;
-verify_val(version, V)
- when (V =:= v1) orelse (V =:= v2) orelse (V =:= v3) ->
- {ok, V};
-verify_val(version, BadVersion) ->
- error({bad_version, BadVersion});
-verify_val(sec_model, Model) ->
- (catch snmp_conf:check_sec_model(Model));
-verify_val(sec_name, Name) when is_list(Name) ->
- case (catch snmp_conf:check_string(Name)) of
- ok ->
- {ok, Name};
- Err ->
- Err
- end;
-verify_val(sec_name, BadName) ->
- error({bad_sec_name, BadName});
-verify_val(sec_level, Level) ->
- (catch snmp_conf:check_sec_level(Level));
-verify_val(Item, _) ->
- {error, {unknown_item, Item}}.
+ end.
+
+ensure_config([], Config) ->
+ Config;
+ensure_config([Default|Defaults], Config) ->
+ case lists:keymember(element(1, Default), 1, Config) of
+ true ->
+ ensure_config(Defaults, Config);
+ false ->
+ ensure_config(Defaults, [Default|Config])
+ end.
+
%%%-------------------------------------------------------------------
@@ -3239,31 +3317,14 @@ init_mini_mib_elems(MibName, [_|T], Res) ->
%%----------------------------------------------------------------------
-normalize_address(Addr) ->
- normalize_address(snmpUDPDomain, Addr).
-
-normalize_address(snmpUDPDomain, Addr) ->
- normalize_address(transportDomainUdpIpv4, Addr);
-
-normalize_address(Domain, Addr) ->
- case inet:getaddr(Addr, td2fam(Domain)) of
- {ok, Addr2} ->
- Addr2;
- _ when is_list(Addr) ->
- case (catch snmp_conf:check_ip(Domain, Addr)) of
- ok ->
- list_to_tuple(Addr);
- _ ->
- Addr
- end;
- _ ->
- Addr
+fix_address(Domain, Address) ->
+ case snmp_conf:check_address(Domain, Address) of
+ ok ->
+ Address;
+ {ok, NAddress} ->
+ NAddress
end.
-td2fam(transportDomainUdpIpv4) -> inet;
-td2fam(transportDomainUdpIpv6) -> inet6.
-
-
%%----------------------------------------------------------------------
call(Req) ->
@@ -3373,4 +3434,3 @@ error_msg(F, A) ->
%% p(F, A) ->
%% io:format("~w:" ++ F ++ "~n", [?MODULE | A]).
-
diff --git a/lib/snmp/src/manager/snmpm_internal.hrl b/lib/snmp/src/manager/snmpm_internal.hrl
index 53ad41c6b0..e917206f13 100644
--- a/lib/snmp/src/manager/snmpm_internal.hrl
+++ b/lib/snmp/src/manager/snmpm_internal.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/manager/snmpm_misc_sup.erl b/lib/snmp/src/manager/snmpm_misc_sup.erl
index 1a5d7676df..6ff82b322b 100644
--- a/lib/snmp/src/manager/snmpm_misc_sup.erl
+++ b/lib/snmp/src/manager/snmpm_misc_sup.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/manager/snmpm_mpd.erl b/lib/snmp/src/manager/snmpm_mpd.erl
index d7148bb4a4..191dc2c281 100644
--- a/lib/snmp/src/manager/snmpm_mpd.erl
+++ b/lib/snmp/src/manager/snmpm_mpd.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -21,7 +22,7 @@
-export([init/1,
- process_msg/7,
+ process_msg/7, process_msg/6,
generate_msg/5, generate_response_msg/4,
next_msg_id/0,
@@ -67,8 +68,9 @@
%%%-----------------------------------------------------------------
init(Vsns) ->
?vdebug("init -> entry with ~p", [Vsns]),
- {A,B,C} = erlang:now(),
- random:seed(A,B,C),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
snmpm_config:cre_counter(msg_id, random:uniform(2147483647)),
snmpm_config:cre_counter(req_id, random:uniform(2147483647)),
init_counters(),
@@ -92,8 +94,10 @@ reset(#state{v3 = V3}) ->
%% Purpose: This is the main Message Dispatching function. (see
%% section 4.2.1 in rfc2272)
%%-----------------------------------------------------------------
-process_msg(Msg, Domain, Addr, Port, State, NoteStore, Logger) ->
+process_msg(Msg, Domain, Ip, Port, State, NoteStore, Logger) ->
+ process_msg(Msg, Domain, {Ip, Port}, State, NoteStore, Logger).
+process_msg(Msg, Domain, Addr, State, NoteStore, Logger) ->
inc(snmpInPkts),
case (catch snmp_pdus:dec_message_only(binary_to_list(Msg))) of
@@ -102,17 +106,17 @@ process_msg(Msg, Domain, Addr, Port, State, NoteStore, Logger) ->
#message{version = 'version-1', vsn_hdr = Community, data = Data}
when State#state.v1 =:= true ->
HS = ?empty_msg_size + length(Community),
- process_v1_v2c_msg('version-1', NoteStore, Msg,
- Domain, Addr, Port,
- Community, Data, HS, Logger);
+ process_v1_v2c_msg(
+ 'version-1', NoteStore, Msg, Domain, Addr,
+ Community, Data, HS, Logger);
%% Version 2
#message{version = 'version-2', vsn_hdr = Community, data = Data}
when State#state.v2c =:= true ->
HS = ?empty_msg_size + length(Community),
- process_v1_v2c_msg('version-2', NoteStore, Msg,
- Domain, Addr, Port,
- Community, Data, HS, Logger);
+ process_v1_v2c_msg(
+ 'version-2', NoteStore, Msg, Domain, Addr,
+ Community, Data, HS, Logger);
%% Version 3
#message{version = 'version-3', vsn_hdr = H, data = Data}
@@ -122,7 +126,7 @@ process_msg(Msg, Domain, Addr, Port, State, NoteStore, Logger) ->
"~n msgFlags: ~p"
"~n msgSecModel: ~p",
[H#v3_hdr.msgID,H#v3_hdr.msgFlags,H#v3_hdr.msgSecurityModel]),
- process_v3_msg(NoteStore, Msg, H, Data, Addr, Port, Logger);
+ process_v3_msg(NoteStore, Msg, H, Data, Addr, Logger);
%% Crap
{'EXIT', {bad_version, Vsn}} ->
@@ -148,32 +152,27 @@ process_msg(Msg, Domain, Addr, Port, State, NoteStore, Logger) ->
%%-----------------------------------------------------------------
%% Handles a Community based message (v1 or v2c).
%%-----------------------------------------------------------------
-process_v1_v2c_msg(Vsn, _NoteStore, Msg, Domain,
- Addr, Port,
- Community, Data, HS, Log) ->
+process_v1_v2c_msg(
+ Vsn, _NoteStore, Msg, Domain, Addr, Community, Data, HS, Log) ->
?vdebug("process_v1_v2c_msg -> entry with"
"~n Vsn: ~p"
"~n Domain: ~p"
"~n Addr: ~p"
- "~n Port: ~p"
"~n Community: ~p"
- "~n HS: ~p", [Vsn, Domain, Addr, Port, Community, HS]),
-
+ "~n HS: ~p", [Vsn, Domain, Addr, Community, HS]),
+
{TDomain, TAddress} =
try
- begin
- TD = snmp_conf:mk_tdomain(Domain),
- TA = snmp_conf:mk_taddress(Domain, Addr, Port),
- {TD, TA}
- end
+ {snmp_conf:mk_tdomain(Domain),
+ snmp_conf:mk_taddress(Domain, Addr)}
catch
throw:{error, TReason} ->
throw({discarded, {badarg, Domain, TReason}})
end,
Max = get_max_message_size(),
- AgentMax = get_agent_max_message_size(Addr, Port),
+ AgentMax = get_agent_max_message_size(Domain, Addr),
PduMS = pdu_ms(Max, AgentMax, HS),
?vtrace("process_v1_v2c_msg -> PduMS: ~p", [PduMS]),
@@ -213,13 +212,12 @@ sec_model('version-2') -> ?SEC_V2C.
%% Handles a SNMPv3 Message, following the procedures in rfc2272,
%% section 4.2 and 7.2
%%-----------------------------------------------------------------
-process_v3_msg(NoteStore, Msg, Hdr, Data, Addr, Port, Log) ->
+process_v3_msg(NoteStore, Msg, Hdr, Data, Address, Log) ->
+ ?vdebug(
+ "process_v3_msg -> entry with~n"
+ " Hdr: ~p~n"
+ " Address: ~p", [Hdr, Address]),
- ?vdebug("process_v3_msg -> entry with"
- "~n Hdr: ~p"
- "~n Addr: ~p"
- "~n Port: ~p", [Hdr, Addr, Port]),
-
%% 7.2.3
#v3_hdr{msgID = MsgID,
msgMaxSize = MMS,
@@ -352,8 +350,8 @@ process_v3_msg(NoteStore, Msg, Hdr, Data, Addr, Port, Log) ->
%% 4.2.2.1.1 - we don't handle proxys yet => we only
%% handle CtxEngineID to ourselves
%% Check that we actually know of an agent with this
- %% CtxEngineID and Addr/Port
- case is_known_engine_id(CtxEngineID, Addr, Port) of
+ %% CtxEngineID and Address
+ case is_known_engine_id(CtxEngineID, Address) of
true ->
?vtrace("and the agent EngineID (~p) "
"is know to us", [CtxEngineID]),
@@ -591,8 +589,8 @@ sec_engine_id(TargetName) ->
%% BMK BMK BMK
-%% Denna verkar v�ldigt lik generate_v1_v2c_response_msg!
-%% Gemensam? Borde det finnas olikheter?
+%% This one looks very similar to lik generate_v1_v2c_response_msg!
+%% Common/shared? Should there be differences?
%%
generate_v1_v2c_msg(Vsn, Pdu, Community, Log) ->
?vdebug("generate_v1_v2c_msg -> encode pdu", []),
@@ -866,14 +864,23 @@ get_max_message_size() ->
end.
%% The the MMS of the agent
-get_agent_max_message_size(Addr, Port) ->
- case snmpm_config:get_agent_engine_max_message_size(Addr, Port) of
+get_agent_max_message_size(Domain, Addr) ->
+ case snmpm_config:get_agent_engine_max_message_size(Domain, Addr) of
{ok, MMS} ->
MMS;
_Error ->
- ?vlog("unknown agent: ~w:~w", [Addr, Port]),
+ ?vlog("unknown agent: ~s",
+ [snmp_conf:mk_addr_string({Domain, Addr})]),
get_max_message_size()
end.
+%% get_agent_max_message_size(Addr, Port) ->
+%% case snmpm_config:get_agent_engine_max_message_size(Addr, Port) of
+%% {ok, MMS} ->
+%% MMS;
+%% _Error ->
+%% ?vlog("unknown agent: ~w:~w", [Addr, Port]),
+%% get_max_message_size()
+%% end.
%% Get "our" (manager) engine id
get_engine_id() ->
@@ -888,17 +895,9 @@ get_engine_id() ->
get_agent_engine_id(Name) ->
snmpm_config:get_agent_engine_id(Name).
-is_known_engine_id(EngineID, Addr, Port) ->
+is_known_engine_id(EngineID, {Addr, Port}) ->
snmpm_config:is_known_engine_id(EngineID, Addr, Port).
-% get_agent_engine_id(Addr, Port) ->
-% case snmpm_config:get_agent_engine_id(Addr, Port) of
-% {ok, Id} ->
-% Id;
-% _Error ->
-% ""
-% end.
-
%%-----------------------------------------------------------------
%% Sequence number (msg-id & req-id) functions
diff --git a/lib/snmp/src/manager/snmpm_net_if.erl b/lib/snmp/src/manager/snmpm_net_if.erl
index 4d6bd9aa33..93c987eb0f 100644
--- a/lib/snmp/src/manager/snmpm_net_if.erl
+++ b/lib/snmp/src/manager/snmpm_net_if.erl
@@ -1,23 +1,26 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
+-ifndef(snmpm_net_if_mt).
-module(snmpm_net_if).
+-endif.
-behaviour(gen_server).
-behaviour(snmpm_network_interface).
@@ -27,9 +30,9 @@
-export([
start_link/2,
stop/1,
- send_pdu/6, % Backward compatibillity
- send_pdu/7, % Backward compatibillity
- send_pdu/8,
+ send_pdu/6, % Backward compatibility
+ send_pdu/7, % Partly backward compatibility
+ send_pdu/8, % Backward compatibility
inform_response/4,
@@ -55,11 +58,11 @@
%% -define(VMODULE,"NET_IF").
-include("snmp_verbosity.hrl").
--record(state,
+-record(state,
{
server,
note_store,
- sock,
+ transports = [],
mpd_state,
log,
irb = auto, % auto | {user, integer()}
@@ -67,6 +70,9 @@
filter
}).
+-record(transport,
+ {socket,
+ domain = snmpUDPDomain}).
-define(DEFAULT_FILTER_MODULE, snmpm_net_if_filter).
-define(DEFAULT_FILTER_OPTS, [{module, ?DEFAULT_FILTER_MODULE}]).
@@ -99,30 +105,32 @@ start_link(Server, NoteStore) ->
stop(Pid) ->
call(Pid, stop).
-send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port) ->
- send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port, ?DEFAULT_EXTRA_INFO).
-
-send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port, ExtraInfo) ->
- Domain = snmpm_config:default_transport_domain(),
- send_pdu(Pid, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo).
+send_pdu(Pid, Pdu, Vsn, MsgData, Domain_or_Ip, Addr_or_Port) ->
+ send_pdu(
+ Pid, Pdu, Vsn, MsgData, Domain_or_Ip, Addr_or_Port, ?DEFAULT_EXTRA_INFO).
-send_pdu(Pid, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo)
+send_pdu(Pid, Pdu, Vsn, MsgData, Domain_or_Ip, Addr_or_Port, ExtraInfo)
when is_record(Pdu, pdu) ->
- ?d("send_pdu -> entry with"
- "~n Pid: ~p"
- "~n Pdu: ~p"
- "~n Vsn: ~p"
- "~n MsgData: ~p"
- "~n Domain: ~p"
- "~n Addr: ~p"
- "~n Port: ~p", [Pid, Pdu, Vsn, MsgData, Domain, Addr, Port]),
- cast(Pid, {send_pdu, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo}).
+ ?d("send_pdu -> entry with~n"
+ " Pid: ~p~n"
+ " Pdu: ~p~n"
+ " Vsn: ~p~n"
+ " MsgData: ~p~n"
+ " Domain/IP: ~p~n"
+ " Addr/Port: ~p",
+ [Pid, Pdu, Vsn, MsgData, Domain_or_Ip, Addr_or_Port]),
+ {Domain, Addr} = address(Domain_or_Ip, Addr_or_Port),
+ cast(Pid, {send_pdu, Pdu, Vsn, MsgData, Domain, Addr, ExtraInfo}).
+
+send_pdu(Pid, Pdu, Vsn, MsgData, Domain, Ip, Port, ExtraInfo) ->
+ send_pdu(Pid, Pdu, Vsn, MsgData, Domain, {Ip, Port}, ExtraInfo).
note_store(Pid, NoteStore) ->
call(Pid, {note_store, NoteStore}).
-inform_response(Pid, Ref, Addr, Port) ->
- cast(Pid, {inform_response, Ref, Addr, Port}).
+inform_response(Pid, Ref, Domain_or_Ip, Addr_or_Port) ->
+ {Domain, Addr} = address(Domain_or_Ip, Addr_or_Port),
+ cast(Pid, {inform_response, Ref, Domain, Addr}).
info(Pid) ->
call(Pid, info).
@@ -144,6 +152,64 @@ filter_reset(Pid) ->
%%%-------------------------------------------------------------------
+%%% Multi-thread manager
+%%%-------------------------------------------------------------------
+
+-ifdef(snmpm_net_if_mt).
+
+%% This function is called through the macro below to
+%% (in the not multithreaded case) avoid creating the
+%% Failer/4 fun, and to avoid calling the Worker through a fun
+%% (now it shall not be a fun, just a code snippet).
+
+worker(Worker, Failer, #state{log = Log} = State) ->
+ Verbosity = get(verbosity),
+ spawn_opt(
+ fun () ->
+ try
+ put(sname, mnifw),
+ put(verbosity, Verbosity),
+ NewState =
+ case do_reopen_log(Log) of
+ Log ->
+ State;
+ NewLog ->
+ State#state{log = NewLog}
+ end,
+ Worker(NewState)
+ of
+ Result ->
+ %% Winds up in handle_info {'DOWN', ...}
+ erlang:exit({net_if_worker, Result})
+ catch
+ Class:Reason ->
+ %% Winds up in handle_info {'DOWN', ...}
+ erlang:exit(
+ {net_if_worker, Failer,
+ Class, Reason, erlang:get_stacktrace()})
+ end
+ end,
+ [monitor]).
+-define(
+ worker(S, Worker, Failer, State),
+ begin
+ worker(
+ fun (S) -> begin Worker end end,
+ begin Failer end,
+ (State))
+ end).
+
+-else.
+
+-define(
+ worker(S, Worker, _Failer, State),
+ begin (S) = (State), begin Worker end end).
+
+-endif.
+
+
+
+%%%-------------------------------------------------------------------
%%% Callback functions from gen_server
%%%-------------------------------------------------------------------
@@ -158,12 +224,19 @@ init([Server, NoteStore]) ->
?d("init -> entry with"
"~n Server: ~p"
"~n NoteStore: ~p", [Server, NoteStore]),
- case (catch do_init(Server, NoteStore)) of
+ try do_init(Server, NoteStore)
+ catch
{error, Reason} ->
- {stop, Reason};
- {ok, State} ->
- {ok, State}
+ {stop, Reason}
end.
+
+-ifdef(snmpm_net_if_mt).
+%% This should really be protected, but it also needs to
+%% be writable for the worker processes, so...
+-define(inform_table_opts, [set, public, named_table, {keypos, 1}]).
+-else.
+-define(inform_table_opts, [set, protected, named_table, {keypos, 1}]).
+-endif.
do_init(Server, NoteStore) ->
process_flag(trap_exit, true),
@@ -173,18 +246,18 @@ do_init(Server, NoteStore) ->
process_flag(priority, Prio),
%% -- Create inform request table --
- ets:new(snmpm_inform_request_table,
- [set, protected, named_table, {keypos, 1}]),
+ ets:new(snmpm_inform_request_table, ?inform_table_opts),
%% -- Verbosity --
{ok, Verbosity} = snmpm_config:system_info(net_if_verbosity),
- put(sname,mnif),
- put(verbosity,Verbosity),
+ put(sname, mnif),
+ put(verbosity, Verbosity),
?vlog("starting", []),
%% -- MPD --
{ok, Vsns} = snmpm_config:system_info(versions),
MpdState = snmpm_mpd:init(Vsns),
+ ?vdebug("MpdState: ~w", [MpdState]),
%% -- Module dependent options --
{ok, Opts} = snmpm_config:system_info(net_if_options),
@@ -193,14 +266,6 @@ do_init(Server, NoteStore) ->
{ok, IRB} = snmpm_config:system_info(net_if_irb),
IrGcRef = irgc_start(IRB),
- %% -- Socket --
- SndBuf = get_opt(Opts, sndbuf, default),
- RecBuf = get_opt(Opts, recbuf, default),
- BindTo = get_opt(Opts, bind_to, false),
- NoReuse = get_opt(Opts, no_reuse, false),
- {ok, Port} = snmpm_config:system_info(port),
- {ok, Sock} = do_open_port(Port, SndBuf, RecBuf, BindTo, NoReuse),
-
%% Flow control --
FilterOpts = get_opt(Opts, filter, []),
FilterMod = create_filter(FilterOpts),
@@ -209,77 +274,107 @@ do_init(Server, NoteStore) ->
%% -- Audit trail log ---
{ok, ATL} = snmpm_config:system_info(audit_trail_log),
Log = do_init_log(ATL),
+ ?vdebug("Log: ~w", [Log]),
+
+ {ok, DomainAddresses} = snmpm_config:system_info(transports),
+ ?vdebug("DomainAddresses: ~w",[DomainAddresses]),
+ CommonSocketOpts = common_socket_opts(Opts),
+ BindTo = get_opt(Opts, bind_to, false),
+ case
+ [begin
+ {IpPort, SocketOpts} =
+ socket_params(Domain, Address, BindTo, CommonSocketOpts),
+ Socket = socket_open(IpPort, SocketOpts),
+ #transport{socket = Socket, domain = Domain}
+ end || {Domain, Address} <- DomainAddresses]
+ of
+ [] ->
+ ?vinfo("No transports configured: ~p", [DomainAddresses]),
+ throw({error, {no_transports,DomainAddresses}});
+ Transports ->
+ %% -- Initiate counters ---
+ init_counters(),
+
+ %% -- We are done ---
+ State = #state{
+ server = Server,
+ note_store = NoteStore,
+ mpd_state = MpdState,
+ transports = Transports,
+ log = Log,
+ irb = IRB,
+ irgc = IrGcRef,
+ filter = FilterMod},
+ ?vdebug("started", []),
+ {ok, State}
+ end.
- %% -- Initiate counters ---
- init_counters(),
-
- %% -- We are done ---
- State = #state{server = Server,
- note_store = NoteStore,
- mpd_state = MpdState,
- sock = Sock,
- log = Log,
- irb = IRB,
- irgc = IrGcRef,
- filter = FilterMod},
- ?vdebug("started", []),
- {ok, State}.
-
-
-%% Open port
-do_open_port(Port, SendSz, RecvSz, BindTo, NoReuse) ->
- ?vtrace("do_open_port -> entry with"
- "~n Port: ~p"
- "~n SendSz: ~p"
- "~n RecvSz: ~p"
- "~n BindTo: ~p"
- "~n NoReuse: ~p", [Port, SendSz, RecvSz, BindTo, NoReuse]),
- IpOpts1 = bind_to(BindTo),
- IpOpts2 = no_reuse(NoReuse),
- IpOpts3 = recbuf(RecvSz),
- IpOpts4 = sndbuf(SendSz),
- IpOpts = [binary | IpOpts1 ++ IpOpts2 ++ IpOpts3 ++ IpOpts4],
- OpenRes =
- case init:get_argument(snmpm_fd) of
- {ok, [[FdStr]]} ->
- Fd = list_to_integer(FdStr),
- gen_udp:open(0, [{fd, Fd}|IpOpts]);
- error ->
- gen_udp:open(Port, IpOpts)
- end,
- case OpenRes of
+socket_open(IpPort, SocketOpts) ->
+ ?vtrace("socket_open -> entry with~n"
+ " IpPort: ~p~n"
+ " SocketOpts: ~p", [IpPort, SocketOpts]),
+ case gen_udp:open(IpPort, SocketOpts) of
{error, _} = Error ->
throw(Error);
- OK ->
- OK
+ {ok, Socket} ->
+ Socket
end.
-bind_to(true) ->
- case snmpm_config:system_info(address) of
- {ok, Addr} when is_list(Addr) ->
- [{ip, list_to_tuple(Addr)}];
- {ok, Addr} ->
- [{ip, Addr}];
+socket_params(Domain, {IpAddr, IpPort} = Addr, BindTo, CommonSocketOpts) ->
+ Family = snmp_conf:tdomain_to_family(Domain),
+ SocketOpts =
+ case Family of
+ inet6 ->
+ [Family, {ipv6_v6only, true} | CommonSocketOpts];
+ Family ->
+ [Family | CommonSocketOpts]
+ end,
+ case Family of
+ inet ->
+ case init:get_argument(snmpm_fd) of
+ {ok, [[FdStr]]} ->
+ Fd = list_to_integer(FdStr),
+ case BindTo of
+ true ->
+ {IpPort, [{ip, IpAddr}, {fd, Fd} | SocketOpts]};
+ _ ->
+ {0, [{fd, Fd} | SocketOpts]}
+ end;
+ error ->
+ socket_params(SocketOpts, Addr, BindTo)
+ end;
_ ->
- []
- end;
-bind_to(_) ->
- [].
-
-no_reuse(false) ->
- [{reuseaddr, true}];
-no_reuse(_) ->
- [].
-
-recbuf(default) ->
- [];
-recbuf(Sz) ->
- [{recbuf, Sz}].
+ socket_params(SocketOpts, Addr, BindTo)
+ end.
+%%
+socket_params(SocketOpts, {IpAddr, IpPort}, BindTo) ->
+ case BindTo of
+ true ->
+ {IpPort, [{ip, IpAddr} | SocketOpts]};
+ _ ->
+ {IpPort, SocketOpts}
+ end.
-sndbuf(default) ->
- [];
-sndbuf(Sz) ->
- [{sndbuf, Sz}].
+common_socket_opts(Opts) ->
+ [binary
+ | case get_opt(Opts, sndbuf, default) of
+ default ->
+ [];
+ Sz ->
+ [{sndbuf, Sz}]
+ end ++
+ case get_opt(Opts, recbuf, default) of
+ default ->
+ [];
+ Sz ->
+ [{sndbuf, Sz}]
+ end ++
+ case get_opt(Opts, no_reuse, false) of
+ false ->
+ [{reuseaddr, true}];
+ _ ->
+ []
+ end].
create_filter(Opts) when is_list(Opts) ->
@@ -294,6 +389,10 @@ create_filter(BadOpts) ->
throw({error, {bad_filter_opts, BadOpts}}).
+%% ----------------------------------------------------------------------
+%% Audit Trail Logger
+%% ----------------------------------------------------------------------
+
%% Open log
do_init_log(false) ->
?vtrace("do_init_log(false) -> entry", []),
@@ -314,24 +413,69 @@ do_init_log(true) ->
Function = increment_counter,
Args = [atl_seqno, Initial, Max],
SeqNoGen = {Module, Function, Args},
- case snmp_log:create(Name, File,
- SeqNoGen, Size, Repair, true) of
+ case snmp_log:create(
+ Name, File, SeqNoGen, Size, Repair, true) of
{ok, Log} ->
?vdebug("log created: ~w", [Log]),
- {Log, Type};
+ {Name, Log, Type};
{error, Reason} ->
throw({error, {failed_create_audit_log, Reason}})
end;
_ ->
case snmp_log:create(Name, File, Size, Repair, true) of
{ok, Log} ->
- {Log, Type};
+ ?vdebug("log created: ~w", [Log]),
+ {Name, Log, Type};
{error, Reason} ->
throw({error, {failed_create_audit_log, Reason}})
end
end.
-
+-ifdef(snmpm_net_if_mt).
+do_reopen_log(undefined) ->
+ undefined;
+do_reopen_log({Name, Log, Type}) ->
+ case snmp_log:open(Name, Log) of
+ {ok, NewLog} ->
+ {Name, NewLog, Type};
+ {error, Reason} ->
+ warning_msg(
+ "NetIf worker ~p failed to open ATL:~n"
+ " ~p", [self(), Reason]),
+ undefined
+ end.
+-endif.
+
+%% Close log
+do_close_log(undefined) ->
+ ok;
+do_close_log({_Name, Log, _Type}) ->
+ (catch snmp_log:sync(Log)),
+ (catch snmp_log:close(Log)),
+ ok;
+do_close_log(_) ->
+ ok.
+
+%% Log
+logger(undefined, _Type, _Domain, _Addr) ->
+ fun(_) ->
+ ok
+ end;
+logger({_Name, Log, Types}, Type, Domain, Addr) ->
+ case lists:member(Type, Types) of
+ true ->
+ AddrString =
+ iolist_to_binary(snmp_conf:mk_addr_string({Domain, Addr})),
+ fun(Msg) ->
+ snmp_log:log(Log, Msg, AddrString)
+ end;
+ false ->
+ fun(_) ->
+ ok
+ end
+ end.
+
+
%%--------------------------------------------------------------------
%% Func: handle_call/3
%% Returns: {reply, Reply, State} |
@@ -346,11 +490,6 @@ handle_call({verbosity, Verbosity}, _From, State) ->
put(verbosity, Verbosity),
{reply, ok, State};
-%% handle_call({system_info_updated, What}, _From, State) ->
-%% ?vlog("received system_info_updated request with What = ~p", [What]),
-%% {NewState, Reply} = handle_system_info_updated(State, What),
-%% {reply, Reply, NewState};
-
handle_call(get_log_type, _From, State) ->
?vlog("received get-log-type request", []),
Reply = (catch handle_get_log_type(State)),
@@ -386,25 +525,24 @@ handle_call(Req, From, State) ->
%% {noreply, State, Timeout} |
%% {stop, Reason, State} (terminate/2 is called)
%%--------------------------------------------------------------------
-handle_cast({send_pdu, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo},
+handle_cast({send_pdu, Pdu, Vsn, MsgData, Domain, Addr, ExtraInfo},
State) ->
- ?vlog("received send_pdu message with"
- "~n Pdu: ~p"
- "~n Vsn: ~p"
- "~n MsgData: ~p"
- "~n Domain: ~p"
- "~n Addr: ~p"
- "~n Port: ~p", [Pdu, Vsn, MsgData, Domain, Addr, Port]),
- maybe_process_extra_info(ExtraInfo),
- maybe_handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port, State),
+ ?vlog("received send_pdu message with~n"
+ " Pdu: ~p~n"
+ " Vsn: ~p~n"
+ " MsgData: ~p~n"
+ " Domain: ~p~n"
+ " Addr: ~p", [Pdu, Vsn, MsgData, Domain, Addr]),
+ maybe_process_extra_info(ExtraInfo),
+ maybe_handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, State),
{noreply, State};
-handle_cast({inform_response, Ref, Addr, Port}, State) ->
- ?vlog("received inform_response message with"
- "~n Ref: ~p"
- "~n Addr: ~p"
- "~n Port: ~p", [Ref, Addr, Port]),
- handle_inform_response(Ref, Addr, Port, State),
+handle_cast({inform_response, Ref, Domain, Addr}, State) ->
+ ?vlog("received inform_response message with~n"
+ " Ref: ~p~n"
+ " Domain: ~p~n"
+ " Addr: ~p", [Ref, Domain, Addr]),
+ handle_inform_response(Ref, Domain, Addr, State),
{noreply, State};
handle_cast(filter_reset, State) ->
@@ -423,10 +561,21 @@ handle_cast(Msg, State) ->
%% {noreply, State, Timeout} |
%% {stop, Reason, State} (terminate/2 is called)
%%--------------------------------------------------------------------
-handle_info({udp, Sock, Ip, Port, Bytes}, #state{sock = Sock} = State) ->
- ?vlog("received ~w bytes from ~p:~p [~w]", [size(Bytes), Ip, Port, Sock]),
- maybe_handle_recv_msg(Ip, Port, Bytes, State),
- {noreply, State};
+handle_info(
+ {udp, Socket, IpAddr, IpPort, Bytes},
+ #state{transports = Transports} = State) ->
+ Size = byte_size(Bytes),
+ case lists:keyfind(Socket, #transport.socket, Transports) of
+ #transport{socket = Socket, domain = Domain} ->
+ ?vlog("received ~w bytes from ~p:~p [~w]",
+ [Size, IpAddr, IpPort, Socket]),
+ maybe_handle_recv_msg(Domain, {IpAddr, IpPort}, Bytes, State),
+ {noreply, State};
+ false ->
+ warning_msg("Received ~w bytes on unknown port: ~p from ~s",
+ [Size, Socket, format_address({IpAddr, IpPort})]),
+ {noreply, State}
+ end;
handle_info(inform_response_gc, State) ->
?vlog("received inform_response_gc message", []),
@@ -439,11 +588,42 @@ handle_info({disk_log, _Node, Log, Info}, State) ->
State2 = handle_disk_log(Log, Info, State),
{noreply, State2};
+handle_info({'DOWN', _, _, _, _} = Info, State) ->
+ handle_info_down(Info, State);
+
handle_info(Info, State) ->
+ handle_info_unknown(Info, State).
+
+
+handle_info_unknown(Info, State) ->
warning_msg("received unknown info: ~n~p", [Info]),
{noreply, State}.
+-ifdef(snmpm_net_if_mt).
+handle_info_down(
+ {'DOWN', _MRef, process, _Pid,
+ {net_if_worker, _Result}},
+ State) ->
+ ?vdebug("received DOWN message from net_if worker [~w]: "
+ "~n Result: ~p", [_Pid, _Result]),
+ {noreply, State};
+handle_info_down(
+ {'DOWN', _MRef, process, Pid,
+ {net_if_worker, Failer, Class, Reason, Stacktrace} = _ExitStatus},
+ State) ->
+ ?vdebug("received DOWN message from net_if worker [~w]: "
+ "~n ExitStatus: ~p", [Pid, _ExitStatus]),
+ Failer(Pid, Class, Reason, Stacktrace),
+ {noreply, State};
+handle_info_down(Info, State) ->
+ handle_info_unknown(Info, State).
+-else.
+handle_info_down(Info, State) ->
+ handle_info_unknown(Info, State).
+-endif.
+
+
%%--------------------------------------------------------------------
%% Func: terminate/2
%% Purpose: Shutdown the server
@@ -457,68 +637,12 @@ terminate(Reason, #state{log = Log, irgc = IrGcRef}) ->
ok.
-do_close_log({Log, _Type}) ->
- (catch snmp_log:sync(Log)),
- (catch snmp_log:close(Log)),
- ok;
-do_close_log(_) ->
- ok.
-
-
%%----------------------------------------------------------------------
%% Func: code_change/3
%% Purpose: Convert process state when code is changed
%% Returns: {ok, NewState}
%%----------------------------------------------------------------------
-code_change({down, _Vsn}, OldState, downgrade_to_pre_4_14) ->
- ?d("code_change(down, downgrade_to_pre_4_14) -> entry with"
- "~n OldState: ~p", [OldState]),
- #state{server = Server,
- note_store = NoteStore,
- sock = Sock,
- mpd_state = MpdState,
- log = {OldLog, Type},
- irb = IRB,
- irgc = IRGC} = OldState,
- NewLog = snmp_log:downgrade(OldLog),
- State =
- {state, Server, NoteStore, Sock, MpdState, {NewLog, Type}, IRB, IRGC},
- {ok, State};
-
-code_change({down, _Vsn}, OldState, downgrade_to_pre_4_16) ->
- ?d("code_change(down, downgrade_to_pre_4_16) -> entry with"
- "~n OldState: ~p", [OldState]),
- {OldLog, Type} = OldState#state.log,
- NewLog = snmp_log:downgrade(OldLog),
- State = OldState#state{log = {NewLog, Type}},
- {ok, State};
-
-% upgrade
-code_change(_Vsn, OldState, upgrade_from_pre_4_14) ->
- ?d("code_change(up, upgrade_from_pre_4_14) -> entry with"
- "~n OldState: ~p", [OldState]),
- {state, Server, NoteStore, Sock, MpdState, {OldLog, Type}, IRB, IRGC} =
- OldState,
- NewLog = snmp_log:upgrade(OldLog),
- State = #state{server = Server,
- note_store = NoteStore,
- sock = Sock,
- mpd_state = MpdState,
- log = {NewLog, Type},
- irb = IRB,
- irgc = IRGC,
- filter = ?DEFAULT_FILTER_MODULE},
- {ok, State};
-
-code_change(_Vsn, OldState, upgrade_from_pre_4_16) ->
- ?d("code_change(up, upgrade_from_pre_4_16) -> entry with"
- "~n OldState: ~p", [OldState]),
- {OldLog, Type} = OldState#state.log,
- NewLog = snmp_log:upgrade(OldLog),
- State = OldState#state{log = {NewLog, Type}},
- {ok, State};
-
code_change(_Vsn, State, _Extra) ->
?d("code_change -> entry with"
"~n Vsn: ~p"
@@ -531,139 +655,155 @@ code_change(_Vsn, State, _Extra) ->
%%% Internal functions
%%%-------------------------------------------------------------------
-maybe_handle_recv_msg(Addr, Port, Bytes, #state{filter = FilterMod} = State) ->
- case (catch FilterMod:accept_recv(Addr, Port)) of
+maybe_handle_recv_msg(Domain, Addr, Bytes, State) ->
+ ?worker(
+ S, maybe_handle_recv_msg_mt(Domain, Addr, Bytes, S),
+ fun (Pid, Class, Reason, Stacktrace) ->
+ warning_msg(
+ "Worker process (~p) terminated "
+ "while processing (incomming) message from %s:~n"
+ "~w:~w at ~p",
+ [Pid, snmp_conf:mk_addr_string({Domain, Addr}),
+ Class, Reason, Stacktrace])
+ end,
+ State).
+
+maybe_handle_recv_msg_mt(
+ Domain, Addr, Bytes,
+ #state{filter = FilterMod, transports = Transports} = State) ->
+ {Arg1, Arg2} = fix_filter_address(Transports, {Domain, Addr}),
+ case (catch FilterMod:accept_recv(Arg1, Arg2)) of
false ->
%% Drop the received packet
- inc(netIfMsgInDrops),
- ok;
+ inc(netIfMsgInDrops);
_ ->
- handle_recv_msg(Addr, Port, Bytes, State)
- end.
+ handle_recv_msg(Domain, Addr, Bytes, State)
+ end,
+ ok.
-handle_recv_msg(Addr, Port, Bytes, #state{server = Pid})
+handle_recv_msg(Domain, Addr, Bytes, #state{server = Pid})
when is_binary(Bytes) andalso (size(Bytes) =:= 0) ->
- Pid ! {snmp_error, {empty_message, Addr, Port}, Addr, Port},
- ok;
-
-handle_recv_msg(Addr, Port, Bytes,
- #state{server = Pid,
- note_store = NoteStore,
- mpd_state = MpdState,
- sock = Sock,
- log = Log} = State) ->
- Domain = snmp_conf:which_domain(Addr), % What the ****...
- Logger = logger(Log, read, Addr, Port),
- case (catch snmpm_mpd:process_msg(Bytes, Domain, Addr, Port,
- MpdState, NoteStore, Logger)) of
+ Pid ! {snmp_error, {empty_message, Domain, Addr}, Domain, Addr};
+%%
+handle_recv_msg(
+ Domain, Addr, Bytes,
+ #state{
+ server = Pid,
+ note_store = NoteStore,
+ mpd_state = MpdState,
+ log = Log} = State) ->
+ Logger = logger(Log, read, Domain, Addr),
+ case (catch snmpm_mpd:process_msg(
+ Bytes, Domain, Addr, MpdState, NoteStore, Logger)) of
{ok, Vsn, Pdu, MS, ACM} ->
- maybe_handle_recv_pdu(Addr, Port, Vsn, Pdu, MS, ACM,
- Logger, State);
+ maybe_handle_recv_pdu(
+ Domain, Addr, Vsn, Pdu, MS, ACM, Logger, State);
{discarded, Reason, Report} ->
?vdebug("discarded: ~p", [Reason]),
ErrorInfo = {failed_processing_message, Reason},
- Pid ! {snmp_error, ErrorInfo, Addr, Port},
- maybe_udp_send(State#state.filter, Sock, Addr, Port, Report),
- ok;
+ Pid ! {snmp_error, ErrorInfo, Domain, Addr},
+ maybe_udp_send(Domain, Addr, Report, State);
{discarded, Reason} ->
?vdebug("discarded: ~p", [Reason]),
ErrorInfo = {failed_processing_message, Reason},
- Pid ! {snmp_error, ErrorInfo, Addr, Port},
- ok;
+ Pid ! {snmp_error, ErrorInfo, Domain, Addr};
Error ->
error_msg("processing of received message failed: "
- "~n ~p", [Error]),
- ok
+ "~n ~p", [Error])
end.
-maybe_handle_recv_pdu(Addr, Port,
- Vsn, #pdu{type = Type} = Pdu, PduMS, ACM,
- Logger,
- #state{filter = FilterMod} = State) ->
- case (catch FilterMod:accept_recv_pdu(Addr, Port, Type)) of
+maybe_handle_recv_pdu(
+ Domain, Addr, Vsn, #pdu{type = Type} = Pdu, PduMS, ACM, Logger,
+ #state{filter = FilterMod, transports = Transports} = State) ->
+ {Arg1, Arg2} = fix_filter_address(Transports, {Domain, Addr}),
+ case (catch FilterMod:accept_recv_pdu(Arg1, Arg2, Type)) of
false ->
- inc(netIfPduInDrops),
- ok;
+ inc(netIfPduInDrops);
_ ->
- handle_recv_pdu(Addr, Port, Vsn, Pdu, PduMS, ACM, Logger, State)
+ handle_recv_pdu(
+ Domain, Addr, Vsn, Pdu, PduMS, ACM, Logger, State)
end;
-maybe_handle_recv_pdu(Addr, Port, Vsn, Trap, PduMS, ACM, Logger,
- #state{filter = FilterMod} = State)
+maybe_handle_recv_pdu(
+ Domain, Addr, Vsn, Trap, PduMS, ACM, Logger,
+ #state{filter = FilterMod, transports = Transports} = State)
when is_record(Trap, trappdu) ->
- case (catch FilterMod:accept_recv_pdu(Addr, Port, trappdu)) of
+ {Arg1, Arg2} = fix_filter_address(Transports, {Domain, Addr}),
+ case (catch FilterMod:accept_recv_pdu(Arg1, Arg2, trappdu)) of
false ->
- inc(netIfPduInDrops),
- ok;
+ inc(netIfPduInDrops);
_ ->
- handle_recv_pdu(Addr, Port, Vsn, Trap, PduMS, ACM, Logger, State)
+ handle_recv_pdu(
+ Domain, Addr, Vsn, Trap, PduMS, ACM, Logger, State)
end;
-maybe_handle_recv_pdu(Addr, Port, Vsn, Pdu, PduMS, ACM, Logger, State) ->
- handle_recv_pdu(Addr, Port, Vsn, Pdu, PduMS, ACM, Logger, State).
-
-
-handle_recv_pdu(Addr, Port,
- Vsn, #pdu{type = 'inform-request'} = Pdu, _PduMS, ACM,
- Logger, #state{server = Pid, irb = IRB} = State) ->
- handle_inform_request(IRB, Pid, Vsn, Pdu, ACM,
- Addr, Port, Logger, State);
-handle_recv_pdu(Addr, Port,
- _Vsn, #pdu{type = report} = Pdu, _PduMS, ok,
- _Logger,
- #state{server = Pid} = _State) ->
+maybe_handle_recv_pdu(
+ Domain, Addr, Vsn, Pdu, PduMS, ACM, Logger, State) ->
+ handle_recv_pdu(Domain, Addr, Vsn, Pdu, PduMS, ACM, Logger, State).
+
+
+handle_recv_pdu(
+ Domain, Addr, Vsn,
+ #pdu{type = 'inform-request'} = Pdu, _PduMS, ACM, Logger,
+ #state{server = Pid, irb = IRB} = State) ->
+ handle_inform_request(
+ IRB, Pid, Vsn, Pdu, ACM, Domain, Addr, Logger, State);
+handle_recv_pdu(
+ Domain, Addr, _Vsn,
+ #pdu{type = report} = Pdu, _PduMS, ok, _Logger,
+ #state{server = Pid} = _State) ->
?vtrace("received report - ok", []),
- Pid ! {snmp_report, {ok, Pdu}, Addr, Port};
-handle_recv_pdu(Addr, Port,
- _Vsn, #pdu{type = report} = Pdu, _PduMS,
- {error, ReqId, Reason},
- _Logger,
- #state{server = Pid} = _State) ->
+ Pid ! {snmp_report, {ok, Pdu}, Domain, Addr};
+handle_recv_pdu(
+ Domain, Addr, _Vsn,
+ #pdu{type = report} = Pdu, _PduMS, {error, ReqId, Reason}, _Logger,
+ #state{server = Pid} = _State) ->
?vtrace("received report - error", []),
- Pid ! {snmp_report, {error, ReqId, Reason, Pdu}, Addr, Port};
-handle_recv_pdu(Addr, Port,
- _Vsn, #pdu{type = 'snmpv2-trap'} = Pdu, _PduMS, _ACM,
- _Logger,
- #state{server = Pid} = _State) ->
+ Pid ! {snmp_report, {error, ReqId, Reason, Pdu}, Domain, Addr};
+handle_recv_pdu(
+ Domain, Addr, _Vsn,
+ #pdu{type = 'snmpv2-trap'} = Pdu, _PduMS, _ACM, _Logger,
+ #state{server = Pid} = _State) ->
?vtrace("received snmpv2-trap", []),
- Pid ! {snmp_trap, Pdu, Addr, Port};
-handle_recv_pdu(Addr, Port,
- _Vsn, Trap, _PduMS, _ACM,
- _Logger,
- #state{server = Pid} = _State) when is_record(Trap, trappdu) ->
+ Pid ! {snmp_trap, Pdu, Domain, Addr};
+handle_recv_pdu(
+ Domain, Addr, _Vsn, Trap, _PduMS, _ACM, _Logger,
+ #state{server = Pid} = _State) when is_record(Trap, trappdu) ->
?vtrace("received trappdu", []),
- Pid ! {snmp_trap, Trap, Addr, Port};
-handle_recv_pdu(Addr, Port,
- _Vsn, Pdu, _PduMS, _ACM,
- _Logger,
- #state{server = Pid} = _State) when is_record(Pdu, pdu) ->
+ Pid ! {snmp_trap, Trap, Domain, Addr};
+handle_recv_pdu(
+ Domain, Addr, _Vsn, Pdu, _PduMS, _ACM, _Logger,
+ #state{server = Pid} = _State) when is_record(Pdu, pdu) ->
?vtrace("received pdu", []),
- Pid ! {snmp_pdu, Pdu, Addr, Port};
-handle_recv_pdu(_Addr, _Port, _Vsn, Pdu, _PduMS, ACM, _Logger, _State) ->
+ Pid ! {snmp_pdu, Pdu, Domain, Addr};
+handle_recv_pdu(
+ _Domain, _Addr, _Vsn, Pdu, _PduMS, ACM, _Logger, _State) ->
?vlog("received unexpected pdu: "
- "~n Pdu: ~p"
- "~n ACM: ~p", [Pdu, ACM]).
+ "~n Pdu: ~p"
+ "~n ACM: ~p", [Pdu, ACM]).
-handle_inform_request(auto, Pid, Vsn, Pdu, ACM, Addr, Port, Logger, State) ->
+handle_inform_request(
+ auto, Pid, Vsn, Pdu, ACM, Domain, Addr, Logger, State) ->
?vtrace("received inform-request (true)", []),
- Pid ! {snmp_inform, ignore, Pdu, Addr, Port},
+ Pid ! {snmp_inform, ignore, Pdu, Domain, Addr},
RePdu = make_response_pdu(Pdu),
- maybe_send_inform_response(RePdu, Vsn, ACM, Addr, Port, Logger, State);
-handle_inform_request({user, To}, Pid, Vsn, #pdu{request_id = ReqId} = Pdu,
- ACM, Addr, Port, _Logger, _State) ->
+ maybe_send_inform_response(RePdu, Vsn, ACM, Domain, Addr, Logger, State);
+handle_inform_request(
+ {user, To}, Pid, Vsn, #pdu{request_id = ReqId} = Pdu,
+ ACM, Domain, Addr, _Logger, _State) ->
?vtrace("received inform-request (false)", []),
- Pid ! {snmp_inform, ReqId, Pdu, Addr, Port},
+ Pid ! {snmp_inform, ReqId, Pdu, Domain, Addr},
%% Before we go any further, we need to check that we have not
%% already received this message (possible resend).
- Key = {ReqId, Addr, Port},
+ Key = {ReqId, Domain, Addr},
case ets:lookup(snmpm_inform_request_table, Key) of
[_] ->
%% OK, we already know about this. We assume this
@@ -672,50 +812,67 @@ handle_inform_request({user, To}, Pid, Vsn, #pdu{request_id = ReqId} = Pdu,
ok;
[] ->
RePdu = make_response_pdu(Pdu),
- Expire = t() + To,
+ Expire = snmp_misc:now(ms) + To,
Rec = {Key, Expire, {Vsn, ACM, RePdu}},
ets:insert(snmpm_inform_request_table, Rec)
end.
-
-handle_inform_response(Ref, Addr, Port, State) ->
- Key = {Ref, Addr, Port},
+
+handle_inform_response(Ref, Domain, Addr, State) ->
+ ?worker(
+ S, handle_inform_response_mt(Ref, Domain, Addr, S),
+ fun (Pid, Class, Reason, Stacktrace) ->
+ warning_msg(
+ "Worker process (~p) terminated "
+ "while processing (outgoing) inform response for %s:~n"
+ "~w:~w at ~p",
+ [Pid, snmp_conf:mk_addr_string({Domain, Addr}),
+ Class, Reason, Stacktrace])
+ end,
+ State).
+
+handle_inform_response_mt(Ref, Domain, Addr, State) ->
+ Key = {Ref, Domain, Addr},
case ets:lookup(snmpm_inform_request_table, Key) of
[{Key, _, {Vsn, ACM, RePdu}}] ->
- Logger = logger(State#state.log, read, Addr, Port),
+ Logger = logger(State#state.log, read, Domain, Addr),
ets:delete(snmpm_inform_request_table, Key),
- maybe_send_inform_response(RePdu, Vsn, ACM, Addr, Port,
- Logger, State);
+ maybe_send_inform_response(
+ RePdu, Vsn, ACM, Domain, Addr, Logger, State);
[] ->
%% Already acknowledged, or the user was to slow to reply...
ok
end,
ok.
-maybe_send_inform_response(RePdu, Vsn, ACM, Addr, Port, Logger,
- #state{server = Pid,
- sock = Sock,
- filter = FilterMod}) ->
- case (catch FilterMod:accept_send_pdu(Addr, Port, pdu_type_of(RePdu))) of
+maybe_send_inform_response(
+ RePdu, Vsn, ACM, Domain, Addr, Logger,
+ #state{
+ server = Pid,
+ filter = FilterMod,
+ transports = Transports} = State) ->
+ {Arg1, Arg2} = fix_filter_address(Transports, {Domain, Addr}),
+ case (catch FilterMod:accept_send_pdu(
+ Arg1, Arg2, pdu_type_of(RePdu)))
+ of
false ->
inc(netIfPduOutDrops),
ok;
_ ->
case snmpm_mpd:generate_response_msg(Vsn, RePdu, ACM, Logger) of
{ok, Msg} ->
- maybe_udp_send(FilterMod, Sock, Addr, Port, Msg);
+ maybe_udp_send(Domain, Addr, Msg, State);
{discarded, Reason} ->
?vlog("failed generating response message:"
"~n Reason: ~p", [Reason]),
ReqId = RePdu#pdu.request_id,
ErrorInfo = {failed_generating_response, {RePdu, Reason}},
- Pid ! {snmp_error, ReqId, ErrorInfo, Addr, Port},
- ok
+ Pid ! {snmp_error, ReqId, ErrorInfo, Domain, Addr}
end
end.
handle_inform_response_gc(#state{irb = IRB} = State) ->
ets:safe_fixtable(snmpm_inform_request_table, true),
- do_irgc(ets:first(snmpm_inform_request_table), t()),
+ do_irgc(ets:first(snmpm_inform_request_table), snmp_misc:now(ms)),
ets:safe_fixtable(snmpm_inform_request_table, false),
State#state{irgc = irgc_start(IRB)}.
@@ -742,64 +899,99 @@ irgc_stop(undefined) ->
irgc_stop(Ref) ->
(catch erlang:cancel_timer(Ref)).
-
-maybe_handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port,
- #state{filter = FilterMod} = State) ->
- case (catch FilterMod:accept_send_pdu(Addr, Port, pdu_type_of(Pdu))) of
+maybe_handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, State) ->
+ ?worker(
+ S, maybe_handle_send_pdu_mt(Pdu, Vsn, MsgData, Domain, Addr, S),
+ fun (Pid, Class, Reason, Stacktrace) ->
+ warning_msg(
+ "Worker process (~p) terminated "
+ "while processing (outgoing) pdu for %s:~n"
+ "~w:~w at ~p",
+ [Pid, snmp_conf:mk_addr_string({Domain, Addr}),
+ Class, Reason, Stacktrace])
+ end,
+ State).
+
+maybe_handle_send_pdu_mt(
+ Pdu, Vsn, MsgData, Domain, Addr,
+ #state{filter = FilterMod, transports = Transports} = State) ->
+ {Arg1, Arg2} = fix_filter_address(Transports, {Domain, Addr}),
+ case (catch FilterMod:accept_send_pdu(Arg1, Arg2, pdu_type_of(Pdu))) of
false ->
- inc(netIfPduOutDrops),
- ok;
+ inc(netIfPduOutDrops);
_ ->
- handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port, State)
- end.
+ handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, State)
+ end,
+ ok.
-handle_send_pdu(Pdu, Vsn, MsgData, _Domain, Addr, Port,
- #state{server = Pid,
- note_store = NoteStore,
- sock = Sock,
- log = Log,
- filter = FilterMod}) ->
- Logger = logger(Log, write, Addr, Port),
- case (catch snmpm_mpd:generate_msg(Vsn, NoteStore,
- Pdu, MsgData, Logger)) of
+handle_send_pdu(
+ Pdu, Vsn, MsgData, Domain, Addr,
+ #state{
+ server = Pid,
+ note_store = NoteStore,
+ log = Log} = State) ->
+ Logger = logger(Log, write, Domain, Addr),
+ case (catch snmpm_mpd:generate_msg(
+ Vsn, NoteStore, Pdu, MsgData, Logger)) of
{ok, Msg} ->
?vtrace("handle_send_pdu -> message generated", []),
- maybe_udp_send(FilterMod, Sock, Addr, Port, Msg);
+ maybe_udp_send(Domain, Addr, Msg, State);
{discarded, Reason} ->
?vlog("PDU not sent: "
"~n PDU: ~p"
"~n Reason: ~p", [Pdu, Reason]),
- Pid ! {snmp_error, Pdu, Reason},
- ok
+ Pid ! {snmp_error, Pdu, Reason}
end.
-maybe_udp_send(FilterMod, Sock, Addr, Port, Msg) ->
- case (catch FilterMod:accept_send(Addr, Port)) of
+maybe_udp_send(
+ Domain, Addr, Msg,
+ #state{filter = FilterMod, transports = Transports}) ->
+ To = {Domain, Addr},
+ {Arg1, Arg2} = fix_filter_address(Transports, To),
+ case (catch FilterMod:accept_send(Arg1, Arg2)) of
false ->
inc(netIfMsgOutDrops),
ok;
_ ->
- udp_send(Sock, Addr, Port, Msg)
+ case select_transport_from_domain(Domain, Transports) of
+ false ->
+ error_msg(
+ "Can not find transport~n"
+ " size: ~p~n"
+ " to: ~s",
+ [sz(Msg), format_address(To)]);
+ #transport{socket = Socket} ->
+ udp_send(Socket, Addr, Msg)
+ end
end.
-
-
-udp_send(Sock, Addr, Port, Msg) ->
- case (catch gen_udp:send(Sock, Addr, Port, Msg)) of
+
+udp_send(Sock, To, Msg) ->
+ {IpAddr, IpPort} =
+ case To of
+ {Domain, Addr} when is_atom(Domain) ->
+ Addr;
+ {_, P} = Addr when is_integer(P) ->
+ Addr
+ end,
+ try gen_udp:send(Sock, IpAddr, IpPort, Msg) of
ok ->
?vdebug("sent ~w bytes to ~w:~w [~w]",
- [sz(Msg), Addr, Port, Sock]),
+ [sz(Msg), IpAddr, IpPort, Sock]),
ok;
{error, Reason} ->
- error_msg("failed sending message to ~p:~p: "
- "~n ~p",[Addr, Port, Reason]);
- Error ->
- error_msg("failed sending message to ~p:~p: "
- "~n ~p",[Addr, Port, Error])
+ error_msg("failed sending message to ~p:~p:~n"
+ " ~p",[IpAddr, IpPort, Reason])
+ catch
+ error:Error ->
+ error_msg("failed sending message to ~p:~p:~n"
+ " error:~p~n"
+ " ~p",
+ [IpAddr, IpPort, Error, erlang:get_stacktrace()])
end.
sz(B) when is_binary(B) ->
- size(B);
+ byte_size(B);
sz(L) when is_list(L) ->
length(L);
sz(_) ->
@@ -827,110 +1019,6 @@ handle_disk_log(_Log, _Info, State) ->
State.
-%% mk_discovery_msg('version-3', Pdu, _VsnHdr, UserName) ->
-%% ScopedPDU = #scopedPdu{contextEngineID = "",
-%% contextName = "",
-%% data = Pdu},
-%% Bytes = snmp_pdus:enc_scoped_pdu(ScopedPDU),
-%% MsgID = get(msg_id),
-%% put(msg_id,MsgID+1),
-%% UsmSecParams =
-%% #usmSecurityParameters{msgAuthoritativeEngineID = "",
-%% msgAuthoritativeEngineBoots = 0,
-%% msgAuthoritativeEngineTime = 0,
-%% msgUserName = UserName,
-%% msgPrivacyParameters = "",
-%% msgAuthenticationParameters = ""},
-%% SecBytes = snmp_pdus:enc_usm_security_parameters(UsmSecParams),
-%% PduType = Pdu#pdu.type,
-%% Hdr = #v3_hdr{msgID = MsgID,
-%% msgMaxSize = 1000,
-%% msgFlags = snmp_misc:mk_msg_flags(PduType, 0),
-%% msgSecurityModel = ?SEC_USM,
-%% msgSecurityParameters = SecBytes},
-%% Msg = #message{version = 'version-3', vsn_hdr = Hdr, data = Bytes},
-%% case (catch snmp_pdus:enc_message_only(Msg)) of
-%% {'EXIT', Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% L when list(L) ->
-%% {Msg, L}
-%% end;
-%% mk_discovery_msg(Version, Pdu, {Com, _, _, _, _}, UserName) ->
-%% Msg = #message{version = Version, vsn_hdr = Com, data = Pdu},
-%% case catch snmp_pdus:enc_message(Msg) of
-%% {'EXIT', Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% L when list(L) ->
-%% {Msg, L}
-%% end.
-
-
-%% mk_msg('version-3', Pdu, {Context, User, EngineID, CtxEngineId, SecLevel},
-%% MsgData) ->
-%% %% Code copied from snmp_mpd.erl
-%% {MsgId, SecName, SecData} =
-%% if
-%% tuple(MsgData), Pdu#pdu.type == 'get-response' ->
-%% MsgData;
-%% true ->
-%% Md = get(msg_id),
-%% put(msg_id, Md + 1),
-%% {Md, User, []}
-%% end,
-%% ScopedPDU = #scopedPdu{contextEngineID = CtxEngineId,
-%% contextName = Context,
-%% data = Pdu},
-%% ScopedPDUBytes = snmp_pdus:enc_scoped_pdu(ScopedPDU),
-
-%% PduType = Pdu#pdu.type,
-%% V3Hdr = #v3_hdr{msgID = MsgId,
-%% msgMaxSize = 1000,
-%% msgFlags = snmp_misc:mk_msg_flags(PduType, SecLevel),
-%% msgSecurityModel = ?SEC_USM},
-%% Message = #message{version = 'version-3', vsn_hdr = V3Hdr,
-%% data = ScopedPDUBytes},
-%% SecEngineID = case PduType of
-%% 'get-response' -> snmp_framework_mib:get_engine_id();
-%% _ -> EngineID
-%% end,
-%% case catch snmp_usm:generate_outgoing_msg(Message, SecEngineID,
-%% SecName, SecData, SecLevel) of
-%% {'EXIT', Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% {error, Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% Packet ->
-%% Packet
-%% end;
-%% mk_msg(Version, Pdu, {Com, _User, _EngineID, _Ctx, _SecLevel}, _SecData) ->
-%% Msg = #message{version = Version, vsn_hdr = Com, data = Pdu},
-%% case catch snmp_pdus:enc_message(Msg) of
-%% {'EXIT', Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% B when list(B) ->
-%% B
-%% end.
-
-
-%% handle_system_info_updated(#state{log = {Log, _OldType}} = State,
-%% audit_trail_log_type = _What) ->
-%% %% Just to make sure, check that ATL is actually enabled
-%% case snmpm_config:system_info(audit_trail_log) of
-%% {ok, true} ->
-%% {ok, Type} = snmpm_config:system_info(audit_trail_log_type),
-%% NewState = State#state{log = {Log, Type}},
-%% {NewState, ok};
-%% _ ->
-%% {State, {error, {adt_not_enabled}}}
-%% end;
-%% handle_system_info_updated(_State, _What) ->
-%% ok.
-
handle_get_log_type(#state{log = {_Log, Value}} = State) ->
%% Just to make sure, check that ATL is actually enabled
case snmpm_config:system_info(audit_trail_log) of
@@ -989,6 +1077,45 @@ handle_set_log_type(State, _NewType) ->
{State, {error, not_enabled}}.
+select_transport_from_domain(Domain, Transports) when is_atom(Domain) ->
+ Pos = #transport.domain,
+ case lists:keyfind(Domain, Pos, Transports) of
+ #transport{domain = Domain} = Transport ->
+ Transport;
+ false when Domain == snmpUDPDomain ->
+ lists:keyfind(transportDomainUdpIpv4, Pos, Transports);
+ false when Domain == transportDomainUdpIpv4 ->
+ lists:keyfind(snmpUDPDomain, Pos, Transports);
+ false ->
+ false
+ end.
+
+%% If the manager uses legacy snmpUDPDomain e.g has not set
+%% {domain, _}, then make sure snmpm_network_interface_filter
+%% gets legacy arguments to not break backwards compatibility.
+%%
+fix_filter_address(Transports, Address) ->
+ DefaultDomain = snmpm_config:default_transport_domain(),
+ case Transports of
+ [#transport{domain = DefaultDomain}, DefaultDomain] ->
+ case Address of
+ {Domain, Addr} when is_atom(Domain) ->
+ Addr;
+ {_, IpPort} = Addr when is_integer(IpPort) ->
+ Addr
+ end;
+ _ ->
+ Address
+ end.
+
+address(Domain, Addr) when is_atom(Domain) ->
+ {Domain, Addr};
+address(Ip, Port) when is_integer(Port) ->
+ {snmpm_config:default_transport_domain(), {Ip, Port}}.
+
+format_address(Address) ->
+ iolist_to_binary(snmp_conf:mk_addr_string(Address)).
+
%% -------------------------------------------------------------------
make_response_pdu(#pdu{request_id = ReqId, varbinds = Vbs}) ->
@@ -1022,32 +1149,6 @@ maybe_process_extra_info(_ExtraInfo) ->
%% -------------------------------------------------------------------
-t() ->
- {A,B,C} = erlang:now(),
- A*1000000000+B*1000+(C div 1000).
-
-
-%% -------------------------------------------------------------------
-
-logger(undefined, _Type, _Addr, _Port) ->
- fun(_) ->
- ok
- end;
-logger({Log, Types}, Type, Addr, Port) ->
- case lists:member(Type, Types) of
- true ->
- fun(Msg) ->
- snmp_log:log(Log, Msg, Addr, Port)
- end;
- false ->
- fun(_) ->
- ok
- end
- end.
-
-
-%% -------------------------------------------------------------------
-
%% info_msg(F, A) ->
%% ?snmpm_info("NET-IF server: " ++ F, A).
@@ -1072,10 +1173,11 @@ get_opt(Opts, Key, Def) ->
%% -------------------------------------------------------------------
-get_info(#state{sock = Id}) ->
+get_info(#state{transports = Transports}) ->
ProcSize = proc_mem(self()),
- PortInfo = get_port_info(Id),
- [{process_memory, ProcSize}, {port_info, PortInfo}].
+ [{process_memory, ProcSize}
+ | [{port_info, get_port_info(Socket)}
+ || #transport{socket = Socket} <- Transports]].
proc_mem(P) when is_pid(P) ->
case (catch erlang:process_info(P, memory)) of
@@ -1084,8 +1186,6 @@ proc_mem(P) when is_pid(P) ->
_ ->
undefined
end.
-%% proc_mem(_) ->
-%% undefined.
get_port_info(Id) ->
@@ -1165,20 +1265,6 @@ counters() ->
inc(Name) -> inc(Name, 1).
inc(Name, N) -> snmpm_config:incr_stats_counter(Name, N).
-%% get_counters() ->
-%% Counters = counters(),
-%% get_counters(Counters, []).
-
-%% get_counters([], Acc) ->
-%% lists:reverse(Acc);
-%% get_counters([Counter|Counters], Acc) ->
-%% case snmpm_config:get_stats_counter(Counter) of
-%% {ok, CounterVal} ->
-%% get_counters(Counters, [{Counter, CounterVal}|Acc]);
-%% _ ->
-%% get_counters(Counters, Acc)
-%% end.
-
%% ----------------------------------------------------------------
@@ -1190,4 +1276,3 @@ call(Pid, Req, Timeout) ->
cast(Pid, Msg) ->
gen_server:cast(Pid, Msg).
-
diff --git a/lib/snmp/src/manager/snmpm_net_if_filter.erl b/lib/snmp/src/manager/snmpm_net_if_filter.erl
index eb0c6efb11..e5aef0756b 100644
--- a/lib/snmp/src/manager/snmpm_net_if_filter.erl
+++ b/lib/snmp/src/manager/snmpm_net_if_filter.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -25,29 +26,51 @@
-include("snmp_debug.hrl").
-accept_recv(_Addr, _Port) ->
- ?d("accept_recv -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p", [_Addr, _Port]),
+accept_recv(Domain, _Address) when is_atom(Domain) ->
+ ?d("accept_recv -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p", [Domain, _Address]),
+ true;
+accept_recv(_Addr, Port) when is_integer(Port) ->
+ ?d("accept_recv -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p", [_Addr, Port]),
true.
-accept_send(_Addr, _Port) ->
- ?d("accept_send -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p", [_Addr, _Port]),
+accept_send(Domain, _Address) when is_atom(Domain) ->
+ ?d("accept_send -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p", [Domain, _Address]),
+ true;
+accept_send(_Addr, Port) when is_integer(Port) ->
+ ?d("accept_send -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p", [_Addr, Port]),
true.
-accept_recv_pdu(_Addr, _Port, _PduType) ->
- ?d("accept_recv_pdu -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n PduType: ~p", [_Addr, _Port, _PduType]),
+accept_recv_pdu(Domain, _Address, _PduType) when is_atom(Domain) ->
+ ?d("accept_recv_pdu -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p~n"
+ " PduType: ~p", [Domain, _Address, _PduType]),
+ true;
+accept_recv_pdu(_Addr, Port, _PduType) when is_integer(Port) ->
+ ?d("accept_recv_pdu -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p~n"
+ " PduType: ~p", [_Addr, Port, _PduType]),
true.
-accept_send_pdu(_Addr, _Port, _PduType) ->
- ?d("accept_send_pdu -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n PduType: ~p", [_Addr, _Port, _PduType]),
+accept_send_pdu(Domain, _Address, _PduType) when is_atom(Domain) ->
+ ?d("accept_send_pdu -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p~n"
+ " PduType: ~p", [Domain, _Address, _PduType]),
+ true;
+accept_send_pdu(_Addr, Port, _PduType) when is_integer(Port) ->
+ ?d("accept_send_pdu -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p~n"
+ " PduType: ~p", [_Addr, Port, _PduType]),
true.
diff --git a/lib/snmp/src/manager/snmpm_net_if_mt.erl b/lib/snmp/src/manager/snmpm_net_if_mt.erl
index 3e87f6a7fb..238e212e14 100644
--- a/lib/snmp/src/manager/snmpm_net_if_mt.erl
+++ b/lib/snmp/src/manager/snmpm_net_if_mt.erl
@@ -1,1259 +1,24 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
--module(snmpm_net_if_mt).
-
--behaviour(gen_server).
--behaviour(snmpm_network_interface).
-
-
-%% Network Interface callback functions
--export([
- start_link/2,
- stop/1,
- send_pdu/6, % Backward compatibillity
- send_pdu/7, % Backward compatibillity
- send_pdu/8,
-
- inform_response/4,
-
- note_store/2,
-
- info/1,
- verbosity/2,
- %% system_info_updated/2,
- get_log_type/1, set_log_type/2,
- filter_reset/1
- ]).
-
-%% gen_server callbacks
--export([init/1, handle_call/3, handle_cast/2, handle_info/2,
- code_change/3, terminate/2]).
-
--define(SNMP_USE_V3, true).
--include("snmp_types.hrl").
--include("snmpm_internal.hrl").
--include("snmpm_atl.hrl").
--include("snmp_debug.hrl").
-
-%% -define(VMODULE,"NET_IF").
--include("snmp_verbosity.hrl").
-
--record(state,
- {
- server,
- note_store,
- sock,
- mpd_state,
- log,
- irb = auto, % auto | {user, integer()}
- irgc,
- filter
- }).
-
-
--define(DEFAULT_FILTER_MODULE, snmpm_net_if_filter).
--define(DEFAULT_FILTER_OPTS, [{module, ?DEFAULT_FILTER_MODULE}]).
-
--ifdef(snmp_debug).
--define(GS_START_LINK(Args),
- gen_server:start_link(?MODULE, Args, [{debug,[trace]}])).
--else.
--define(GS_START_LINK(Args),
- gen_server:start_link(?MODULE, Args, [])).
--endif.
-
-
--define(IRGC_TIMEOUT, timer:minutes(5)).
-
--define(ATL_SEQNO_INITIAL, 1).
--define(ATL_SEQNO_MAX, 2147483647).
-
-
-%%%-------------------------------------------------------------------
-%%% API
-%%%-------------------------------------------------------------------
-start_link(Server, NoteStore) ->
- ?d("start_link -> entry with"
- "~n Server: ~p"
- "~n NoteStore: ~p", [Server, NoteStore]),
- Args = [Server, NoteStore],
- ?GS_START_LINK(Args).
-
-stop(Pid) ->
- call(Pid, stop).
-
-send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port) ->
- send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port, ?DEFAULT_EXTRA_INFO).
-
-send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port, ExtraInfo) ->
- Domain = snmpm_config:default_transport_domain(),
- send_pdu(Pid, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo).
-
-send_pdu(Pid, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo)
- when is_record(Pdu, pdu) ->
- ?d("send_pdu -> entry with"
- "~n Pid: ~p"
- "~n Pdu: ~p"
- "~n Vsn: ~p"
- "~n MsgData: ~p"
- "~n Domain: ~p"
- "~n Addr: ~p"
- "~n Port: ~p", [Pid, Pdu, Vsn, MsgData, Domain, Addr, Port]),
- cast(Pid, {send_pdu, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo}).
-
-note_store(Pid, NoteStore) ->
- call(Pid, {note_store, NoteStore}).
-
-inform_response(Pid, Ref, Addr, Port) ->
- cast(Pid, {inform_response, Ref, Addr, Port}).
-
-info(Pid) ->
- call(Pid, info).
-
-verbosity(Pid, V) ->
- call(Pid, {verbosity, V}).
-
-%% system_info_updated(Pid, What) ->
-%% call(Pid, {system_info_updated, What}).
-
-get_log_type(Pid) ->
- call(Pid, get_log_type).
-
-set_log_type(Pid, NewType) ->
- call(Pid, {set_log_type, NewType}).
-
-filter_reset(Pid) ->
- cast(Pid, filter_reset).
-
-
-%%%-------------------------------------------------------------------
-%%% Callback functions from gen_server
-%%%-------------------------------------------------------------------
-
-%%--------------------------------------------------------------------
-%% Func: init/1
-%% Returns: {ok, State} |
-%% {ok, State, Timeout} |
-%% ignore |
-%% {stop, Reason}
-%%--------------------------------------------------------------------
-init([Server, NoteStore]) ->
- ?d("init -> entry with"
- "~n Server: ~p"
- "~n NoteStore: ~p", [Server, NoteStore]),
- case (catch do_init(Server, NoteStore)) of
- {error, Reason} ->
- {stop, Reason};
- {ok, State} ->
- {ok, State}
- end.
-
-do_init(Server, NoteStore) ->
- process_flag(trap_exit, true),
-
- %% -- Prio --
- {ok, Prio} = snmpm_config:system_info(prio),
- process_flag(priority, Prio),
-
- %% -- Create inform request table --
- %% This should really be protected, but it also needs to
- %% be writable for the worker processes, so...
- ets:new(snmpm_inform_request_table,
- [set, public, named_table, {keypos, 1}]),
-
- %% -- Verbosity --
- {ok, Verbosity} = snmpm_config:system_info(net_if_verbosity),
- put(sname, mnif),
- put(verbosity, Verbosity),
- ?vlog("starting", []),
-
- %% -- MPD --
- {ok, Vsns} = snmpm_config:system_info(versions),
- MpdState = snmpm_mpd:init(Vsns),
- ?vdebug("MpdState: ~w", [MpdState]),
-
- %% -- Module dependent options --
- {ok, Opts} = snmpm_config:system_info(net_if_options),
-
- %% -- Inform response behaviour --
- {ok, IRB} = snmpm_config:system_info(net_if_irb),
- IrGcRef = irgc_start(IRB),
-
- %% -- Socket --
- SndBuf = get_opt(Opts, sndbuf, default),
- RecBuf = get_opt(Opts, recbuf, default),
- BindTo = get_opt(Opts, bind_to, false),
- NoReuse = get_opt(Opts, no_reuse, false),
- {ok, Port} = snmpm_config:system_info(port),
- {ok, Sock} = do_open_port(Port, SndBuf, RecBuf, BindTo, NoReuse),
-
- %% Flow control --
- FilterOpts = get_opt(Opts, filter, []),
- FilterMod = create_filter(FilterOpts),
- ?vdebug("FilterMod: ~w", [FilterMod]),
-
- %% -- Audit trail log ---
- {ok, ATL} = snmpm_config:system_info(audit_trail_log),
- Log = do_init_log(ATL),
- ?vdebug("Log: ~w", [Log]),
-
- %% -- Initiate counters ---
- init_counters(),
-
- %% -- We are done ---
- State = #state{server = Server,
- note_store = NoteStore,
- mpd_state = MpdState,
- sock = Sock,
- log = Log,
- irb = IRB,
- irgc = IrGcRef,
- filter = FilterMod},
- ?vdebug("started", []),
- {ok, State}.
-
-
-%% Open port
-do_open_port(Port, SendSz, RecvSz, BindTo, NoReuse) ->
- ?vtrace("do_open_port -> entry with"
- "~n Port: ~p"
- "~n SendSz: ~p"
- "~n RecvSz: ~p"
- "~n BindTo: ~p"
- "~n NoReuse: ~p", [Port, SendSz, RecvSz, BindTo, NoReuse]),
- IpOpts1 = bind_to(BindTo),
- IpOpts2 = no_reuse(NoReuse),
- IpOpts3 = recbuf(RecvSz),
- IpOpts4 = sndbuf(SendSz),
- IpOpts = [binary | IpOpts1 ++ IpOpts2 ++ IpOpts3 ++ IpOpts4],
- OpenRes =
- case init:get_argument(snmpm_fd) of
- {ok, [[FdStr]]} ->
- Fd = list_to_integer(FdStr),
- gen_udp:open(0, [{fd, Fd}|IpOpts]);
- error ->
- gen_udp:open(Port, IpOpts)
- end,
- case OpenRes of
- {error, _} = Error ->
- throw(Error);
- OK ->
- OK
- end.
-
-bind_to(true) ->
- case snmpm_config:system_info(address) of
- {ok, Addr} when is_list(Addr) ->
- [{ip, list_to_tuple(Addr)}];
- {ok, Addr} ->
- [{ip, Addr}];
- _ ->
- []
- end;
-bind_to(_) ->
- [].
-
-no_reuse(false) ->
- [{reuseaddr, true}];
-no_reuse(_) ->
- [].
-
-recbuf(default) ->
- [];
-recbuf(Sz) ->
- [{recbuf, Sz}].
-
-sndbuf(default) ->
- [];
-sndbuf(Sz) ->
- [{sndbuf, Sz}].
-
-
-create_filter(Opts) when is_list(Opts) ->
- case get_opt(Opts, module, ?DEFAULT_FILTER_MODULE) of
- ?DEFAULT_FILTER_MODULE = Mod ->
- Mod;
- Module ->
- snmpm_network_interface_filter:verify(Module),
- Module
- end;
-create_filter(BadOpts) ->
- throw({error, {bad_filter_opts, BadOpts}}).
-
-
-%% ----------------------------------------------------------------------
-%% Audit Trail Logger
-%% ----------------------------------------------------------------------
-
-%% Open log
-do_init_log(false) ->
- ?vtrace("do_init_log(false) -> entry", []),
- undefined;
-do_init_log(true) ->
- ?vtrace("do_init_log(true) -> entry", []),
- {ok, Type} = snmpm_config:system_info(audit_trail_log_type),
- {ok, Dir} = snmpm_config:system_info(audit_trail_log_dir),
- {ok, Size} = snmpm_config:system_info(audit_trail_log_size),
- {ok, Repair} = snmpm_config:system_info(audit_trail_log_repair),
- Name = ?audit_trail_log_name,
- File = filename:absname(?audit_trail_log_file, Dir),
- case snmpm_config:system_info(audit_trail_log_seqno) of
- {ok, true} ->
- Initial = ?ATL_SEQNO_INITIAL,
- Max = ?ATL_SEQNO_MAX,
- Module = snmpm_config,
- Function = increment_counter,
- Args = [atl_seqno, Initial, Max],
- SeqNoGen = {Module, Function, Args},
- case snmp_log:create(Name, File, SeqNoGen, Size, Repair, true) of
- {ok, Log} ->
- ?vdebug("log created: ~w", [Log]),
- {Name, Log, Type};
- {error, Reason} ->
- throw({error, {failed_create_audit_log, Reason}})
- end;
- _ ->
- case snmp_log:create(Name, File, Size, Repair, true) of
- {ok, Log} ->
- ?vdebug("log created: ~w", [Log]),
- {Name, Log, Type};
- {error, Reason} ->
- throw({error, {failed_create_audit_log, Reason}})
- end
- end.
-
-
-%% ----------------------------------------------------------------------
-
-%%--------------------------------------------------------------------
-%% Func: handle_call/3
-%% Returns: {reply, Reply, State} |
-%% {reply, Reply, State, Timeout} |
-%% {noreply, State} |
-%% {noreply, State, Timeout} |
-%% {stop, Reason, Reply, State} | (terminate/2 is called)
-%% {stop, Reason, State} (terminate/2 is called)
-%%--------------------------------------------------------------------
-handle_call({verbosity, Verbosity}, _From, State) ->
- ?vlog("received verbosity request", []),
- put(verbosity, Verbosity),
- {reply, ok, State};
-
-%% handle_call({system_info_updated, What}, _From, State) ->
-%% ?vlog("received system_info_updated request with What = ~p", [What]),
-%% {NewState, Reply} = handle_system_info_updated(State, What),
-%% {reply, Reply, NewState};
-
-handle_call(get_log_type, _From, State) ->
- ?vlog("received get-log-type request", []),
- Reply = (catch handle_get_log_type(State)),
- {reply, Reply, State};
-
-handle_call({set_log_type, NewType}, _From, State) ->
- ?vlog("received set-log-type request with NewType = ~p", [NewType]),
- {NewState, Reply} = (catch handle_set_log_type(State, NewType)),
- {reply, Reply, NewState};
-
-handle_call({note_store, Pid}, _From, State) ->
- ?vlog("received new note_store: ~w", [Pid]),
- {reply, ok, State#state{note_store = Pid}};
-
-handle_call(stop, _From, State) ->
- ?vlog("received stop request", []),
- Reply = ok,
- {stop, normal, Reply, State};
-
-handle_call(info, _From, State) ->
- ?vlog("received info request", []),
- Reply = get_info(State),
- {reply, Reply, State};
-
-handle_call(Req, From, State) ->
- warning_msg("received unknown request (from ~p): ~n~p", [Req, From]),
- {reply, {error, {invalid_request, Req}}, State}.
-
-
-%%--------------------------------------------------------------------
-%% Func: handle_cast/2
-%% Returns: {noreply, State} |
-%% {noreply, State, Timeout} |
-%% {stop, Reason, State} (terminate/2 is called)
-%%--------------------------------------------------------------------
-handle_cast({send_pdu, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo},
- State) ->
- ?vlog("received send_pdu message with"
- "~n Pdu: ~p"
- "~n Vsn: ~p"
- "~n MsgData: ~p"
- "~n Domain: ~p"
- "~n Addr: ~p"
- "~n Port: ~p", [Pdu, Vsn, MsgData, Domain, Addr, Port]),
- maybe_process_extra_info(ExtraInfo),
- handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port, State),
- {noreply, State};
-
-handle_cast({inform_response, Ref, Addr, Port}, State) ->
- ?vlog("received inform_response message with"
- "~n Ref: ~p"
- "~n Addr: ~p"
- "~n Port: ~p", [Ref, Addr, Port]),
- handle_inform_response(Ref, Addr, Port, State),
- {noreply, State};
-
-handle_cast(filter_reset, State) ->
- ?vlog("received filter_reset message", []),
- reset_counters(),
- {noreply, State};
-
-handle_cast(Msg, State) ->
- warning_msg("received unknown message: ~n~p", [Msg]),
- {noreply, State}.
-
-
-%%--------------------------------------------------------------------
-%% Func: handle_info/2
-%% Returns: {noreply, State} |
-%% {noreply, State, Timeout} |
-%% {stop, Reason, State} (terminate/2 is called)
-%%--------------------------------------------------------------------
-handle_info({udp, Sock, Ip, Port, Bytes}, #state{sock = Sock} = State) ->
- ?vlog("received ~w bytes from ~p:~p", [size(Bytes), Ip, Port]),
- handle_udp(Ip, Port, Bytes, State),
- {noreply, State};
-
-handle_info(inform_response_gc, State) ->
- ?vlog("received inform_response_gc message", []),
- State2 = handle_inform_response_gc(State),
- {noreply, State2};
-
-handle_info({disk_log, _Node, Log, Info}, State) ->
- ?vlog("received disk_log message: "
- "~n Info: ~p", [Info]),
- State2 = handle_disk_log(Log, Info, State),
- {noreply, State2};
-
-handle_info({'DOWN', _MRef, process, Pid, {net_if_worker, ExitStatus}},
- State) ->
- ?vdebug("received DOWN message from net_if-worker: "
- "~n ExitStatus: ~p", [ExitStatus]),
- handle_worker_exit(Pid, ExitStatus),
- {noreply, State};
-
-handle_info(Info, State) ->
- warning_msg("received unknown info: ~n~p", [Info]),
- {noreply, State}.
-
-
-%%--------------------------------------------------------------------
-%% Func: terminate/2
-%% Purpose: Shutdown the server
-%% Returns: any (ignored by gen_server)
-%%--------------------------------------------------------------------
-terminate(Reason, #state{log = Log, irgc = IrGcRef}) ->
- ?vdebug("terminate: ~p", [Reason]),
- irgc_stop(IrGcRef),
- %% Close logs
- do_close_log(Log),
- ok.
-
-
-do_close_log({Log, _Type}) ->
- (catch snmp_log:sync(Log)),
- (catch snmp_log:close(Log)),
- ok;
-do_close_log(_) ->
- ok.
-
-
-%%----------------------------------------------------------------------
-%% Func: code_change/3
-%% Purpose: Convert process state when code is changed
-%% Returns: {ok, NewState}
-%%----------------------------------------------------------------------
-
-code_change(_Vsn, State, _Extra) ->
- ?d("code_change -> entry with"
- "~n Vsn: ~p"
- "~n State: ~p"
- "~n Extra: ~p", [_Vsn, State, _Extra]),
- {ok, State}.
-
-
-%%%-------------------------------------------------------------------
-%%% Internal functions
-%%%-------------------------------------------------------------------
-
-handle_udp(Addr, Port, Bytes, State) ->
- Verbosity = get(verbosity),
- spawn_opt(fun() ->
- Log = worker_init(State, Verbosity),
- Res = (catch maybe_handle_recv_msg(
- Addr, Port, Bytes,
- State#state{log = Log})),
- worker_exit(udp, {Addr, Port}, Res)
- end,
- [monitor]).
-
-
-maybe_handle_recv_msg(Addr, Port, Bytes, #state{filter = FilterMod} = State) ->
- case (catch FilterMod:accept_recv(Addr, Port)) of
- false ->
- %% Drop the received packet
- inc(netIfMsgInDrops),
- ok;
- _ ->
- handle_recv_msg(Addr, Port, Bytes, State)
- end.
-
-
-handle_recv_msg(Addr, Port, Bytes, #state{server = Pid})
- when is_binary(Bytes) andalso (size(Bytes) =:= 0) ->
- Pid ! {snmp_error, {empty_message, Addr, Port}, Addr, Port},
- ok;
-
-handle_recv_msg(Addr, Port, Bytes,
- #state{server = Pid,
- note_store = NoteStore,
- mpd_state = MpdState,
- sock = Sock,
- log = Log} = State) ->
- Domain = snmp_conf:which_domain(Addr), % What the ****...
- Logger = logger(Log, read, Addr, Port),
- case (catch snmpm_mpd:process_msg(Bytes, Domain, Addr, Port,
- MpdState, NoteStore, Logger)) of
-
- {ok, Vsn, Pdu, MS, ACM} ->
- maybe_handle_recv_pdu(Addr, Port, Vsn, Pdu, MS, ACM,
- Logger, State);
-
- {discarded, Reason, Report} ->
- ?vdebug("discarded: ~p", [Reason]),
- ErrorInfo = {failed_processing_message, Reason},
- Pid ! {snmp_error, ErrorInfo, Addr, Port},
- maybe_udp_send(State#state.filter, Sock, Addr, Port, Report),
- ok;
-
- {discarded, Reason} ->
- ?vdebug("discarded: ~p", [Reason]),
- ErrorInfo = {failed_processing_message, Reason},
- Pid ! {snmp_error, ErrorInfo, Addr, Port},
- ok;
-
- Error ->
- error_msg("processing of received message failed: "
- "~n ~p", [Error]),
- ok
- end.
-
-
-maybe_handle_recv_pdu(Addr, Port,
- Vsn, #pdu{type = Type} = Pdu, PduMS, ACM,
- Logger,
- #state{filter = FilterMod} = State) ->
- case (catch FilterMod:accept_recv_pdu(Addr, Port, Type)) of
- false ->
- inc(netIfPduInDrops),
- ok;
- _ ->
- handle_recv_pdu(Addr, Port, Vsn, Pdu, PduMS, ACM, Logger, State)
- end;
-maybe_handle_recv_pdu(Addr, Port, Vsn, Trap, PduMS, ACM, Logger,
- #state{filter = FilterMod} = State)
- when is_record(Trap, trappdu) ->
- case (catch FilterMod:accept_recv_pdu(Addr, Port, trappdu)) of
- false ->
- inc(netIfPduInDrops),
- ok;
- _ ->
- handle_recv_pdu(Addr, Port, Vsn, Trap, PduMS, ACM, Logger, State)
- end;
-maybe_handle_recv_pdu(Addr, Port, Vsn, Pdu, PduMS, ACM, Logger, State) ->
- handle_recv_pdu(Addr, Port, Vsn, Pdu, PduMS, ACM, Logger, State).
-
-
-handle_recv_pdu(Addr, Port,
- Vsn, #pdu{type = 'inform-request'} = Pdu, _PduMS, ACM,
- Logger, #state{server = Pid, irb = IRB} = State) ->
- handle_inform_request(IRB, Pid, Vsn, Pdu, ACM,
- Addr, Port, Logger, State);
-handle_recv_pdu(Addr, Port,
- _Vsn, #pdu{type = report} = Pdu, _PduMS, ok,
- _Logger,
- #state{server = Pid} = _State) ->
- ?vtrace("received report - ok", []),
- Pid ! {snmp_report, {ok, Pdu}, Addr, Port},
- ok;
-handle_recv_pdu(Addr, Port,
- _Vsn, #pdu{type = report} = Pdu, _PduMS,
- {error, ReqId, Reason},
- _Logger,
- #state{server = Pid} = _State) ->
- ?vtrace("received report - error", []),
- Pid ! {snmp_report, {error, ReqId, Reason, Pdu}, Addr, Port},
- ok;
-handle_recv_pdu(Addr, Port,
- _Vsn, #pdu{type = 'snmpv2-trap'} = Pdu, _PduMS, _ACM,
- _Logger,
- #state{server = Pid} = _State) ->
- ?vtrace("received snmpv2-trap", []),
- Pid ! {snmp_trap, Pdu, Addr, Port},
- ok;
-handle_recv_pdu(Addr, Port,
- _Vsn, Trap, _PduMS, _ACM,
- _Logger,
- #state{server = Pid} = _State) when is_record(Trap, trappdu) ->
- ?vtrace("received trappdu", []),
- Pid ! {snmp_trap, Trap, Addr, Port},
- ok;
-handle_recv_pdu(Addr, Port,
- _Vsn, Pdu, _PduMS, _ACM,
- _Logger,
- #state{server = Pid} = _State) when is_record(Pdu, pdu) ->
- ?vtrace("received pdu", []),
- Pid ! {snmp_pdu, Pdu, Addr, Port},
- ok;
-handle_recv_pdu(_Addr, _Port, _Vsn, Pdu, _PduMS, ACM, _Logger, _State) ->
- ?vlog("received unexpected pdu: "
- "~n Pdu: ~p"
- "~n ACM: ~p", [Pdu, ACM]),
- ok.
-
-
-handle_inform_request(auto, Pid, Vsn, Pdu, ACM, Addr, Port, Logger, State) ->
- ?vtrace("received inform-request (true)", []),
- Pid ! {snmp_inform, ignore, Pdu, Addr, Port},
- RePdu = make_response_pdu(Pdu),
- maybe_send_inform_response(RePdu, Vsn, ACM, Addr, Port, Logger, State);
-handle_inform_request({user, To}, Pid, Vsn, #pdu{request_id = ReqId} = Pdu,
- ACM, Addr, Port, _Logger, _State) ->
- ?vtrace("received inform-request (false)", []),
-
- Pid ! {snmp_inform, ReqId, Pdu, Addr, Port},
-
- %% Before we go any further, we need to check that we have not
- %% already received this message (possible resend).
-
- Key = {ReqId, Addr, Port},
- case ets:lookup(snmpm_inform_request_table, Key) of
- [_] ->
- %% OK, we already know about this. We assume this
- %% is a resend. Either the agent is really eager or
- %% the user has not answered yet. Bad user!
- ok;
- [] ->
- RePdu = make_response_pdu(Pdu),
- Expire = t() + To,
- Rec = {Key, Expire, {Vsn, ACM, RePdu}},
- ets:insert(snmpm_inform_request_table, Rec)
- end,
- ok.
-
-handle_inform_response(Ref, Addr, Port, State) ->
- Verbosity = get(verbosity),
- spawn_opt(fun() ->
- Log = worker_init(State, Verbosity),
- Res = (catch do_handle_inform_response(
- Ref,
- Addr, Port,
- State#state{log = Log})),
- worker_exit(inform_reponse, {Addr, Port}, Res)
- end,
- [monitor]).
-
-
-
-do_handle_inform_response(Ref, Addr, Port, State) ->
- Key = {Ref, Addr, Port},
- case ets:lookup(snmpm_inform_request_table, Key) of
- [{Key, _, {Vsn, ACM, RePdu}}] ->
- Logger = logger(State#state.log, read, Addr, Port),
- ets:delete(snmpm_inform_request_table, Key),
- maybe_send_inform_response(RePdu, Vsn, ACM, Addr, Port,
- Logger, State);
- [] ->
- %% Already acknowledged, or the user was to slow to reply...
- ok
- end,
- ok.
-
-maybe_send_inform_response(RePdu, Vsn, ACM, Addr, Port, Logger,
- #state{server = Pid,
- sock = Sock,
- filter = FilterMod}) ->
- case (catch FilterMod:accept_send_pdu(Addr, Port, pdu_type_of(RePdu))) of
- false ->
- inc(netIfPduOutDrops),
- ok;
- _ ->
- case snmpm_mpd:generate_response_msg(Vsn, RePdu, ACM, Logger) of
- {ok, Msg} ->
- maybe_udp_send(FilterMod, Sock, Addr, Port, Msg);
- {discarded, Reason} ->
- ?vlog("failed generating response message:"
- "~n Reason: ~p", [Reason]),
- ReqId = RePdu#pdu.request_id,
- ErrorInfo = {failed_generating_response, {RePdu, Reason}},
- Pid ! {snmp_error, ReqId, ErrorInfo, Addr, Port},
- ok
- end
- end.
-
-handle_inform_response_gc(#state{irb = IRB} = State) ->
- ets:safe_fixtable(snmpm_inform_request_table, true),
- do_irgc(ets:first(snmpm_inform_request_table), t()),
- ets:safe_fixtable(snmpm_inform_request_table, false),
- State#state{irgc = irgc_start(IRB)}.
-
-%% We are deleting at the same time as we are traversing the table!!!
-do_irgc('$end_of_table', _) ->
- ok;
-do_irgc(Key, Now) ->
- Next = ets:next(snmpm_inform_request_table, Key),
- case ets:lookup(snmpm_inform_request_table, Key) of
- [{Key, BestBefore, _}] when BestBefore < Now ->
- ets:delete(snmpm_inform_request_table, Key);
- _ ->
- ok
- end,
- do_irgc(Next, Now).
-
-irgc_start(auto) ->
- undefined;
-irgc_start(_) ->
- erlang:send_after(?IRGC_TIMEOUT, self(), inform_response_gc).
-
-irgc_stop(undefined) ->
- ok;
-irgc_stop(Ref) ->
- (catch erlang:cancel_timer(Ref)).
-
-
-handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port, State) ->
- Verbosity = get(verbosity),
- spawn_opt(fun() ->
- Log = worker_init(State, Verbosity),
- Res = (catch maybe_handle_send_pdu(
- Pdu, Vsn, MsgData,
- Domain, Addr, Port,
- State#state{log = Log})),
- worker_exit(send_pdu, {Domain, Addr, Port}, Res)
- end,
- [monitor]).
-
-maybe_handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port,
- #state{filter = FilterMod} = State) ->
- case (catch FilterMod:accept_send_pdu(Addr, Port, pdu_type_of(Pdu))) of
- false ->
- inc(netIfPduOutDrops),
- ok;
- _ ->
- do_handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port, State)
- end.
-
-do_handle_send_pdu(Pdu, Vsn, MsgData, _Domain, Addr, Port,
- #state{server = Pid,
- note_store = NoteStore,
- sock = Sock,
- log = Log,
- filter = FilterMod}) ->
- Logger = logger(Log, write, Addr, Port),
- case (catch snmpm_mpd:generate_msg(Vsn, NoteStore,
- Pdu, MsgData, Logger)) of
- {ok, Msg} ->
- ?vtrace("do_handle_send_pdu -> message generated", []),
- maybe_udp_send(FilterMod, Sock, Addr, Port, Msg);
- {discarded, Reason} ->
- ?vlog("PDU not sent: "
- "~n PDU: ~p"
- "~n Reason: ~p", [Pdu, Reason]),
- Pid ! {snmp_error, Pdu, Reason},
- ok
- end.
-
-
-maybe_udp_send(FilterMod, Sock, Addr, Port, Msg) ->
- case (catch FilterMod:accept_send(Addr, Port)) of
- false ->
- inc(netIfMsgOutDrops),
- ok;
- _ ->
- udp_send(Sock, Addr, Port, Msg)
- end.
-
-
-udp_send(Sock, Addr, Port, Msg) ->
- case (catch gen_udp:send(Sock, Addr, Port, Msg)) of
- ok ->
- ?vdebug("sent ~w bytes to ~w:~w [~w]",
- [sz(Msg), Addr, Port, Sock]),
- ok;
- {error, Reason} ->
- error_msg("failed sending message to ~p:~p: "
- "~n ~p",[Addr, Port, Reason]),
- ok;
- Error ->
- error_msg("failed sending message to ~p:~p: "
- "~n ~p",[Addr, Port, Error]),
- ok
- end.
-
-sz(B) when is_binary(B) ->
- size(B);
-sz(L) when is_list(L) ->
- length(L);
-sz(_) ->
- undefined.
-
-
-handle_disk_log(_Log, {wrap, NoLostItems}, State) ->
- ?vlog("Audit Trail Log - wrapped: ~w previously logged items where lost",
- [NoLostItems]),
- State;
-handle_disk_log(_Log, {truncated, NoLostItems}, State) ->
- ?vlog("Audit Trail Log - truncated: ~w items where lost when truncating",
- [NoLostItems]),
- State;
-handle_disk_log(_Log, full, State) ->
- error_msg("Failed to write to Audit Trail Log (full)", []),
- State;
-handle_disk_log(_Log, {error_status, ok}, State) ->
- State;
-handle_disk_log(_Log, {error_status, {error, Reason}}, State) ->
- error_msg("Error status received from Audit Trail Log: "
- "~n~p", [Reason]),
- State;
-handle_disk_log(_Log, _Info, State) ->
- State.
-
-
-%% mk_discovery_msg('version-3', Pdu, _VsnHdr, UserName) ->
-%% ScopedPDU = #scopedPdu{contextEngineID = "",
-%% contextName = "",
-%% data = Pdu},
-%% Bytes = snmp_pdus:enc_scoped_pdu(ScopedPDU),
-%% MsgID = get(msg_id),
-%% put(msg_id,MsgID+1),
-%% UsmSecParams =
-%% #usmSecurityParameters{msgAuthoritativeEngineID = "",
-%% msgAuthoritativeEngineBoots = 0,
-%% msgAuthoritativeEngineTime = 0,
-%% msgUserName = UserName,
-%% msgPrivacyParameters = "",
-%% msgAuthenticationParameters = ""},
-%% SecBytes = snmp_pdus:enc_usm_security_parameters(UsmSecParams),
-%% PduType = Pdu#pdu.type,
-%% Hdr = #v3_hdr{msgID = MsgID,
-%% msgMaxSize = 1000,
-%% msgFlags = snmp_misc:mk_msg_flags(PduType, 0),
-%% msgSecurityModel = ?SEC_USM,
-%% msgSecurityParameters = SecBytes},
-%% Msg = #message{version = 'version-3', vsn_hdr = Hdr, data = Bytes},
-%% case (catch snmp_pdus:enc_message_only(Msg)) of
-%% {'EXIT', Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% L when list(L) ->
-%% {Msg, L}
-%% end;
-%% mk_discovery_msg(Version, Pdu, {Com, _, _, _, _}, UserName) ->
-%% Msg = #message{version = Version, vsn_hdr = Com, data = Pdu},
-%% case catch snmp_pdus:enc_message(Msg) of
-%% {'EXIT', Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% L when list(L) ->
-%% {Msg, L}
-%% end.
-
-
-%% mk_msg('version-3', Pdu, {Context, User, EngineID, CtxEngineId, SecLevel},
-%% MsgData) ->
-%% %% Code copied from snmp_mpd.erl
-%% {MsgId, SecName, SecData} =
-%% if
-%% tuple(MsgData), Pdu#pdu.type == 'get-response' ->
-%% MsgData;
-%% true ->
-%% Md = get(msg_id),
-%% put(msg_id, Md + 1),
-%% {Md, User, []}
-%% end,
-%% ScopedPDU = #scopedPdu{contextEngineID = CtxEngineId,
-%% contextName = Context,
-%% data = Pdu},
-%% ScopedPDUBytes = snmp_pdus:enc_scoped_pdu(ScopedPDU),
-
-%% PduType = Pdu#pdu.type,
-%% V3Hdr = #v3_hdr{msgID = MsgId,
-%% msgMaxSize = 1000,
-%% msgFlags = snmp_misc:mk_msg_flags(PduType, SecLevel),
-%% msgSecurityModel = ?SEC_USM},
-%% Message = #message{version = 'version-3', vsn_hdr = V3Hdr,
-%% data = ScopedPDUBytes},
-%% SecEngineID = case PduType of
-%% 'get-response' -> snmp_framework_mib:get_engine_id();
-%% _ -> EngineID
-%% end,
-%% case catch snmp_usm:generate_outgoing_msg(Message, SecEngineID,
-%% SecName, SecData, SecLevel) of
-%% {'EXIT', Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% {error, Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% Packet ->
-%% Packet
-%% end;
-%% mk_msg(Version, Pdu, {Com, _User, _EngineID, _Ctx, _SecLevel}, _SecData) ->
-%% Msg = #message{version = Version, vsn_hdr = Com, data = Pdu},
-%% case catch snmp_pdus:enc_message(Msg) of
-%% {'EXIT', Reason} ->
-%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
-%% error;
-%% B when list(B) ->
-%% B
-%% end.
-
-
-%% handle_system_info_updated(#state{log = {Log, _OldType}} = State,
-%% audit_trail_log_type = _What) ->
-%% %% Just to make sure, check that ATL is actually enabled
-%% case snmpm_config:system_info(audit_trail_log) of
-%% {ok, true} ->
-%% {ok, Type} = snmpm_config:system_info(audit_trail_log_type),
-%% NewState = State#state{log = {Log, Type}},
-%% {NewState, ok};
-%% _ ->
-%% {State, {error, {adt_not_enabled}}}
-%% end;
-%% handle_system_info_updated(_State, _What) ->
-%% ok.
-
-handle_get_log_type(#state{log = {_Log, Value}} = State) ->
- %% Just to make sure, check that ATL is actually enabled
- case snmpm_config:system_info(audit_trail_log) of
- {ok, true} ->
- Type =
- case {lists:member(read, Value), lists:member(write, Value)} of
- {true, true} ->
- read_write;
- {true, false} ->
- read;
- {false, true} ->
- write;
- {false, false} ->
- throw({State, {error, {bad_atl_type, Value}}})
- end,
- {ok, Type};
- _ ->
- {error, not_enabled}
- end;
-handle_get_log_type(_State) ->
- {error, not_enabled}.
-
-handle_set_log_type(#state{log = {Log, OldValue}} = State, NewType) ->
- %% Just to make sure, check that ATL is actually enabled
- case snmpm_config:system_info(audit_trail_log) of
- {ok, true} ->
- NewValue =
- case NewType of
- read ->
- [read];
- write ->
- [write];
- read_write ->
- [read,write];
- _ ->
- throw({State, {error, {bad_atl_type, NewType}}})
- end,
- NewState = State#state{log = {Log, NewValue}},
- OldType =
- case {lists:member(read, OldValue),
- lists:member(write, OldValue)} of
- {true, true} ->
- read_write;
- {true, false} ->
- read;
- {false, true} ->
- write;
- {false, false} ->
- throw({State, {error, {bad_atl_type, OldValue}}})
- end,
- {NewState, {ok, OldType}};
- _ ->
- {State, {error, not_enabled}}
- end;
-handle_set_log_type(State, _NewType) ->
- {State, {error, not_enabled}}.
-
-
-%% -------------------------------------------------------------------
-
-worker_init(#state{log = undefined = Log}, Verbosity) ->
- worker_init2(Log, Verbosity);
-worker_init(#state{log = {Name, Log, Type}}, Verbosity) ->
- case snmp_log:open(Name, Log) of
- {ok, NewLog} ->
- worker_init2({Name, NewLog, Type}, Verbosity);
- {error, Reason} ->
- warning_msg("NetIf worker ~p failed opening ATL: "
- "~n ~p", [self(), Reason]),
- NewLog = undefined,
- worker_init2({Name, NewLog, Type}, Verbosity)
- end;
-worker_init(State, Verbosity) ->
- ?vinfo("worker_init -> entry with invalid data: "
- "~n State: ~p"
- "~n Verbosity: ~p", [State, Verbosity]),
- exit({worker_init, State, Verbosity}).
-
-worker_init2(Log, Verbosity) ->
- put(sname, mnifw),
- put(verbosity, Verbosity),
- Log.
-
-
-worker_exit(Tag, Info, Result) ->
- exit({net_if_worker, {Tag, Info, Result}}).
-
-handle_worker_exit(_, {_, _, ok}) ->
- ok;
-handle_worker_exit(Pid, {udp, {Addr, Port}, ExitStatus}) ->
- warning_msg("Worker process (~p) terminated "
- "while processing (incomming) message from ~w:~w: "
- "~n~p", [Pid, Addr, Port, ExitStatus]),
- ok;
-handle_worker_exit(Pid, {send_pdu, {Domain, Addr, Port}, ExitStatus}) ->
- warning_msg("Worker process (~p) terminated "
- "while processing (outgoing) pdu for [~w] ~w:~w: "
- "~n~p", [Pid, Domain, Addr, Port, ExitStatus]),
- ok;
-handle_worker_exit(Pid, {inform_response, {Addr, Port}, ExitStatus}) ->
- warning_msg("Worker process (~p) terminated "
- "while processing (outgoing) inform response for ~w:~w: "
- "~n~p", [Pid, Addr, Port, ExitStatus]),
- ok;
-handle_worker_exit(_, _) ->
- ok.
-
-
-%% -------------------------------------------------------------------
-
-make_response_pdu(#pdu{request_id = ReqId, varbinds = Vbs}) ->
- #pdu{type = 'get-response',
- request_id = ReqId,
- error_status = noError,
- error_index = 0,
- varbinds = Vbs}.
-
-
-%% ----------------------------------------------------------------
-
-pdu_type_of(#pdu{type = Type}) ->
- Type;
-pdu_type_of(TrapPdu) when is_record(TrapPdu, trappdu) ->
- trap.
-
-
-%% -------------------------------------------------------------------
-
-%% At this point this function is used during testing
-maybe_process_extra_info(?DEFAULT_EXTRA_INFO) ->
- ok;
-maybe_process_extra_info({?SNMPM_EXTRA_INFO_TAG, Fun})
- when is_function(Fun, 0) ->
- (catch Fun()),
- ok;
-maybe_process_extra_info(_ExtraInfo) ->
- ok.
-
-
-%% -------------------------------------------------------------------
-
-t() ->
- {A,B,C} = erlang:now(),
- A*1000000000+B*1000+(C div 1000).
-
-
-%% -------------------------------------------------------------------
-
-logger(undefined, _Type, _Addr, _Port) ->
- fun(_) ->
- ok
- end;
-logger({_Name, Log, Types}, Type, Addr, Port) ->
- case lists:member(Type, Types) of
- true ->
- fun(Msg) ->
- snmp_log:log(Log, Msg, Addr, Port)
- end;
- false ->
- fun(_) ->
- ok
- end
- end.
-
-
-%% -------------------------------------------------------------------
-
-%% info_msg(F, A) ->
-%% ?snmpm_info("NET-IF server: " ++ F, A).
-
-warning_msg(F, A) ->
- ?snmpm_warning("NET-IF server: " ++ F, A).
-
-error_msg(F, A) ->
- ?snmpm_error("NET-IF server: " ++ F, A).
-
-
-
-%%%-------------------------------------------------------------------
-
-% get_opt(Key, Opts) ->
-% ?vtrace("get option ~w", [Key]),
-% snmp_misc:get_option(Key, Opts).
-
-get_opt(Opts, Key, Def) ->
- ?vtrace("get option ~w with default ~p", [Key, Def]),
- snmp_misc:get_option(Key, Opts, Def).
-
-
-%% -------------------------------------------------------------------
-
-get_info(#state{sock = Id}) ->
- ProcSize = proc_mem(self()),
- PortInfo = get_port_info(Id),
- [{process_memory, ProcSize}, {port_info, PortInfo}].
-
-proc_mem(P) when is_pid(P) ->
- case (catch erlang:process_info(P, memory)) of
- {memory, Sz} when is_integer(Sz) ->
- Sz;
- _ ->
- undefined
- end.
-%% proc_mem(_) ->
-%% undefined.
-
-
-get_port_info(Id) ->
- PortInfo =
- case (catch erlang:port_info(Id)) of
- PI when is_list(PI) ->
- [{port_info, PI}];
- _ ->
- []
- end,
- PortStatus =
- case (catch prim_inet:getstatus(Id)) of
- {ok, PS} ->
- [{port_status, PS}];
- _ ->
- []
- end,
- PortAct =
- case (catch inet:getopts(Id, [active])) of
- {ok, PA} ->
- [{port_act, PA}];
- _ ->
- []
- end,
- PortStats =
- case (catch inet:getstat(Id)) of
- {ok, Stat} ->
- [{port_stats, Stat}];
- _ ->
- []
- end,
- IfList =
- case (catch inet:getif(Id)) of
- {ok, IFs} ->
- [{interfaces, IFs}];
- _ ->
- []
- end,
- BufSz =
- case (catch inet:getopts(Id, [recbuf, sndbuf, buffer])) of
- {ok, Sz} ->
- [{buffer_size, Sz}];
- _ ->
- []
- end,
- [{socket, Id}] ++
- IfList ++
- PortStats ++
- PortInfo ++
- PortStatus ++
- PortAct ++
- BufSz.
-
-
-%%-----------------------------------------------------------------
-%% Counter functions
-%%-----------------------------------------------------------------
-init_counters() ->
- F = fun(Counter) -> maybe_create_counter(Counter) end,
- lists:map(F, counters()).
-
-reset_counters() ->
- F = fun(Counter) -> snmpm_config:reset_stats_counter(Counter) end,
- lists:map(F, counters()).
-
-maybe_create_counter(Counter) ->
- snmpm_config:maybe_cre_stats_counter(Counter, 0).
-
-counters() ->
- [
- netIfMsgOutDrops,
- netIfMsgInDrops,
- netIfPduOutDrops,
- netIfPduInDrops
- ].
-
-inc(Name) -> inc(Name, 1).
-inc(Name, N) -> snmpm_config:incr_stats_counter(Name, N).
-
-%% get_counters() ->
-%% Counters = counters(),
-%% get_counters(Counters, []).
-
-%% get_counters([], Acc) ->
-%% lists:reverse(Acc);
-%% get_counters([Counter|Counters], Acc) ->
-%% case snmpm_config:get_stats_counter(Counter) of
-%% {ok, CounterVal} ->
-%% get_counters(Counters, [{Counter, CounterVal}|Acc]);
-%% _ ->
-%% get_counters(Counters, Acc)
-%% end.
-
-
-%% ----------------------------------------------------------------
-
-call(Pid, Req) ->
- call(Pid, Req, infinity).
-
-call(Pid, Req, Timeout) ->
- gen_server:call(Pid, Req, Timeout).
-
-cast(Pid, Msg) ->
- gen_server:cast(Pid, Msg).
+-define(snmpm_net_if_mt, true).
+-module(snmpm_net_if_mt).
+-include("snmpm_net_if.erl").
diff --git a/lib/snmp/src/manager/snmpm_network_interface.erl b/lib/snmp/src/manager/snmpm_network_interface.erl
index b830d45ce7..d0f6f709d3 100644
--- a/lib/snmp/src/manager/snmpm_network_interface.erl
+++ b/lib/snmp/src/manager/snmpm_network_interface.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/manager/snmpm_network_interface_filter.erl b/lib/snmp/src/manager/snmpm_network_interface_filter.erl
index ae8b7cfce1..35bec4e7e7 100644
--- a/lib/snmp/src/manager/snmpm_network_interface_filter.erl
+++ b/lib/snmp/src/manager/snmpm_network_interface_filter.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/manager/snmpm_server.erl b/lib/snmp/src/manager/snmpm_server.erl
index 484954addb..c8d7fa1e8b 100644
--- a/lib/snmp/src/manager/snmpm_server.erl
+++ b/lib/snmp/src/manager/snmpm_server.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -163,8 +164,7 @@
reg_type,
target,
domain,
- addr,
- port,
+ address,
type,
data,
ref,
@@ -468,27 +468,6 @@ cancel_async_request(UserId, ReqId) ->
call({cancel_async_request, UserId, ReqId}).
-%% discovery(UserId, BAddr) ->
-%% discovery(UserId, BAddr, ?SNMP_AGENT_PORT, [],
-%% ?DEFAULT_ASYNC_EXPIRE, ?EXTRA_INFO).
-
-%% discovery(UserId, BAddr, Config) when is_list(Config) ->
-%% discovery(UserId, BAddr, ?SNMP_AGENT_PORT, Config,
-%% ?DEFAULT_ASYNC_EXPIRE, ?EXTRA_INFO);
-
-%% discovery(UserId, BAddr, Expire) when is_integer(Expire) ->
-%% discovery(UserId, BAddr, ?SNMP_AGENT_PORT, [], Expire, ?EXTRA_INFO).
-
-%% discovery(UserId, BAddr, Config, Expire) ->
-%% discovery(UserId, BAddr, ?SNMP_AGENT_PORT, Config, Expire, ?EXTRA_INFO).
-
-%% discovery(UserId, BAddr, Port, Config, Expire) ->
-%% discovery(UserId, BAddr, Port, Config, Expire, ?EXTRA_INFO).
-
-%% discovery(UserId, BAddr, Port, Config, Expire, ExtraInfo) ->
-%% call({discovery, self(), UserId, BAddr, Port, Config, Expire, ExtraInfo}).
-
-
verbosity(Verbosity) ->
case ?vvalidate(Verbosity) of
Verbosity ->
@@ -928,14 +907,6 @@ handle_call({cancel_async_request, UserId, ReqId}, _From, State) ->
{reply, Reply, State};
-%% handle_call({discovery, Pid, UserId, BAddr, Port, Config, Expire, ExtraInfo},
-%% _From, State) ->
-%% ?vlog("received discovery request", []),
-%% Reply = (catch handle_discovery(Pid, UserId, BAddr, Port, Config,
-%% Expire, ExtraInfo, State)),
-%% {reply, Reply, State};
-
-
handle_call({load_mib, Mib}, _From, State) ->
?vlog("received load_mib request", []),
case snmpm_config:load_mib(Mib) of
@@ -989,13 +960,6 @@ handle_call(is_started, _From, State) ->
IsStarted = is_started(State),
{reply, IsStarted, State};
-%% handle_call({system_info_updated, Target, What}, _From, State) ->
-%% ?vlog("received system_info_updated request: "
-%% "~n Target: ~p"
-%% "~n What: ~p", [Target, What]),
-%% Reply = handle_system_info_updated(State, Target, What),
-%% {reply, Reply, State};
-
handle_call(get_log_type, _From, State) ->
?vlog("received get_log_type request", []),
Reply = handle_get_log_type(State),
@@ -1033,46 +997,41 @@ handle_info({snmp_error, Pdu, Reason}, State) ->
handle_snmp_error(Pdu, Reason, State),
{noreply, State};
-handle_info({snmp_error, Reason, Addr, Port}, State) ->
+handle_info({snmp_error, Reason, Domain, Addr}, State) ->
?vlog("received snmp_error message", []),
- handle_snmp_error(Addr, Port, -1, Reason, State),
+ handle_snmp_error(Domain, Addr, -1, Reason, State),
{noreply, State};
-handle_info({snmp_error, ReqId, Reason, Addr, Port}, State) ->
+handle_info({snmp_error, ReqId, Reason, Domain, Addr}, State) ->
?vlog("received snmp_error message", []),
- handle_snmp_error(Addr, Port, ReqId, Reason, State),
+ handle_snmp_error(Domain, Addr, ReqId, Reason, State),
{noreply, State};
-%% handle_info({snmp_error, ReqId, Pdu, Reason, Addr, Port}, State) ->
-%% ?vlog("received snmp_error message", []),
-%% handle_snmp_error(Pdu, ReqId, Reason, Addr, Port, State),
-%% {noreply, State};
-
-handle_info({snmp_pdu, Pdu, Addr, Port}, State) ->
+handle_info({snmp_pdu, Pdu, Domain, Addr}, State) ->
?vlog("received snmp_pdu message", []),
- handle_snmp_pdu(Pdu, Addr, Port, State),
+ handle_snmp_pdu(Pdu, Domain, Addr, State),
{noreply, State};
-handle_info({snmp_trap, Trap, Addr, Port}, State) ->
+handle_info({snmp_trap, Trap, Domain, Addr}, State) ->
?vlog("received snmp_trap message", []),
- handle_snmp_trap(Trap, Addr, Port, State),
+ handle_snmp_trap(Trap, Domain, Addr, State),
{noreply, State};
-handle_info({snmp_inform, Ref, Pdu, Addr, Port}, State) ->
+handle_info({snmp_inform, Ref, Pdu, Domain, Addr}, State) ->
?vlog("received snmp_inform message", []),
- handle_snmp_inform(Ref, Pdu, Addr, Port, State),
+ handle_snmp_inform(Ref, Pdu, Domain, Addr, State),
{noreply, State};
-handle_info({snmp_report, {ok, Pdu}, Addr, Port}, State) ->
- handle_snmp_report(Pdu, Addr, Port, State),
+handle_info({snmp_report, {ok, Pdu}, Domain, Addr}, State) ->
+ handle_snmp_report(Pdu, Domain, Addr, State),
{noreply, State};
-handle_info({snmp_report, {error, ReqId, Info, Pdu}, Addr, Port}, State) ->
- handle_snmp_report(ReqId, Pdu, Info, Addr, Port, State),
+handle_info({snmp_report, {error, ReqId, Info, Pdu}, Domain, Addr}, State) ->
+ handle_snmp_report(ReqId, Pdu, Info, Domain, Addr, State),
{noreply, State};
@@ -1176,11 +1135,11 @@ handle_sync_get(Pid, UserId, TargetName, Oids, SendOpts, From, State) ->
"~n From: ~p",
[Pid, UserId, TargetName, Oids, SendOpts, From]),
case agent_data(TargetName, SendOpts) of
- {ok, RegType, Domain, Addr, Port, Vsn, MsgData} ->
+ {ok, RegType, Domain, Addr, Vsn, MsgData} ->
?vtrace("handle_sync_get -> send a ~p message", [Vsn]),
Extra = ?GET_EXTRA(SendOpts),
ReqId = send_get_request(Oids, Vsn, MsgData,
- Domain, Addr, Port,
+ Domain, Addr,
Extra, State),
?vdebug("handle_sync_get -> ReqId: ~p", [ReqId]),
Msg = {sync_timeout, ReqId, From},
@@ -1193,8 +1152,7 @@ handle_sync_get(Pid, UserId, TargetName, Oids, SendOpts, From, State) ->
reg_type = RegType,
target = TargetName,
domain = Domain,
- addr = Addr,
- port = Port,
+ address = Addr,
type = get,
data = MsgData,
ref = Ref,
@@ -1230,11 +1188,11 @@ handle_sync_get_next(Pid, UserId, TargetName, Oids, SendOpts,
"~n From: ~p",
[Pid, UserId, TargetName, Oids, SendOpts, From]),
case agent_data(TargetName, SendOpts) of
- {ok, RegType, Domain, Addr, Port, Vsn, MsgData} ->
+ {ok, RegType, Domain, Addr, Vsn, MsgData} ->
?vtrace("handle_sync_get_next -> send a ~p message", [Vsn]),
Extra = ?GET_EXTRA(SendOpts),
ReqId = send_get_next_request(Oids, Vsn, MsgData,
- Domain, Addr, Port,
+ Domain, Addr,
Extra, State),
?vdebug("handle_sync_get_next -> ReqId: ~p", [ReqId]),
Msg = {sync_timeout, ReqId, From},
@@ -1247,12 +1205,11 @@ handle_sync_get_next(Pid, UserId, TargetName, Oids, SendOpts,
reg_type = RegType,
target = TargetName,
domain = Domain,
- addr = Addr,
- port = Port,
+ address = Addr,
type = get_next,
data = MsgData,
ref = Ref,
- mon = MonRef,
+ mon = MonRef,
from = From},
ets:insert(snmpm_request_table, Req),
ok;
@@ -1290,11 +1247,11 @@ handle_sync_get_bulk(Pid, UserId, TargetName, NonRep, MaxRep, Oids, SendOpts,
"~n From: ~p",
[Pid, UserId, TargetName, NonRep, MaxRep, Oids, SendOpts, From]),
case agent_data(TargetName, SendOpts) of
- {ok, RegType, Domain, Addr, Port, Vsn, MsgData} ->
+ {ok, RegType, Domain, Addr, Vsn, MsgData} ->
?vtrace("handle_sync_get_bulk -> send a ~p message", [Vsn]),
Extra = ?GET_EXTRA(SendOpts),
ReqId = send_get_bulk_request(Oids, Vsn, MsgData,
- Domain, Addr, Port,
+ Domain, Addr,
NonRep, MaxRep, Extra, State),
?vdebug("handle_sync_get_bulk -> ReqId: ~p", [ReqId]),
Msg = {sync_timeout, ReqId, From},
@@ -1307,8 +1264,7 @@ handle_sync_get_bulk(Pid, UserId, TargetName, NonRep, MaxRep, Oids, SendOpts,
reg_type = RegType,
target = TargetName,
domain = Domain,
- addr = Addr,
- port = Port,
+ address = Addr,
type = get_bulk,
data = MsgData,
ref = Ref,
@@ -1346,11 +1302,11 @@ handle_sync_set(Pid, UserId, TargetName, VarsAndVals, SendOpts, From, State) ->
"~n From: ~p",
[Pid, UserId, TargetName, VarsAndVals, From]),
case agent_data(TargetName, SendOpts) of
- {ok, RegType, Domain, Addr, Port, Vsn, MsgData} ->
+ {ok, RegType, Domain, Addr, Vsn, MsgData} ->
?vtrace("handle_sync_set -> send a ~p message", [Vsn]),
Extra = ?GET_EXTRA(SendOpts),
ReqId = send_set_request(VarsAndVals, Vsn, MsgData,
- Domain, Addr, Port,
+ Domain, Addr,
Extra, State),
?vdebug("handle_sync_set -> ReqId: ~p", [ReqId]),
Msg = {sync_timeout, ReqId, From},
@@ -1363,8 +1319,7 @@ handle_sync_set(Pid, UserId, TargetName, VarsAndVals, SendOpts, From, State) ->
reg_type = RegType,
target = TargetName,
domain = Domain,
- addr = Addr,
- port = Port,
+ address = Addr,
type = set,
data = MsgData,
ref = Ref,
@@ -1400,11 +1355,11 @@ handle_async_get(Pid, UserId, TargetName, Oids, SendOpts, State) ->
"~n SendOpts: ~p",
[Pid, UserId, TargetName, Oids, SendOpts]),
case agent_data(TargetName, SendOpts) of
- {ok, RegType, Domain, Addr, Port, Vsn, MsgData} ->
+ {ok, RegType, Domain, Addr, Vsn, MsgData} ->
?vtrace("handle_async_get -> send a ~p message", [Vsn]),
Extra = ?GET_EXTRA(SendOpts),
ReqId = send_get_request(Oids, Vsn, MsgData,
- Domain, Addr, Port,
+ Domain, Addr,
Extra, State),
?vdebug("handle_async_get -> ReqId: ~p", [ReqId]),
Expire = ?ASYNC_GET_TIMEOUT(SendOpts),
@@ -1413,11 +1368,10 @@ handle_async_get(Pid, UserId, TargetName, Oids, SendOpts, State) ->
reg_type = RegType,
target = TargetName,
domain = Domain,
- addr = Addr,
- port = Port,
+ address = Addr,
type = get,
data = MsgData,
- expire = t() + Expire},
+ expire = snmp_misc:now(ms) + Expire},
ets:insert(snmpm_request_table, Req),
gct_activate(State#state.gct),
@@ -1450,11 +1404,11 @@ handle_async_get_next(Pid, UserId, TargetName, Oids, SendOpts, State) ->
"~n SendOpts: ~p",
[Pid, UserId, TargetName, Oids, SendOpts]),
case agent_data(TargetName, SendOpts) of
- {ok, RegType, Domain, Addr, Port, Vsn, MsgData} ->
+ {ok, RegType, Domain, Addr, Vsn, MsgData} ->
?vtrace("handle_async_get_next -> send a ~p message", [Vsn]),
Extra = ?GET_EXTRA(SendOpts),
ReqId = send_get_next_request(Oids, Vsn, MsgData,
- Domain, Addr, Port,
+ Domain, Addr,
Extra, State),
?vdebug("handle_async_get_next -> ReqId: ~p", [ReqId]),
Expire = ?ASYNC_GET_NEXT_TIMEOUT(SendOpts),
@@ -1463,11 +1417,10 @@ handle_async_get_next(Pid, UserId, TargetName, Oids, SendOpts, State) ->
reg_type = RegType,
target = TargetName,
domain = Domain,
- addr = Addr,
- port = Port,
+ address = Addr,
type = get_next,
data = MsgData,
- expire = t() + Expire},
+ expire = snmp_misc:now(ms) + Expire},
ets:insert(snmpm_request_table, Req),
gct_activate(State#state.gct),
@@ -1507,11 +1460,11 @@ handle_async_get_bulk(Pid,
"~n SendOpts: ~p",
[Pid, UserId, TargetName, NonRep, MaxRep, Oids, SendOpts]),
case agent_data(TargetName, SendOpts) of
- {ok, RegType, Domain, Addr, Port, Vsn, MsgData} ->
+ {ok, RegType, Domain, Addr, Vsn, MsgData} ->
?vtrace("handle_async_get_bulk -> send a ~p message", [Vsn]),
Extra = ?GET_EXTRA(SendOpts),
ReqId = send_get_bulk_request(Oids, Vsn, MsgData,
- Domain, Addr, Port,
+ Domain, Addr,
NonRep, MaxRep, Extra, State),
?vdebug("handle_async_get_bulk -> ReqId: ~p", [ReqId]),
Expire = ?ASYNC_GET_BULK_TIMEOUT(SendOpts),
@@ -1520,11 +1473,10 @@ handle_async_get_bulk(Pid,
reg_type = RegType,
target = TargetName,
domain = Domain,
- addr = Addr,
- port = Port,
+ address = Addr,
type = get_bulk,
data = MsgData,
- expire = t() + Expire},
+ expire = snmp_misc:now(ms) + Expire},
ets:insert(snmpm_request_table, Req),
gct_activate(State#state.gct),
{ok, ReqId};
@@ -1556,11 +1508,11 @@ handle_async_set(Pid, UserId, TargetName, VarsAndVals, SendOpts, State) ->
"~n SendOpts: ~p",
[Pid, UserId, TargetName, VarsAndVals, SendOpts]),
case agent_data(TargetName, SendOpts) of
- {ok, RegType, Domain, Addr, Port, Vsn, MsgData} ->
+ {ok, RegType, Domain, Addr, Vsn, MsgData} ->
?vtrace("handle_async_set -> send a ~p message", [Vsn]),
Extra = ?GET_EXTRA(SendOpts),
ReqId = send_set_request(VarsAndVals, Vsn, MsgData,
- Domain, Addr, Port,
+ Domain, Addr,
Extra, State),
?vdebug("handle_async_set -> ReqId: ~p", [ReqId]),
Expire = ?ASYNC_SET_TIMEOUT(SendOpts),
@@ -1569,11 +1521,10 @@ handle_async_set(Pid, UserId, TargetName, VarsAndVals, SendOpts, State) ->
reg_type = RegType,
target = TargetName,
domain = Domain,
- addr = Addr,
- port = Port,
+ address = Addr,
type = set,
data = MsgData,
- expire = t() + Expire},
+ expire = snmp_misc:now(ms) + Expire},
ets:insert(snmpm_request_table, Req),
gct_activate(State#state.gct),
@@ -1609,18 +1560,6 @@ handle_cancel_async_request(UserId, ReqId, _State) ->
?vlog("handle_cancel_async_request -> not found", []),
{error, not_found}
end.
-
-
-%% handle_system_info_updated(#state{net_if = Pid, net_if_mod = Mod} = _State,
-%% net_if = _Target, What) ->
-%% case (catch Mod:system_info_updated(Pid, What)) of
-%% {'EXIT', _} ->
-%% {error, not_supported};
-%% Else ->
-%% Else
-%% end;
-%% handle_system_info_updated(_State, Target, What) ->
-%% {error, {bad_target, Target, What}}.
handle_get_log_type(#state{net_if = Pid, net_if_mod = Mod}) ->
case (catch Mod:get_log_type(Pid)) of
@@ -1638,47 +1577,6 @@ handle_set_log_type(#state{net_if = Pid, net_if_mod = Mod}, NewType) ->
Else
end.
-
-%% handle_discovery(Pid, UserId, BAddr, Port, Config, Expire, ExtraInfo, State) ->
-%% ?vtrace("handle_discovery -> entry with"
-%% "~n Pid: ~p"
-%% "~n UserId: ~p"
-%% "~n BAddr: ~p"
-%% "~n Port: ~p"
-%% "~n Config: ~p"
-%% "~n Expire: ~p",
-%% [Pid, UserId, BAddr, Port, Config, Expire]),
-%% case agent_data(default, default, "", Config) of
-%% {ok, Addr, Port, Vsn, MsgData} ->
-%% ?vtrace("handle_discovery -> send a ~p disco message", [Vsn]),
-%% ReqId = send_discovery(Vsn, MsgData, BAddr, Port, ExtraInfo,
-%% State),
-%% ?vdebug("handle_discovery -> ReqId: ~p", [ReqId]),
-%% MonRef = erlang:monitor(process, Pid),
-%% ?vtrace("handle_discovery -> MonRef: ~p", [MonRef]),
-%% Req = #request{id = ReqId,
-%% user_id = UserId,
-%% target = TargetName,
-%% addr = BAddr,
-%% port = Port,
-%% type = get,
-%% data = MsgData,
-%% mon = MonRef,
-%% discovery = true,
-%% expire = t() + Expire},
-%% ets:insert(snmpm_request_table, Req),
-%% gct_activate(State#state.gct),
-%% {ok, ReqId};
-
-%% Error ->
-%% ?vinfo("failed retrieving agent data for discovery (get):"
-%% "~n BAddr: ~p"
-%% "~n Port: ~p"
-%% "~n Error: ~p", [BAddr, Port, Error]),
-%% Error
-%% end.
-
-
handle_sync_timeout(ReqId, From, State) ->
?vtrace("handle_sync_timeout -> entry with"
"~n ReqId: ~p"
@@ -1702,7 +1600,7 @@ handle_sync_timeout(ReqId, From, State) ->
Req = Req0#request{ref = undefined,
mon = undefined,
from = undefined,
- expire = t()},
+ expire = snmp_misc:now(ms)},
ets:insert(snmpm_request_table, Req),
gct_activate(State#state.gct),
ok;
@@ -1808,15 +1706,15 @@ handle_snmp_error(CrapError, Reason, _State) ->
"~n~p~n~p", [CrapError, Reason]),
ok.
-handle_snmp_error(Addr, Port, ReqId, Reason, State) ->
+handle_snmp_error(Domain, Addr, ReqId, Reason, State) ->
- ?vtrace("handle_snmp_error -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n ReqId: ~p"
- "~n Reason: ~p", [Addr, Port, ReqId, Reason]),
+ ?vtrace("handle_snmp_error -> entry with~n"
+ " Domain: ~p~n"
+ " Addr: ~p~n"
+ " ReqId: ~p~n"
+ " Reason: ~p", [Domain, Addr, ReqId, Reason]),
- case snmpm_config:get_agent_user_id(Addr, Port) of
+ case snmpm_config:get_agent_user_id(Domain, Addr) of
{ok, UserId} ->
case snmpm_config:user_info(UserId) of
{ok, UserMod, UserData} ->
@@ -1831,7 +1729,7 @@ handle_snmp_error(Addr, Port, ReqId, Reason, State) ->
error_msg("failed retreiving the default user "
"info handling snmp error "
"<~p,~p>: ~n~w~n~w",
- [Addr, Port, ReqId, Reason])
+ [Domain, Addr, ReqId, Reason])
end
end;
_Error ->
@@ -1843,7 +1741,7 @@ handle_snmp_error(Addr, Port, ReqId, Reason, State) ->
error_msg("failed retreiving the default user "
"info handling snmp error "
"<~p,~p>: ~n~w~n~w",
- [Addr, Port, ReqId, Reason])
+ [Domain, Addr, ReqId, Reason])
end
end.
@@ -1851,18 +1749,28 @@ handle_snmp_error(Addr, Port, ReqId, Reason, State) ->
handle_error(_UserId, Mod, Reason, ReqId, Data, _State) ->
?vtrace("handle_error -> entry when"
"~n Mod: ~p", [Mod]),
- F = fun() -> (catch Mod:handle_error(ReqId, Reason, Data)) end,
+ F = fun() ->
+ try
+ begin
+ Mod:handle_error(ReqId, Reason, Data)
+ end
+ catch
+ T:E ->
+ CallbackArgs = [ReqId, Reason, Data],
+ handle_invalid_result(handle_error, CallbackArgs, T, E)
+ end
+ end,
handle_callback(F),
ok.
handle_snmp_pdu(#pdu{type = 'get-response', request_id = ReqId} = Pdu,
- Addr, Port, State) ->
+ Domain, Addr, State) ->
- ?vtrace("handle_snmp_pdu(get-response) -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Pdu: ~p", [Addr, Port, Pdu]),
+ ?vtrace("handle_snmp_pdu(get-response) -> entry with~n"
+ " Domain: ~p~n"
+ " Addr: ~p~n"
+ " Pdu: ~p", [Domain, Addr, Pdu]),
case ets:lookup(snmpm_request_table, ReqId) of
@@ -1892,9 +1800,10 @@ handle_snmp_pdu(#pdu{type = 'get-response', request_id = ReqId} = Pdu,
SnmpResponse = {EStatus, EIndex, Varbinds2},
case snmpm_config:user_info(UserId) of
{ok, UserMod, UserData} ->
- handle_pdu(UserId, UserMod,
- RegType, Target, Addr, Port,
- ReqId, SnmpResponse, UserData, State),
+ handle_pdu(
+ UserId, UserMod,
+ RegType, Target, Domain, Addr,
+ ReqId, SnmpResponse, UserData, State),
maybe_delete(Disco, ReqId);
_Error ->
%% reply to outstanding request, for which there is no
@@ -1902,15 +1811,16 @@ handle_snmp_pdu(#pdu{type = 'get-response', request_id = ReqId} = Pdu,
%% Therefor send it to the default user
case snmpm_config:user_info() of
{ok, DefUserId, DefMod, DefData} ->
- handle_pdu(DefUserId, DefMod,
- RegType, Target, Addr, Port,
- ReqId, SnmpResponse, DefData, State),
+ handle_pdu(
+ DefUserId, DefMod,
+ RegType, Target, Domain, Addr,
+ ReqId, SnmpResponse, DefData, State),
maybe_delete(Disco, ReqId);
Error ->
error_msg("failed retreiving the default user "
"info handling pdu from "
"~p <~p,~p>: ~n~w~n~w",
- [Target, Addr, Port, Error, Pdu])
+ [Target, Domain, Addr, Error, Pdu])
end
end;
@@ -1964,7 +1874,7 @@ handle_snmp_pdu(#pdu{type = 'get-response', request_id = ReqId} = Pdu,
varbinds = Varbinds} = Pdu,
Varbinds2 = fix_vbs_BITS(Varbinds),
SnmpInfo = {EStatus, EIndex, Varbinds2},
- case snmpm_config:get_agent_user_id(Addr, Port) of
+ case snmpm_config:get_agent_user_id(Domain, Addr) of
{ok, UserId} ->
%% A very late reply or a reply to a request
%% that has been cancelled.
@@ -1989,7 +1899,7 @@ handle_snmp_pdu(#pdu{type = 'get-response', request_id = ReqId} = Pdu,
"user info handling (old) "
"pdu from "
"<~p,~p>: ~n~w~n~w",
- [Addr, Port, Error, Pdu])
+ [Domain, Addr, Error, Pdu])
end
end;
@@ -2006,86 +1916,141 @@ handle_snmp_pdu(#pdu{type = 'get-response', request_id = ReqId} = Pdu,
"no agent info found", []),
case snmpm_config:user_info() of
{ok, DefUserId, DefMod, DefData} ->
- handle_agent(DefUserId, DefMod,
- Addr, Port,
- pdu, ignore,
- SnmpInfo, DefData, State);
+ handle_agent(
+ DefUserId, DefMod,
+ Domain, Addr,
+ pdu, ignore,
+ SnmpInfo, DefData, State);
Error ->
error_msg("failed retreiving the default user "
"info handling (old) pdu when no user "
"found from "
"<~p,~p>: ~n~w~n~w",
- [Addr, Port, Error, Pdu])
+ [Domain, Addr, Error, Pdu])
end
end
end;
-handle_snmp_pdu(CrapPdu, Addr, Port, _State) ->
+handle_snmp_pdu(CrapPdu, Domain, Addr, _State) ->
error_msg("received crap (snmp) Pdu from ~w:~w =>"
- "~p", [Addr, Port, CrapPdu]),
+ "~p", [Domain, Addr, CrapPdu]),
ok.
-handle_pdu(_UserId, Mod, target_name = _RegType, TargetName, _Addr, _Port,
- ReqId, SnmpResponse, Data, _State) ->
+handle_pdu(
+ _UserId, Mod, target_name = _RegType, TargetName, _Domain, _Addr,
+ ReqId, SnmpResponse, Data, _State) ->
?vtrace("handle_pdu(target_name) -> entry when"
"~n Mod: ~p", [Mod]),
F = fun() ->
- (catch Mod:handle_pdu(TargetName, ReqId, SnmpResponse, Data))
+ try
+ begin
+ Mod:handle_pdu(TargetName, ReqId, SnmpResponse, Data)
+ end
+ catch
+ T:E ->
+ CallbackArgs = [TargetName, ReqId, SnmpResponse, Data],
+ handle_invalid_result(handle_pdu, CallbackArgs, T, E)
+ end
end,
handle_callback(F),
ok;
-handle_pdu(_UserId, Mod, addr_port = _RegType, _TargetName, Addr, Port,
- ReqId, SnmpResponse, Data, _State) ->
+handle_pdu(
+ _UserId, Mod, addr_port = _RegType, _TargetName, _Domain, Addr,
+ ReqId, SnmpResponse, Data, _State) ->
?vtrace("handle_pdu(addr_port) -> entry when"
"~n Mod: ~p", [Mod]),
F = fun() ->
- (catch Mod:handle_pdu(Addr, Port, ReqId, SnmpResponse, Data))
+ {Ip, Port} = Addr,
+ (catch Mod:handle_pdu(Ip, Port, ReqId, SnmpResponse, Data))
end,
handle_callback(F),
ok.
-handle_agent(UserId, Mod, Addr, Port, Type, Ref, SnmpInfo, Data, State) ->
+handle_agent(UserId, Mod, Domain, Addr, Type, Ref, SnmpInfo, Data, State) ->
?vtrace("handle_agent -> entry when"
"~n UserId: ~p"
"~n Type: ~p"
"~n Mod: ~p", [UserId, Type, Mod]),
F = fun() ->
- do_handle_agent(UserId, Mod, Addr, Port,
+ do_handle_agent(UserId, Mod, Domain, Addr,
Type, Ref, SnmpInfo, Data, State)
end,
handle_callback(F),
ok.
do_handle_agent(DefUserId, DefMod,
- Addr, Port,
+ Domain, Addr,
Type, Ref,
SnmpInfo, DefData, State) ->
?vdebug("do_handle_agent -> entry when"
"~n DefUserId: ~p", [DefUserId]),
- case (catch DefMod:handle_agent(Addr, Port, Type, SnmpInfo, DefData)) of
- {'EXIT', {undef, _}} when Type =:= pdu ->
+ {Domain_or_Ip, Addr_or_Port} =
+ case Domain of
+ snmpUDPDomain ->
+ Addr;
+ _ ->
+ {Domain, Addr}
+ end,
+ try DefMod:handle_agent(
+ Domain_or_Ip, Addr_or_Port, Type, SnmpInfo, DefData)
+ of
+ {register, UserId2, TargetName, Config} ->
+ ?vtrace("do_handle_agent -> register: "
+ "~n UserId2: ~p"
+ "~n TargetName: ~p"
+ "~n Config: ~p",
+ [UserId2, TargetName, Config]),
+ Config2 =
+ ensure_present(
+ [{tdomain, Domain}, {taddress, Addr}], Config),
+ Config3 = [{reg_type, target_name} | Config2],
+ case snmpm_config:register_agent(UserId2,
+ TargetName, Config3) of
+ ok ->
+ ok;
+ {error, Reason} ->
+ error_msg("failed registering agent - "
+ "handling agent "
+ "~p <~p,~p>: ~n~w",
+ [TargetName, Domain, Addr, Reason]),
+ ok
+ end;
+
+ ignore ->
+ ?vdebug("do_handle_agent -> ignore", []),
+ ok;
+
+ InvalidResult ->
+ CallbackArgs =
+ [Domain_or_Ip, Addr_or_Port, Type, SnmpInfo, DefData],
+ handle_invalid_result(handle_agent, CallbackArgs, InvalidResult)
+
+ catch
+ error:{undef, _} when Type =:= pdu ->
%% Maybe, still on the old API
?vdebug("do_handle_agent -> maybe still on the old api", []),
- case (catch DefMod:handle_agent(Addr, Port, SnmpInfo, DefData)) of
+ {Ip, Port} = Addr,
+ case (catch DefMod:handle_agent(Ip, Port, SnmpInfo, DefData)) of
{register, UserId2, Config} ->
?vtrace("do_handle_agent -> register: "
"~n UserId2: ~p"
"~n Config: ~p", [UserId2, Config]),
- TargetName = mk_target_name(Addr, Port, Config),
- Config2 = [{reg_type, addr_port},
- {address, Addr},
- {port, Port} | Config],
- case snmpm_config:register_agent(UserId2,
- TargetName, Config2) of
+ TargetName = mk_target_name(Domain, Addr, Config),
+ Config2 =
+ ensure_present(
+ [{tdomain, Domain}, {taddress, Addr}], Config),
+ Config3 = [{reg_type, addr_port} | Config2],
+ case snmpm_config:register_agent(
+ UserId2, TargetName, Config3) of
ok ->
ok;
{error, Reason} ->
error_msg("failed registering agent - "
"handling agent "
"~p <~p,~p>: ~n~w",
- [TargetName, Addr, Port, Reason]),
+ [TargetName, Domain, Addr, Reason]),
ok
end;
{register, UserId2, TargetName, Config} ->
@@ -2094,18 +2059,19 @@ do_handle_agent(DefUserId, DefMod,
"~n TargetName: ~p"
"~n Config: ~p",
[UserId2, TargetName, Config]),
- Config2 = ensure_present([{address, Addr}, {port, Port}],
- Config),
+ Config2 =
+ ensure_present(
+ [{tdomain, Domain}, {taddress, Addr}], Config),
Config3 = [{reg_type, target_name} | Config2],
- case snmpm_config:register_agent(UserId2,
- TargetName, Config3) of
+ case snmpm_config:register_agent(
+ UserId2, TargetName, Config3) of
ok ->
ok;
{error, Reason} ->
error_msg("failed registering agent - "
"handling agent "
"~p <~p,~p>: ~n~w",
- [TargetName, Addr, Port, Reason]),
+ [TargetName, Domain, Addr, Reason]),
ok
end;
_Ignore ->
@@ -2113,66 +2079,51 @@ do_handle_agent(DefUserId, DefMod,
ok
end;
- {'EXIT', {undef, _}} ->
+ error:{undef, _} ->
%% If the user does not implement the new API (but the
%% old), then this clause catches all non-pdu handle_agent
- %% calls. These calls was previously never made,so we make
+ %% calls. These calls was previously never made, so we make
%% a best-effert call (using reg-type target_name) to the
%% various callback functions, and leave it to the user to
%% figure out
%% Backward compatibillity crap
RegType = target_name,
- Target = mk_target_name(Addr, Port, default_agent_config()),
+ Target = mk_target_name(Domain, Addr, default_agent_config()),
case Type of
report ->
SnmpInform = SnmpInfo,
- handle_report(DefUserId, DefMod,
- RegType, Target, Addr, Port,
- SnmpInform, DefData, State);
+ handle_report(
+ DefUserId, DefMod,
+ RegType, Target, Domain, Addr,
+ SnmpInform, DefData, State);
inform ->
SnmpInform = SnmpInfo,
- handle_inform(DefUserId, DefMod, Ref,
- RegType, Target, Addr, Port,
- SnmpInform, DefData, State);
+ handle_inform(
+ DefUserId, DefMod, Ref,
+ RegType, Target, Domain, Addr,
+ SnmpInform, DefData, State);
trap ->
SnmpTrapInfo = SnmpInfo,
- handle_trap(DefUserId, DefMod,
- RegType, Target, Addr, Port,
- SnmpTrapInfo, DefData, State);
+ handle_trap(
+ DefUserId, DefMod,
+ RegType, Target, Domain, Addr,
+ SnmpTrapInfo, DefData, State);
_ ->
- error_msg("failed delivering ~w info to default user - "
- "regarding agent "
- "<~p,~p>: ~n~w", [Type, Addr, Port, SnmpInfo])
- end;
-
- {register, UserId2, TargetName, Config} ->
- ?vtrace("do_handle_agent -> register: "
- "~n UserId2: ~p"
- "~n TargetName: ~p"
- "~n Config: ~p",
- [UserId2, TargetName, Config]),
- Config2 = ensure_present([{address, Addr}, {port, Port}], Config),
- Config3 = [{reg_type, target_name} | Config2],
- case snmpm_config:register_agent(UserId2,
- TargetName, Config3) of
- ok ->
- ok;
- {error, Reason} ->
- error_msg("failed registering agent - "
- "handling agent "
- "~p <~p,~p>: ~n~w",
- [TargetName, Addr, Port, Reason]),
- ok
+ error_msg(
+ "failed delivering ~w info to default user - "
+ "regarding agent "
+ "<~p,~p>: ~n~w", [Type, Domain, Addr, SnmpInfo])
end;
- _Ignore ->
- ?vdebug("do_handle_agent -> ignore", []),
- ok
-
+ T:E ->
+ CallbackArgs =
+ [Domain_or_Ip, Addr_or_Port, Type, SnmpInfo, DefData],
+ handle_invalid_result(handle_agent, CallbackArgs, T, E)
+
end.
ensure_present([], Config) ->
@@ -2188,50 +2139,51 @@ ensure_present([{Key, _Val} = Elem|Ensure], Config) ->
%% Retrieve user info for this agent.
%% If this is an unknown agent, then use the default user
-handle_snmp_trap(#trappdu{enterprise = Enteprise,
- generic_trap = Generic,
- specific_trap = Spec,
- time_stamp = Timestamp,
- varbinds = Varbinds} = Trap,
- Addr, Port, State) ->
-
- ?vtrace("handle_snmp_trap [trappdu] -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Trap: ~p", [Addr, Port, Trap]),
+handle_snmp_trap(
+ #trappdu{enterprise = Enteprise,
+ generic_trap = Generic,
+ specific_trap = Spec,
+ time_stamp = Timestamp,
+ varbinds = Varbinds} = Trap, Domain, Addr, State) ->
+
+ ?vtrace("handle_snmp_trap [trappdu] -> entry with~n"
+ " Domain: ~p~n"
+ " Addr: ~p~n"
+ " Trap: ~p", [Domain, Addr, Trap]),
Varbinds2 = fix_vbs_BITS(Varbinds),
SnmpTrapInfo = {Enteprise, Generic, Spec, Timestamp, Varbinds2},
- do_handle_snmp_trap(SnmpTrapInfo, Addr, Port, State);
+ do_handle_snmp_trap(SnmpTrapInfo, Domain, Addr, State);
handle_snmp_trap(#pdu{error_status = EStatus,
error_index = EIndex,
varbinds = Varbinds} = Trap,
- Addr, Port, State) ->
+ Domain, Addr, State) ->
- ?vtrace("handle_snmp_trap [pdu] -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Trap: ~p", [Addr, Port, Trap]),
+ ?vtrace("handle_snmp_trap [pdu] -> entry with~n"
+ " Domain: ~p~n"
+ " Addr: ~p~n"
+ " Trap: ~p", [Domain, Addr, Trap]),
Varbinds2 = fix_vbs_BITS(Varbinds),
SnmpTrapInfo = {EStatus, EIndex, Varbinds2},
- do_handle_snmp_trap(SnmpTrapInfo, Addr, Port, State);
+ do_handle_snmp_trap(SnmpTrapInfo, Domain, Addr, State);
-handle_snmp_trap(CrapTrap, Addr, Port, _State) ->
+handle_snmp_trap(CrapTrap, Domain, Addr, _State) ->
error_msg("received crap (snmp) trap from ~w:~w =>"
- "~p", [Addr, Port, CrapTrap]),
+ "~p", [Domain, Addr, CrapTrap]),
ok.
-do_handle_snmp_trap(SnmpTrapInfo, Addr, Port, State) ->
- case snmpm_config:get_agent_user_info(Addr, Port) of
+do_handle_snmp_trap(SnmpTrapInfo, Domain, Addr, State) ->
+ case snmpm_config:get_agent_user_info(Domain, Addr) of
{ok, UserId, Target, RegType} ->
?vtrace("handle_snmp_trap -> found user: ~p", [UserId]),
case snmpm_config:user_info(UserId) of
{ok, Mod, Data} ->
- handle_trap(UserId, Mod,
- RegType, Target, Addr, Port,
- SnmpTrapInfo, Data, State);
+ handle_trap(
+ UserId, Mod,
+ RegType, Target, Domain, Addr,
+ SnmpTrapInfo, Data, State);
Error1 ->
%% User no longer exists, unregister agent
@@ -2243,84 +2195,94 @@ do_handle_snmp_trap(SnmpTrapInfo, Addr, Port, State) ->
%% Try use the default user
case snmpm_config:user_info() of
{ok, DefUserId, DefMod, DefData} ->
- handle_agent(DefUserId, DefMod,
- Addr, Port,
- trap, ignore,
- SnmpTrapInfo, DefData, State);
+ handle_agent(
+ DefUserId, DefMod,
+ Domain, Addr,
+ trap, ignore,
+ SnmpTrapInfo, DefData, State);
Error2 ->
- error_msg("failed retreiving the default "
- "user info handling report from "
- "~p <~p,~p>: ~n~w~n~w",
- [Target, Addr, Port,
- Error2, SnmpTrapInfo])
+ error_msg(
+ "failed retreiving the default "
+ "user info handling report from "
+ "~p <~p,~p>: ~n~w~n~w",
+ [Target, Domain, Addr,
+ Error2, SnmpTrapInfo])
end;
Error3 ->
%% Failed unregister agent,
%% now its getting messy...
- warning_msg("failed unregister agent ~p <~p,~p> "
- "belonging to non-existing "
- "user ~p, handling trap: "
- "~n Error: ~w"
- "~n Trap info: ~w",
- [Target, Addr, Port, UserId,
- Error3, SnmpTrapInfo])
+ warning_msg(
+ "failed unregister agent ~p <~p,~p> "
+ "belonging to non-existing "
+ "user ~p, handling trap: "
+ "~n Error: ~w"
+ "~n Trap info: ~w",
+ [Target, Domain, Addr, UserId,
+ Error3, SnmpTrapInfo])
end
end;
Error4 ->
%% Unknown agent, pass it on to the default user
?vlog("[trap] failed retreiving user id for agent <~p,~p>: "
- "~n ~p", [Addr, Port, Error4]),
+ "~n ~p", [Domain, Addr, Error4]),
case snmpm_config:user_info() of
{ok, DefUserId, DefMod, DefData} ->
- handle_agent(DefUserId, DefMod,
- Addr, Port,
- trap, ignore,
- SnmpTrapInfo, DefData, State);
+ handle_agent(
+ DefUserId, DefMod,
+ Domain, Addr,
+ trap, ignore,
+ SnmpTrapInfo, DefData, State);
Error5 ->
- error_msg("failed retreiving "
- "the default user info handling trap from "
- "<~p,~p>: ~n~w~n~w",
- [Addr, Port, Error5, SnmpTrapInfo])
+ error_msg(
+ "failed retreiving "
+ "the default user info handling trap from "
+ "<~p,~p>: ~n~w~n~w",
+ [Domain, Addr, Error5, SnmpTrapInfo])
end
end,
ok.
-handle_trap(UserId, Mod,
- RegType, Target, Addr, Port, SnmpTrapInfo, Data, State) ->
+handle_trap(
+ UserId, Mod, RegType, Target, Domain, Addr, SnmpTrapInfo, Data, State) ->
?vtrace("handle_trap -> entry with"
"~n UserId: ~p"
"~n Mod: ~p", [UserId, Mod]),
F = fun() ->
- do_handle_trap(UserId, Mod,
- RegType, Target, Addr, Port,
- SnmpTrapInfo, Data, State)
+ do_handle_trap(
+ UserId, Mod,
+ RegType, Target, Domain, Addr,
+ SnmpTrapInfo, Data, State)
end,
handle_callback(F),
ok.
-do_handle_trap(UserId, Mod,
- RegType, Target, Addr, Port, SnmpTrapInfo, Data, _State) ->
+do_handle_trap(
+ UserId, Mod, RegType, Target, Domain, Addr, SnmpTrapInfo, Data, _State) ->
?vdebug("do_handle_trap -> entry with"
"~n UserId: ~p", [UserId]),
- HandleTrap =
+ {HandleTrap, CallbackArgs} =
case RegType of
target_name ->
- fun() -> Mod:handle_trap(Target, SnmpTrapInfo, Data) end;
+ {fun() -> Mod:handle_trap(Target, SnmpTrapInfo, Data) end,
+ [Target, SnmpTrapInfo, Data]};
addr_port ->
- fun() -> Mod:handle_trap(Addr, Port, SnmpTrapInfo, Data) end
+ {Ip, Port} = Addr,
+ {fun() -> Mod:handle_trap(Ip, Port, SnmpTrapInfo, Data) end,
+ [Ip, Port, SnmpTrapInfo, Data]}
end,
- case (catch HandleTrap()) of
+ try HandleTrap() of
{register, UserId2, Config} ->
?vtrace("do_handle_trap -> register: "
"~n UserId2: ~p"
"~n Config: ~p", [UserId2, Config]),
- Target2 = mk_target_name(Addr, Port, Config),
- Config2 = [{reg_type, target_name},
- {address, Addr}, {port, Port} | Config],
+ Target2 = mk_target_name(Domain, Addr, Config),
+ Config2 =
+ [{reg_type, target_name},
+ {tdomain, Domain}, {taddress, Addr} | Config],
case snmpm_config:register_agent(UserId2, Target2, Config2) of
ok ->
ok;
@@ -2328,7 +2290,7 @@ do_handle_trap(UserId, Mod,
error_msg("failed registering agent "
"handling trap "
"<~p,~p>: ~n~w",
- [Addr, Port, Reason]),
+ [Domain, Addr, Reason]),
ok
end;
{register, UserId2, Target2, Config} ->
@@ -2346,50 +2308,59 @@ do_handle_trap(UserId, Mod,
error_msg("failed registering agent "
"handling trap "
"~p <~p,~p>: ~n~w",
- [Target2, Addr, Port, Reason]),
+ [Target2, Domain, Addr, Reason]),
reply
end;
unregister ->
?vtrace("do_handle_trap -> unregister", []),
- case snmpm_config:unregister_agent(UserId,
- Addr, Port) of
+ case snmpm_config:unregister_agent(UserId, Domain, Addr) of
ok ->
ok;
{error, Reason} ->
error_msg("failed unregistering agent "
"handling trap "
"<~p,~p>: ~n~w",
- [Addr, Port, Reason]),
+ [Domain, Addr, Reason]),
ok
end;
- _Ignore ->
+ ignore ->
?vtrace("do_handle_trap -> ignore", []),
- ok
+ ok;
+
+ InvalidResult ->
+ handle_invalid_result(handle_trap, CallbackArgs, InvalidResult)
+
+ catch
+ T:E ->
+ handle_invalid_result(handle_trap, CallbackArgs, T, E)
+
end.
-handle_snmp_inform(Ref,
- #pdu{error_status = EStatus,
- error_index = EIndex,
- varbinds = Varbinds} = Pdu, Addr, Port, State) ->
+handle_snmp_inform(
+ Ref,
+ #pdu{error_status = EStatus,
+ error_index = EIndex,
+ varbinds = Varbinds} = Pdu, Domain, Addr, State) ->
- ?vtrace("handle_snmp_inform -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Pdu: ~p", [Addr, Port, Pdu]),
+ ?vtrace("handle_snmp_inform -> entry with~n"
+ " Domain: ~p~n"
+ " Addr: ~p~n"
+ " Pdu: ~p", [Domain, Addr, Pdu]),
Varbinds2 = fix_vbs_BITS(Varbinds),
SnmpInform = {EStatus, EIndex, Varbinds2},
- case snmpm_config:get_agent_user_info(Addr, Port) of
+ case snmpm_config:get_agent_user_info(Domain, Addr) of
{ok, UserId, Target, RegType} ->
case snmpm_config:user_info(UserId) of
{ok, Mod, Data} ->
?vdebug("[inform] callback handle_inform with: "
"~n UserId: ~p"
"~n Mod: ~p", [UserId, Mod]),
- handle_inform(UserId, Mod, Ref,
- RegType, Target, Addr, Port,
- SnmpInform, Data, State);
+ handle_inform(
+ UserId, Mod, Ref,
+ RegType, Target, Domain, Addr,
+ SnmpInform, Data, State);
Error1 ->
%% User no longer exists, unregister agent
case snmpm_config:unregister_agent(UserId, Target) of
@@ -2400,15 +2371,16 @@ handle_snmp_inform(Ref,
"~n ~p", [UserId, Error1]),
case snmpm_config:user_info() of
{ok, DefUserId, DefMod, DefData} ->
- handle_agent(DefUserId, DefMod,
- Addr, Port,
- inform, Ref,
- SnmpInform, DefData, State);
+ handle_agent(
+ DefUserId, DefMod,
+ Domain, Addr,
+ inform, Ref,
+ SnmpInform, DefData, State);
Error2 ->
error_msg("failed retreiving the default "
"user info handling inform from "
"~p <~p,~p>: ~n~w~n~w",
- [Target, Addr, Port,
+ [Target, Domain, Addr,
Error2, Pdu])
end;
Error3 ->
@@ -2419,7 +2391,7 @@ handle_snmp_inform(Ref,
"user ~p, handling inform: "
"~n Error: ~w"
"~n Pdu: ~w",
- [Target, Addr, Port, UserId,
+ [Target, Domain, Addr, UserId,
Error3, Pdu])
end
end;
@@ -2427,63 +2399,72 @@ handle_snmp_inform(Ref,
Error4 ->
%% Unknown agent, pass it on to the default user
?vlog("[inform] failed retreiving user id for agent <~p,~p>: "
- "~n ~p", [Addr, Port, Error4]),
+ "~n ~p", [Domain, Addr, Error4]),
case snmpm_config:user_info() of
{ok, DefUserId, DefMod, DefData} ->
- handle_agent(DefUserId, DefMod,
- Addr, Port,
- inform, Ref,
- SnmpInform, DefData, State);
+ handle_agent(
+ DefUserId, DefMod,
+ Domain, Addr,
+ inform, Ref,
+ SnmpInform, DefData, State);
Error5 ->
error_msg("failed retreiving "
"the default user info handling inform from "
"<~p,~p>: ~n~w~n~w",
- [Addr, Port, Error5, Pdu])
+ [Domain, Addr, Error5, Pdu])
end
end,
ok;
-handle_snmp_inform(_Ref, CrapInform, Addr, Port, _State) ->
+handle_snmp_inform(_Ref, CrapInform, Domain, Addr, _State) ->
error_msg("received crap (snmp) inform from ~w:~w =>"
- "~p", [Addr, Port, CrapInform]),
+ "~p", [Domain, Addr, CrapInform]),
ok.
-handle_inform(UserId, Mod, Ref,
- RegType, Target, Addr, Port, SnmpInform, Data, State) ->
+handle_inform(
+ UserId, Mod, Ref,
+ RegType, Target, Domain, Addr, SnmpInform, Data, State) ->
?vtrace("handle_inform -> entry with"
"~n UserId: ~p"
"~n Mod: ~p", [UserId, Mod]),
F = fun() ->
- do_handle_inform(UserId, Mod, Ref,
- RegType, Target, Addr, Port, SnmpInform,
- Data, State)
+ do_handle_inform(
+ UserId, Mod, Ref,
+ RegType, Target, Domain, Addr, SnmpInform,
+ Data, State)
end,
handle_callback(F),
ok.
-do_handle_inform(UserId, Mod, Ref,
- RegType, Target, Addr, Port, SnmpInform, Data, State) ->
+do_handle_inform(
+ UserId, Mod, Ref,
+ RegType, Target, Domain, Addr, SnmpInform, Data, State) ->
?vdebug("do_handle_inform -> entry with"
"~n UserId: ~p", [UserId]),
- HandleInform =
+ {HandleInform, CallbackArgs} =
case RegType of
target_name ->
- fun() -> Mod:handle_inform(Target, SnmpInform, Data) end;
+ {fun() -> Mod:handle_inform(Target, SnmpInform, Data) end,
+ [Target, SnmpInform, Data]};
addr_port ->
- fun() -> Mod:handle_inform(Addr, Port, SnmpInform, Data) end
+ {Ip, Port} = Addr,
+ {fun() -> Mod:handle_inform(Ip, Port, SnmpInform, Data) end,
+ [Ip, Port, SnmpInform, Data]}
end,
Rep =
- case (catch HandleInform()) of
+ try HandleInform() of
{register, UserId2, Config} ->
?vtrace("do_handle_inform -> register: "
"~n UserId2: ~p"
"~n Config: ~p", [UserId2, Config]),
%% The only user which would do this is the
%% default user
- Target2 = mk_target_name(Addr, Port, Config),
- Config2 = [{reg_type, target_name},
- {address, Addr}, {port, Port} | Config],
+ Target2 = mk_target_name(Domain, Addr, Config),
+ Config2 =
+ [{reg_type, target_name} |
+ ensure_present(
+ [{tdomain, Domain}, {taddress, Addr}], Config)],
case snmpm_config:register_agent(UserId2, Target2, Config2) of
ok ->
reply;
@@ -2491,9 +2472,10 @@ do_handle_inform(UserId, Mod, Ref,
error_msg("failed registering agent "
"handling inform "
"~p <~p,~p>: ~n~w",
- [Target2, Addr, Port, Reason]),
+ [Target2, Domain, Addr, Reason]),
reply
end;
+
{register, UserId2, Target2, Config} ->
?vtrace("do_handle_inform -> register: "
"~n UserId2: ~p"
@@ -2509,54 +2491,71 @@ do_handle_inform(UserId, Mod, Ref,
error_msg("failed registering agent "
"handling inform "
"~p <~p,~p>: ~n~w",
- [Target2, Addr, Port, Reason]),
+ [Target2, Domain, Addr, Reason]),
reply
end;
+
unregister ->
?vtrace("do_handle_inform -> unregister", []),
- case snmpm_config:unregister_agent(UserId,
- Addr, Port) of
+ case snmpm_config:unregister_agent(
+ UserId, Domain, Addr) of
ok ->
reply;
{error, Reason} ->
error_msg("failed unregistering agent "
"handling inform "
"<~p,~p>: ~n~w",
- [Addr, Port, Reason]),
+ [Domain, Addr, Reason]),
reply
end;
+
no_reply ->
?vtrace("do_handle_inform -> no_reply", []),
no_reply;
- _Ignore ->
+
+ ignore ->
?vtrace("do_handle_inform -> ignore", []),
+ reply;
+
+ InvalidResult ->
+ handle_invalid_result(
+ handle_inform, CallbackArgs, InvalidResult),
+ reply
+
+ catch
+ T:E ->
+ handle_invalid_result(handle_inform, CallbackArgs, T, E),
reply
+
end,
- handle_inform_response(Rep, Ref, Addr, Port, State),
+ handle_inform_response(Rep, Ref, Domain, Addr, State),
ok.
-handle_inform_response(_, ignore, _Addr, _Port, _State) ->
+handle_inform_response(_, ignore, _Domain, _Addr, _State) ->
ignore;
-handle_inform_response(no_reply, _Ref, _Addr, _Port, _State) ->
+handle_inform_response(no_reply, _Ref, _Domain, _Addr, _State) ->
no_reply;
-handle_inform_response(_, Ref, Addr, Port,
- #state{net_if = Pid, net_if_mod = Mod}) ->
+handle_inform_response(
+ _, Ref, Domain, Addr,
+ #state{net_if = Pid, net_if_mod = Mod}) ->
?vdebug("handle_inform -> response", []),
- (catch Mod:inform_response(Pid, Ref, Addr, Port)).
+ (catch Mod:inform_response(Pid, Ref, Domain, Addr)).
-handle_snmp_report(#pdu{error_status = EStatus,
- error_index = EIndex,
- varbinds = Varbinds} = Pdu, Addr, Port, State) ->
+handle_snmp_report(
+ #pdu{error_status = EStatus,
+ error_index = EIndex,
+ varbinds = Varbinds} = Pdu,
+ Domain, Addr, State) ->
- ?vtrace("handle_snmp_report -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Pdu: ~p", [Addr, Port, Pdu]),
+ ?vtrace("handle_snmp_report -> entry with~n"
+ " Domain: ~p~n"
+ " Addr: ~p~n"
+ " Pdu: ~p", [Domain, Addr, Pdu]),
Varbinds2 = fix_vbs_BITS(Varbinds),
SnmpReport = {EStatus, EIndex, Varbinds2},
- case snmpm_config:get_agent_user_info(Addr, Port) of
+ case snmpm_config:get_agent_user_info(Domain, Addr) of
{ok, UserId, Target, RegType} ->
case snmpm_config:user_info(UserId) of
{ok, Mod, Data} ->
@@ -2566,7 +2565,7 @@ handle_snmp_report(#pdu{error_status = EStatus,
"~n ~p"
"~n ~p", [UserId, Mod, Target, SnmpReport]),
handle_report(UserId, Mod,
- RegType, Target, Addr, Port,
+ RegType, Target, Domain, Addr,
SnmpReport, Data, State);
Error1 ->
%% User no longer exists, unregister agent
@@ -2579,7 +2578,7 @@ handle_snmp_report(#pdu{error_status = EStatus,
case snmpm_config:user_info() of
{ok, DefUserId, DefMod, DefData} ->
handle_agent(DefUserId, DefMod,
- Addr, Port,
+ Domain, Addr,
report, ignore,
SnmpReport, DefData, State);
@@ -2587,7 +2586,7 @@ handle_snmp_report(#pdu{error_status = EStatus,
error_msg("failed retreiving the default "
"user info handling report from "
"~p <~p,~p>: ~n~w~n~w",
- [Target, Addr, Port,
+ [Target, Domain, Addr,
Error2, Pdu])
end;
Error3 ->
@@ -2598,7 +2597,7 @@ handle_snmp_report(#pdu{error_status = EStatus,
"user ~p, handling report: "
"~n Error: ~w"
"~n Report: ~w",
- [Target, Addr, Port, UserId,
+ [Target, Domain, Addr, UserId,
Error3, Pdu])
end
end;
@@ -2606,25 +2605,25 @@ handle_snmp_report(#pdu{error_status = EStatus,
Error4 ->
%% Unknown agent, pass it on to the default user
?vlog("[report] failed retreiving user id for agent <~p,~p>: "
- "~n ~p", [Addr, Port, Error4]),
+ "~n ~p", [Domain, Addr, Error4]),
case snmpm_config:user_info() of
{ok, DefUserId, DefMod, DefData} ->
handle_agent(DefUserId, DefMod,
- Addr, Port,
+ Domain, Addr,
report, ignore,
SnmpReport, DefData, State);
Error5 ->
error_msg("failed retreiving "
"the default user info handling report from "
"<~p,~p>: ~n~w~n~w",
- [Addr, Port, Error5, Pdu])
+ [Domain, Addr, Error5, Pdu])
end
end,
ok;
-handle_snmp_report(CrapReport, Addr, Port, _State) ->
+handle_snmp_report(CrapReport, Domain, Addr, _State) ->
error_msg("received crap (snmp) report from ~w:~w =>"
- "~p", [Addr, Port, CrapReport]),
+ "~p", [Domain, Addr, CrapReport]),
ok.
%% This could be from a failed get-request, so we might have a user
@@ -2632,20 +2631,20 @@ handle_snmp_report(CrapReport, Addr, Port, _State) ->
%% get-response (except for tha data which is different). Otherwise,
%% we handle it as an error (reported via the handle_error callback
%% function).
-handle_snmp_report(ReqId,
- #pdu{error_status = EStatus,
- error_index = EIndex,
- varbinds = Varbinds} = Pdu,
- {ReportReason, Info} = Rep,
- Addr, Port, State)
- when is_integer(ReqId) ->
-
- ?vtrace("handle_snmp_report -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n ReqId: ~p"
- "~n Rep: ~p"
- "~n Pdu: ~p", [Addr, Port, ReqId, Rep, Pdu]),
+handle_snmp_report(
+ ReqId,
+ #pdu{error_status = EStatus,
+ error_index = EIndex,
+ varbinds = Varbinds} = Pdu,
+ {ReportReason, Info} = Rep,
+ Domain, Addr, State) when is_integer(ReqId) ->
+
+ ?vtrace("handle_snmp_report -> entry with~n"
+ " Domain: ~p~n"
+ " Addr: ~p~n"
+ " ReqId: ~p~n"
+ " Rep: ~p~n"
+ " Pdu: ~p", [Domain, Addr, ReqId, Rep, Pdu]),
Varbinds2 = fix_vbs_BITS(Varbinds),
SnmpReport = {EStatus, EIndex, Varbinds2},
@@ -2690,7 +2689,7 @@ handle_snmp_report(ReqId,
%% Either not a sync request or no such request. Either
%% way, this is error info, so handle it as such.
- case snmpm_config:get_agent_user_id(Addr, Port) of
+ case snmpm_config:get_agent_user_id(Domain, Addr) of
{ok, UserId} ->
case snmpm_config:user_info(UserId) of
{ok, Mod, Data} ->
@@ -2714,7 +2713,7 @@ handle_snmp_report(ReqId,
"default user "
"info handling report from "
"<~p,~p>: ~n~w~n~w~n~w",
- [Addr, Port, Error,
+ [Domain, Addr, Error,
ReqId, Reason])
end
end;
@@ -2722,7 +2721,7 @@ handle_snmp_report(ReqId,
%% Unknown agent, pass it on to the default user
?vlog("[report] failed retreiving user id for "
"agent <~p,~p>: "
- "~n ~p", [Addr, Port, Error]),
+ "~n ~p", [Domain, Addr, Error]),
case snmpm_config:user_info() of
{ok, DefUserId, DefMod, DefData} ->
handle_error(DefUserId, DefMod, Reason, ReqId,
@@ -2732,62 +2731,71 @@ handle_snmp_report(ReqId,
"the default user info handling "
"report from "
"<~p,~p>: ~n~w~n~w~n~w",
- [Addr, Port, Error, ReqId, Reason])
+ [Domain, Addr, Error, ReqId, Reason])
end
end
end,
ok;
-handle_snmp_report(CrapReqId, CrapReport, CrapInfo, Addr, Port, _State) ->
- error_msg("received crap (snmp) report from ~w:~w =>"
- "~n~p~n~p~n~p", [Addr, Port, CrapReqId, CrapReport, CrapInfo]),
+handle_snmp_report(CrapReqId, CrapReport, CrapInfo, Domain, Addr, _State) ->
+ error_msg(
+ "received crap (snmp) report from ~w:~w =>"
+ "~n~p~n~p~n~p",
+ [Domain, Addr, CrapReqId, CrapReport, CrapInfo]),
ok.
-handle_report(UserId, Mod, RegType, Target, Addr, Port,
+handle_report(UserId, Mod, RegType, Target, Domain, Addr,
SnmpReport, Data, State) ->
?vtrace("handle_report -> entry with"
"~n UserId: ~p"
"~n Mod: ~p", [UserId, Mod]),
F = fun() ->
- do_handle_report(UserId, Mod, RegType, Target, Addr, Port,
- SnmpReport, Data, State)
+ do_handle_report(
+ UserId, Mod, RegType, Target, Domain, Addr,
+ SnmpReport, Data, State)
end,
handle_callback(F),
ok.
-do_handle_report(UserId, Mod,
- RegType, Target, Addr, Port, SnmpReport, Data, _State) ->
+do_handle_report(
+ UserId, Mod, RegType, Target, Domain, Addr,
+ SnmpReport, Data, _State) ->
?vdebug("do_handle_report -> entry with"
"~n UserId: ~p", [UserId]),
- HandleReport =
+ {HandleReport, CallbackArgs} =
case RegType of
target_name ->
- fun() -> Mod:handle_report(Target, SnmpReport, Data) end;
+ {fun() -> Mod:handle_report(Target, SnmpReport, Data) end,
+ [Target, SnmpReport, Data]};
addr_port ->
- fun() -> Mod:handle_report(Addr, Port, SnmpReport, Data) end
+ {Ip, Port} = Addr,
+ {fun() -> Mod:handle_report(Ip, Port, SnmpReport, Data) end,
+ [Ip, Port, SnmpReport, Data]}
end,
- case (catch HandleReport()) of
+ try HandleReport() of
{register, UserId2, Config} ->
?vtrace("do_handle_report -> register: "
"~n UserId2: ~p"
"~n Config: ~p", [UserId2, Config]),
%% The only user which would do this is the
%% default user
- Target2 = mk_target_name(Addr, Port, Config),
- Config2 = [{reg_type, target_name},
- {address, Addr}, {port, Port} | Config],
+ Target2 = mk_target_name(Domain, Addr, Config),
+ Config2 =
+ [{reg_type, target_name},
+ {tdomain, Domain}, {taddress, Addr} | Config],
case snmpm_config:register_agent(UserId2, Target2, Config2) of
ok ->
ok;
{error, Reason} ->
error_msg("failed registering agent "
"handling report "
- "<~p,~p>: ~n~w",
- [Addr, Port, Reason]),
+ "<~p,~p>: ~n~w",
+ [Domain, Addr, Reason]),
ok
end;
+
{register, UserId2, Target2, Config} ->
?vtrace("do_handle_report -> register: "
"~n UserId2: ~p"
@@ -2803,25 +2811,36 @@ do_handle_report(UserId, Mod,
error_msg("failed registering agent "
"handling report "
"~p <~p,~p>: ~n~w",
- [Target2, Addr, Port, Reason]),
+ [Target2, Domain, Addr, Reason]),
reply
end;
+
unregister ->
?vtrace("do_handle_trap -> unregister", []),
- case snmpm_config:unregister_agent(UserId,
- Addr, Port) of
+ case snmpm_config:unregister_agent(UserId, Domain, Addr) of
ok ->
ok;
{error, Reason} ->
error_msg("failed unregistering agent "
"handling report "
"<~p,~p>: ~n~w",
- [Addr, Port, Reason]),
+ [Domain, Addr, Reason]),
ok
end;
- _Ignore ->
+
+ ignore ->
?vtrace("do_handle_report -> ignore", []),
- ok
+ ok;
+
+ InvalidResult ->
+ handle_invalid_result(handle_report, CallbackArgs, InvalidResult),
+ reply
+
+ catch
+ T:E ->
+ handle_invalid_result(handle_report, CallbackArgs, T, E),
+ reply
+
end.
@@ -2835,6 +2854,25 @@ handle_callback(F) ->
end).
+
+handle_invalid_result(Func, Args, T, E) ->
+ Stacktrace = ?STACK(),
+ error_msg("Callback function failed: "
+ "~n Function: ~p"
+ "~n Args: ~p"
+ "~n Error Type: ~p"
+ "~n Error: ~p"
+ "~n Stacktrace: ~p",
+ [Func, Args, T, E, Stacktrace]).
+
+handle_invalid_result(Func, Args, InvalidResult) ->
+ error_msg("Callback function returned invalid result: "
+ "~n Function: ~p"
+ "~n Args: ~p"
+ "~n Invalid result: ~p",
+ [Func, Args, InvalidResult]).
+
+
handle_down(MonRef) ->
(catch do_handle_down(MonRef)).
@@ -2895,7 +2933,7 @@ cancel_timer(Ref) ->
handle_gc(GCT) ->
ets:safe_fixtable(snmpm_request_table, true),
- case do_gc(ets:first(snmpm_request_table), t()) of
+ case do_gc(ets:first(snmpm_request_table), snmp_misc:now(ms)) of
0 ->
gct_deactivate(GCT);
_ ->
@@ -2924,69 +2962,56 @@ do_gc(Key, Now) ->
%%
%%----------------------------------------------------------------------
-send_get_request(Oids, Vsn, MsgData, Domain, Addr, Port, ExtraInfo,
+send_get_request(Oids, Vsn, MsgData, Domain, Addr, ExtraInfo,
#state{net_if = NetIf,
net_if_mod = Mod,
mini_mib = MiniMIB}) ->
Pdu = make_pdu(get, Oids, MiniMIB),
- ?vtrace("send_get_request -> send get-request:"
- "~n Mod: ~p"
- "~n NetIf: ~p"
- "~n Pdu: ~p"
- "~n Vsn: ~p"
- "~n MsgData: ~p"
- "~n Domain: ~p"
- "~n Addr: ~p"
- "~n Port: ~p",
- [Mod, NetIf, Pdu, Vsn, MsgData, Domain, Addr, Port]),
+ ?vtrace("send_get_request -> send get-request:~n"
+ " Mod: ~p~n"
+ " NetIf: ~p~n"
+ " Pdu: ~p~n"
+ " Vsn: ~p~n"
+ " MsgData: ~p~n"
+ " Domain: ~p~n"
+ " Addr: ~p",
+ [Mod, NetIf, Pdu, Vsn, MsgData, Domain, Addr]),
Res = (catch Mod:send_pdu(NetIf, Pdu, Vsn, MsgData,
- Domain, Addr, Port, ExtraInfo)),
+ Domain, Addr, ExtraInfo)),
?vtrace("send_get_request -> send result:"
"~n ~p", [Res]),
Pdu#pdu.request_id.
-send_get_next_request(Oids, Vsn, MsgData, Domain, Addr, Port, ExtraInfo,
+send_get_next_request(Oids, Vsn, MsgData, Domain, Addr, ExtraInfo,
#state{mini_mib = MiniMIB,
net_if = NetIf,
net_if_mod = Mod}) ->
Pdu = make_pdu(get_next, Oids, MiniMIB),
- Mod:send_pdu(NetIf, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo),
+ Mod:send_pdu(NetIf, Pdu, Vsn, MsgData, Domain, Addr, ExtraInfo),
Pdu#pdu.request_id.
-send_get_bulk_request(Oids, Vsn, MsgData, Domain, Addr, Port,
+send_get_bulk_request(Oids, Vsn, MsgData, Domain, Addr,
NonRep, MaxRep, ExtraInfo,
#state{mini_mib = MiniMIB,
net_if = NetIf,
net_if_mod = Mod}) ->
Pdu = make_pdu(bulk, {NonRep, MaxRep, Oids}, MiniMIB),
- Mod:send_pdu(NetIf, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo),
+ Mod:send_pdu(NetIf, Pdu, Vsn, MsgData, Domain, Addr, ExtraInfo),
Pdu#pdu.request_id.
-send_set_request(VarsAndVals, Vsn, MsgData, Domain, Addr, Port, ExtraInfo,
+send_set_request(VarsAndVals, Vsn, MsgData, Domain, Addr, ExtraInfo,
#state{mini_mib = MiniMIB,
net_if = NetIf,
net_if_mod = Mod}) ->
Pdu = make_pdu(set, VarsAndVals, MiniMIB),
- Mod:send_pdu(NetIf, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo),
+ Mod:send_pdu(NetIf, Pdu, Vsn, MsgData, Domain, Addr, ExtraInfo),
Pdu#pdu.request_id.
-%% send_discovery(Vsn, MsgData, Addr, Port, ExtraInfo,
-%% #state{net_if = NetIf,
-%% net_if_mod = Mod}) ->
-%% Pdu = make_discovery_pdu(),
-%% Mod:send_pdu(NetIf, Pdu, Vsn, MsgData, Addr, Port, ExtraInfo),
-%% Pdu#pdu.request_id.
-
-
%%----------------------------------------------------------------------
%%
%%----------------------------------------------------------------------
-%% make_discovery_pdu() ->
-%% Oids = [?sysObjectID_instance, ?sysDescr_instance, ?sysUpTime_instance],
-%% make_pdu_impl(get, Oids).
-
make_pdu(set, VarsAndVals, MiniMIB) ->
VBs = [var_and_value_to_varbind(VAV, MiniMIB) || VAV <- VarsAndVals],
make_pdu_impl(set, VBs);
@@ -3163,17 +3188,16 @@ request_id() ->
%%----------------------------------------------------------------------
agent_data(TargetName, SendOpts) ->
- case snmpm_config:agent_info(TargetName, all) of
- {ok, Info} ->
- Version = agent_data_item(version, Info),
+ case snmpm_config:agent_info(TargetName, version) of
+ {ok, Version} ->
MsgData =
case Version of
v3 ->
- DefSecModel = agent_data_item(sec_model, Info),
- DefSecName = agent_data_item(sec_name, Info),
- DefSecLevel = agent_data_item(sec_level, Info),
+ DefSecModel = agent_data_item(sec_model, TargetName),
+ DefSecName = agent_data_item(sec_name, TargetName),
+ DefSecLevel = agent_data_item(sec_level, TargetName),
- EngineId = agent_data_item(engine_id, Info),
+ EngineId = agent_data_item(engine_id, TargetName),
CtxName = agent_data_item(context,
SendOpts,
?DEFAULT_CONTEXT),
@@ -3191,8 +3215,8 @@ agent_data(TargetName, SendOpts) ->
{SecModel, SecName, mk_sec_level_flag(SecLevel),
EngineId, CtxName, TargetName};
_ ->
- DefComm = agent_data_item(community, Info),
- DefSecModel = agent_data_item(sec_model, Info),
+ DefComm = agent_data_item(community, TargetName),
+ DefSecModel = agent_data_item(sec_model, TargetName),
Comm = agent_data_item(community,
SendOpts,
@@ -3203,21 +3227,20 @@ agent_data(TargetName, SendOpts) ->
{Comm, SecModel}
end,
- Domain = agent_data_item(tdomain, Info),
- Addr = agent_data_item(address, Info),
- Port = agent_data_item(port, Info),
- RegType = agent_data_item(reg_type, Info),
- {ok, RegType, Domain, Addr, Port, version(Version), MsgData};
+ Domain = agent_data_item(tdomain, TargetName),
+ Addr = agent_data_item(taddress, TargetName),
+ RegType = agent_data_item(reg_type, TargetName),
+ {ok, RegType, Domain, Addr, version(Version), MsgData};
Error ->
Error
end.
-agent_data_item(Item, Info) ->
- case lists:keysearch(Item, 1, Info) of
- {value, {_, Val}} ->
+agent_data_item(Item, TargetName) ->
+ case snmpm_config:agent_info(TargetName, Item) of
+ {ok, Val} ->
Val;
- false ->
- throw({error, {not_found, Item, Info}})
+ {error, not_found} ->
+ throw({error, {not_found, Item, TargetName}})
end.
agent_data_item(Item, Info, Default) ->
@@ -3271,7 +3294,7 @@ gct_init(#gct{parent = Parent, timeout = Timeout} = State) ->
gct(State, Timeout).
gct(#gct{parent = Parent, state = active} = State, Timeout) ->
- T = t(),
+ T = snmp_misc:now(ms),
receive
{stop, Parent} ->
ok;
@@ -3329,7 +3352,7 @@ gct(#gct{parent = Parent, state = idle} = State, Timeout) ->
end.
new_timeout(T1, T2) ->
- case T1 - (t() - T2) of
+ case T1 - (snmp_misc:now(ms) - T2) of
T when (T > 0) ->
T;
_ ->
@@ -3349,13 +3372,8 @@ maybe_demonitor(undefined) ->
maybe_demonitor(MonRef) ->
erlang:demonitor(MonRef).
-%% Time in milli seconds
-t() ->
- {A,B,C} = erlang:now(),
- A*1000000000+B*1000+(C div 1000).
-
-mk_target_name(Addr, Port, Config) ->
- snmpm_config:mk_target_name(Addr, Port, Config).
+mk_target_name(Domain, Addr, Config) ->
+ snmpm_config:mk_target_name(Domain, Addr, Config).
default_agent_config() ->
case snmpm_config:agent_info() of
@@ -3392,12 +3410,6 @@ call(Req) ->
call(Req, To) ->
gen_server:call(?SERVER, Req, To).
-%% cast(Msg) ->
-%% gen_server:cast(?SERVER, Msg).
-
-%% info_msg(F, A) ->
-%% ?snmpm_info("Server: " ++ F, A).
-
warning_msg(F, A) ->
?snmpm_warning("Server: " ++ F, A).
@@ -3473,20 +3485,3 @@ note_store_info(Pid) ->
%%----------------------------------------------------------------------
-
-
-%%----------------------------------------------------------------------
-%% Debug
-%%----------------------------------------------------------------------
-
-% sz(L) when is_list(L) ->
-% length(lists:flatten(L));
-% sz(B) when is_binary(B) ->
-% size(B).
-
-%% p(F) ->
-%% p(F, []).
-
-%% p(F, A) ->
-%% io:format("~w:" ++ F ++ "~n", [?MODULE | A]).
-
diff --git a/lib/snmp/src/manager/snmpm_server_sup.erl b/lib/snmp/src/manager/snmpm_server_sup.erl
index 16238e4aaf..842a5761ce 100644
--- a/lib/snmp/src/manager/snmpm_server_sup.erl
+++ b/lib/snmp/src/manager/snmpm_server_sup.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/manager/snmpm_supervisor.erl b/lib/snmp/src/manager/snmpm_supervisor.erl
index 8f43310c14..c36bbe1bdd 100644
--- a/lib/snmp/src/manager/snmpm_supervisor.erl
+++ b/lib/snmp/src/manager/snmpm_supervisor.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/manager/snmpm_user.erl b/lib/snmp/src/manager/snmpm_user.erl
index 78aa560b2e..c0100d372f 100644
--- a/lib/snmp/src/manager/snmpm_user.erl
+++ b/lib/snmp/src/manager/snmpm_user.erl
@@ -1,97 +1,124 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
-module(snmpm_user).
--export([behaviour_info/1]).
-
-behaviour_info(callbacks) ->
- [{handle_error, 3},
- {handle_agent, 5},
- {handle_pdu, 4},
- {handle_trap, 3},
- {handle_inform, 3},
- {handle_report, 3}];
-behaviour_info(_) ->
- undefined.
-
-
-%% handle_error(ReqId, Reason, UserData) -> Reply
-%% ReqId -> integer()
-%% Reason -> term()
-%% UserData -> term() (supplied when the user register)
-%% Reply -> ignore
-
-%% handle_agent(Addr, Port, Type, SnmpInfo, UserData) -> Reply
-%% Addr -> term()
-%% Port -> integer()
-%% Type -> pdu | trap | inform | report
-%% SnmpInfo -> {ErrorStatus, ErrorIndex, Varbinds}
-%% UserId -> term()
-%% ErrorStatus -> atom()
-%% ErrorIndex -> integer()
-%% Varbinds -> [varbind()]
-%% UserData -> term() (supplied when the user register)
-%% Reply -> ignore | {register, UserId, agent_info()}
-%% agent_info() -> [{agent_info_item(), agent_info_value()}]
-%% This is the same info as in update_agent_info/4
-
-%% handle_pdu(TargetName, ReqId, SnmpResponse, UserData) -> Reply
-%% TargetName -> target_name()
-%% ReqId -> term() (returned when calling ag(...), ...)
-%% SnmpResponse -> {ErrorStatus, ErrorIndex, Varbinds}
-%% ErrorStatus -> atom()
-%% ErrorIndex -> integer()
-%% Varbinds -> [varbind()]
-%% UserData -> term() (supplied when the user register)
-%% Reply -> ignore
-
-%% handle_trap(TargetName, SnmpTrapInfo, UserData) -> Reply
-%% TargetName -> target_name()
-%% SnmpTrapInfo -> {Enteprise, Generic, Spec, Timestamp, Varbinds} |
-%% {ErrorStatus, ErrorIndex, Varbinds}
-%% Enteprise -> oid()
-%% Generic -> integer()
-%% Spec -> integer()
-%% Timestamp -> integer()
-%% ErrorStatus -> atom()
-%% ErrorIndex -> integer()
-%% Varbinds -> [varbind()]
-%% UserData -> term() (supplied when the user register)
-%% Reply -> ignore | unregister | {register, UserId, agent_info()}
-
-%% handle_inform(TargetName, SnmpInform, UserData) -> Reply
-%% TargetName -> target_name()
-%% SnmpInform -> {ErrorStatus, ErrorIndex, Varbinds}
-%% ErrorStatus -> atom()
-%% ErrorIndex -> integer()
-%% Varbinds -> [varbind()]
-%% UserData -> term() (supplied when the user register)
-%% Reply -> ignore | unregister | {register, UserId, agent_info()}
-%%
-
-%% handle_report(TargetName, SnmpReport, UserData) -> Reply
-%% TargetName -> target_name()
-%% SnmpReport -> {ErrorStatus, ErrorIndex, Varbinds}
-%% ErrorStatus -> integer()
-%% ErrorIndex -> integer()
-%% Varbinds -> [varbind()]
-%% UserData -> term() (supplied when the user register)
-%% Reply -> ignore | unregister | {register, UserId, agent_info()}
+-export_type([
+ snmp_gen_info/0,
+ snmp_v1_trap_info/0
+ ]).
+
+-type snmp_gen_info() :: {ErrorStatus :: atom(),
+ ErrorIndex :: pos_integer(),
+ Varbinds :: [snmp:varbind()]}.
+-type snmp_v1_trap_info() :: {Enteprise :: snmp:oid(),
+ Generic :: integer(),
+ Spec :: integer(),
+ Timestamp :: integer(),
+ Varbinds :: [snmp:varbind()]}.
+-type ip_address() :: inet:ip_address().
+-type port_number() :: inet:port_number().
+
+
+%% *** handle_error ***
+%% An "asynchronous" error has been detected
+
+-callback handle_error(
+ ReqId :: integer(),
+ Reason :: {unexpected_pdu, SnmpInfo :: snmp_gen_info()} |
+ {invalid_sec_info,
+ SecInfo :: term(),
+ SnmpInfo :: snmp_gen_info()} |
+ {empty_message,
+ TransportDomain :: atom(),
+ {Addr :: ip_address(), Port :: port_number()}} |
+ term(),
+ UserData :: term()) ->
+ snmp:void().
+
+
+%% *** handle_agent ***
+%% A message was received from an unknown agent
+
+-callback handle_agent(Domain :: atom(),
+ Address :: term(),
+ Type :: pdu | trap | inform | report,
+ SnmpInfo :: snmp_gen_info() | snmp_v1_trap_info(),
+ UserData :: term()) ->
+ Reply :: ignore |
+ {register,
+ UserId :: term(),
+ RTargetName :: snmpm:target_name(),
+ AgentConfig :: [snmpm:agent_config()]}.
+
+
+%% *** handle_pdu ***
+%% Handle the reply to an async request (such as get, get-next and set).
+
+-callback handle_pdu(TargetName :: snmpm:target_name(),
+ ReqId :: term(),
+ SnmpResponse :: snmp_gen_info(),
+ UserData :: term()) ->
+ snmp:void().
+
+
+%% *** handle_trap ***
+%% Handle a trap/notification message received from an agent
+
+-callback handle_trap(TargetName :: snmpm:target_name(),
+ SnmpTrapInfo :: snmp_gen_info() | snmp_v1_trap_info(),
+ UserData :: term()) ->
+ Reply :: ignore |
+ unregister |
+ {register,
+ UserId :: term(),
+ RTargetName :: snmpm:target_name(),
+ AgentConfig :: [snmpm:agent_config()]}.
+
+
+%% *** handle_inform ***
+%% Handle a inform message received from an agent
+
+-callback handle_inform(TargetName :: snmpm:target_name(),
+ SnmpInform :: snmp_gen_info(),
+ UserData :: term()) ->
+ Reply :: ignore | no_reply |
+ unregister |
+ {register,
+ UserId :: term(),
+ RTargetName :: snmpm:target_name(),
+ AgentConfig :: [snmpm:agent_config()]}.
+
+
+%% *** handle_report ***
+%% Handle a report message received from an agent
+
+-callback handle_report(TargetName :: snmpm:target_name(),
+ SnmpReport :: snmp_gen_info(),
+ UserData :: term()) ->
+ Reply :: ignore |
+ unregister |
+ {register,
+ UserId :: term(),
+ RTargetName :: snmpm:target_name(),
+ AgentConfig :: [snmpm:agent_config()]}.
+
+
diff --git a/lib/snmp/src/manager/snmpm_user_default.erl b/lib/snmp/src/manager/snmpm_user_default.erl
index d90fc3f258..bc2b82a38b 100644
--- a/lib/snmp/src/manager/snmpm_user_default.erl
+++ b/lib/snmp/src/manager/snmpm_user_default.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -36,13 +37,13 @@ handle_error(ReqId, Reason, UserData) ->
ignore.
-handle_agent(Addr, Port, Type, SnmpInfo, UserData) ->
- info("received handle_agent:"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Type: ~p"
- "~n SnmpInfo: ~p"
- "~n UserData: ~p", [Addr, Port, Type, SnmpInfo, UserData]),
+handle_agent(Domain, Address, Type, SnmpInfo, UserData) ->
+ info("received handle_agent:~n"
+ " Domain: ~p~n"
+ " Address: ~p~n"
+ " Type: ~p~n"
+ " SnmpInfo: ~p~n"
+ " UserData: ~p", [Domain, Address, Type, SnmpInfo, UserData]),
ignore.
@@ -62,7 +63,7 @@ handle_trap(TargetName, SnmpTrap, UserData) ->
"~n SnmpTrap: ~p"
"~n UserData: ~p",
[TargetName, SnmpTrap, UserData]),
- ok.
+ ignore.
handle_inform(TargetName, SnmpInform, UserData) ->
@@ -80,7 +81,7 @@ handle_report(TargetName, SnmpReport, UserData) ->
"~n SnmpReport: ~p"
"~n UserData: ~p",
[TargetName, SnmpReport, UserData]),
- ok.
+ ignore.
info(F, A) ->
diff --git a/lib/snmp/src/manager/snmpm_user_old.erl b/lib/snmp/src/manager/snmpm_user_old.erl
index 69b1470790..bc15ad445b 100644
--- a/lib/snmp/src/manager/snmpm_user_old.erl
+++ b/lib/snmp/src/manager/snmpm_user_old.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/manager/snmpm_usm.erl b/lib/snmp/src/manager/snmpm_usm.erl
index 497d6d6102..7dd79e703a 100644
--- a/lib/snmp/src/manager/snmpm_usm.erl
+++ b/lib/snmp/src/manager/snmpm_usm.erl
@@ -1,24 +1,28 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
%%-----------------------------------------------------------------
%% This module implements the User Based Security Model for SNMP,
%% as defined in rfc2274.
+%%
+%% AES: RFC 3826
+%%
%%-----------------------------------------------------------------
-module(snmpm_usm).
@@ -416,11 +420,14 @@ get_des_salt() ->
[?i32(EngineBoots), ?i32(SaltInt)].
aes_encrypt(PrivKey, Data) ->
- snmp_usm:aes_encrypt(PrivKey, Data, fun get_aes_salt/0).
+ EngineBoots = get_engine_boots(),
+ EngineTime = get_engine_time(),
+ snmp_usm:aes_encrypt(PrivKey, Data, fun get_aes_salt/0,
+ EngineBoots, EngineTime).
aes_decrypt(PrivKey, UsmSecParams, EncData) ->
- #usmSecurityParameters{msgPrivacyParameters = MsgPrivParams,
- msgAuthoritativeEngineTime = EngineTime,
+ #usmSecurityParameters{msgPrivacyParameters = MsgPrivParams,
+ msgAuthoritativeEngineTime = EngineTime,
msgAuthoritativeEngineBoots = EngineBoots} =
UsmSecParams,
snmp_usm:aes_decrypt(PrivKey, MsgPrivParams, EncData,
diff --git a/lib/snmp/src/manager/snmpm_usm.hrl b/lib/snmp/src/manager/snmpm_usm.hrl
index 1939ad6ed9..38d4a1a07e 100644
--- a/lib/snmp/src/manager/snmpm_usm.hrl
+++ b/lib/snmp/src/manager/snmpm_usm.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/misc/Makefile b/lib/snmp/src/misc/Makefile
index 698c341268..adc2c4858f 100644
--- a/lib/snmp/src/misc/Makefile
+++ b/lib/snmp/src/misc/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/misc/depend.mk b/lib/snmp/src/misc/depend.mk
index dea0f75048..b2e0a92997 100644
--- a/lib/snmp/src/misc/depend.mk
+++ b/lib/snmp/src/misc/depend.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/misc/modules.mk b/lib/snmp/src/misc/modules.mk
index 32092aaae2..ac42128724 100644
--- a/lib/snmp/src/misc/modules.mk
+++ b/lib/snmp/src/misc/modules.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/src/misc/snmp_conf.erl b/lib/snmp/src/misc/snmp_conf.erl
index e1e7fab57b..513616a285 100644
--- a/lib/snmp/src/misc/snmp_conf.erl
+++ b/lib/snmp/src/misc/snmp_conf.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -25,34 +26,42 @@
%% External exports
%% Avoid warning for local function error/1 clashing with autoimported BIF.
-compile({no_auto_import,[error/1]}).
--export([read_files/2, read/2]).
+-export([read_files/2, no_gen/2, no_order/2, no_filter/1, keyorder/4]).
+-export([read/2, read/3]).
%% Basic (type) check functions
-export([check_mandatory/2,
check_integer/1, check_integer/2,
-
+
check_string/1, check_string/2,
- check_atom/2,
+ check_atom/2,
check_timer/1,
- all_domains/0,
- check_domain/1,
- all_tdomains/0,
- check_tdomain/1,
- mk_tdomain/1,
- which_domain/1,
- check_ip/1, check_ip/2,
- check_taddress/1, check_taddress/2,
- mk_taddress/3,
-
- check_packet_size/1,
+ all_domains/0,
+ check_domain/1,
+ domain_to_name/1,
+ all_tdomains/0,
+ check_tdomain/1,
+ mk_tdomain/0, mk_tdomain/1,
+ tdomain_to_family/1, tdomain_to_domain/1,
+ which_domain/1,
+ mk_addr_string/1,
+ check_ip/1, check_ip/2,
+ check_port/1,
+%% ip_port_to_domaddr/2,
+ check_address/2, check_address/3,
+ check_taddress/2,
+ mk_taddress/1, mk_taddress/2,
+
+ check_packet_size/1,
check_oid/1,
-
- check_mp_model/1,
- check_sec_model/1, check_sec_model/2, check_sec_model/3,
+ check_imask/1, check_emask/1,
+
+ check_mp_model/1,
+ check_sec_model/1, check_sec_model/2, check_sec_model/3,
check_sec_level/1,
all_integer/1
@@ -69,17 +78,53 @@
-include("snmp_verbosity.hrl").
+-define(is_word(P), (((P) band (bnot 65535)) =:= 0)).
+-define(is_word(P0, P1), ((((P0) bor (P1)) band (bnot 255)) =:= 0)).
+
+mk_word(B0, B1) -> ((B0) bsl 8) bor (B1).
+mk_bytes(W) -> [(W) bsr 8,(W) band 255].
+
+-define(
+ is_ipv4_addr(A0, A1, A2, A3),
+ ((((A0) bor (A1) bor (A2) bor (A3)) band (bnot 255)) =:= 0)).
+
+-define(
+ is_ipv6_addr(A0, A1, A2, A3, A4, A5, A6, A7),
+ ((((A0) bor (A1) bor (A2) bor (A3) bor (A4) bor (A5) bor (A6) bor (A7))
+ band (bnot 65535)) =:= 0)).
+-define(
+ is_ipv6_addr(
+ A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15),
+ ((((A0) bor (A1) bor (A2) bor (A3) bor
+ (A4) bor (A5) bor (A6) bor (A7) bor
+ (A8) bor (A9) bor (A10) bor (A11) bor
+ (A12) bor (A13) bor (A14) bor (A15))
+ band (bnot 65535)) =:= 0)).
+
+
%%-----------------------------------------------------------------
%% read_files(Dir, Files) -> Configs
%% Dir - string() - Full path to the config dir.
-%% Files - [{Gen, Filter, Check, FileName}]
+%% Files - [{FileName, Gen, Order, Check, Filter}]
+%% FileName - string() - Name of the config file.
%% Gen - function/2 - In case of failure when reading the config file,
%% this function is called to either generate a
%% default file or issue the error.
-%% Filter - function/1 - Filters all the config entries read from the file
-%% Check - function/1 - Check each entry as they are read from the file.
-%% FileName - string() - Name of the config file.
+%% Returns a generated config list corresponding
+%% to the written file.
+%% (Dir, Error) -> Configs.
+%% Order - function/2 - An ordering function that is used to process
+%% the read config entries using lists:sort/2.
+%% Returns true if arg 1 compares less than or
+%% equal to arg 2, false otherwise.
+%% Check - function/2 - Check each entry as they are read from the file.
+%% (Entry, State) ->
+%% {ok,NewState} | {{ok,NewEntry},NewState} |
+%% throw(Error)
+%% State =:= 'undefined' the first time.
+%% Filter - function/1 - Process all the config entries read from the file
+%% (Configs) -> [config_entry()].
%% Configs - [config_entry()]
%% config_entry() - term()
@@ -88,99 +133,143 @@ read_files(Dir, Files) when is_list(Dir) andalso is_list(Files) ->
read_files(_Dir, [], Res) ->
lists:reverse(Res);
-read_files(Dir, [{Gen, Filter, Check, FileName}|Files], Res)
- when is_function(Filter) andalso
- is_function(Check) andalso
- is_list(FileName) ->
- ?vdebug("read_files -> entry with"
- "~n FileName: ~p", [FileName]),
+read_files(Dir, [{FileName, Gen, Order, Check, Filter}|Files], Res)
+ when is_list(FileName),
+ is_function(Gen),
+ is_function(Order),
+ is_function(Check),
+ is_function(Filter) ->
+ ?vdebug("read_files -> entry with~n"
+ " FileName: ~p", [FileName]),
File = filename:join(Dir, FileName),
- case file:read_file_info(File) of
- {ok, _} ->
- Confs = read(File, Check),
- read_files(Dir, Files, [Filter(Confs)|Res]);
- {error, R} ->
- ?vlog("failed reading file info for ~s: "
- "~n ~p", [FileName, R]),
- Gen(Dir, R),
- read_files(Dir, Files, [Filter([])|Res])
- end.
-
+ Confs =
+ case file:read_file_info(File) of
+ {ok,_} ->
+ read(File, Order, Check);
+ {error, R} ->
+ ?vlog("failed reading file info for ~s: ~n"
+ " ~p", [FileName, R]),
+ Gen(Dir, R)
+ end,
+ read_files(Dir, Files, [Filter(Confs)|Res]).
+
+
+
+no_gen(_Dir, _R) -> [].
+no_order(_, _) -> true.
+no_filter(X) -> X.
+
+%% Order tuples on element N with Keys first in appearence order.
+%%
+%% An ordering function (A, B) shall return true iff
+%% A is less than or equal to B i.e shall return
+%% false iff A is to be ordered after B.
+keyorder(N, A, B, _) when element(N, A) == element(N, B) ->
+ true;
+keyorder(N, A, B, [Key | _])
+ when tuple_size(A) >= 1, element(N, B) == Key ->
+ false;
+keyorder(N, A, B, [Key | _])
+ when element(N, A) == Key, tuple_size(B) >= 1 ->
+ true;
+keyorder(N, A, B, [_ | Keys]) ->
+ keyorder(N, A, B, Keys);
+keyorder(_, A, B, []) when tuple_size(A) >= 1, tuple_size(B) >= 1 ->
+ %% Do not order other keys
+ true;
+keyorder(N, A, B, sort) ->
+ %% Order other keys according to standard sort order
+ element(N, A) =< element(N, B).
+
+
+read(File, Verify) ->
+ Check = fun (Row, State) -> {Verify(Row), State} end,
+ read(File, fun no_order/2, Check).
%% Ret. Res | exit(Reason)
-read(File, Check) when is_function(Check) ->
- ?vdebug("read -> entry with"
- "~n File: ~p", [File]),
-
+read(File, Order, Check) when is_function(Order), is_function(Check) ->
+ ?vdebug("read -> entry with~n"
+ " File: ~p", [File]),
Fd = open_file(File),
+ read_fd(File, Order, Check, Fd, 1, []).
- case loop(Fd, [], Check, 1, File) of
- {error, Reason} ->
- file:close(Fd),
- error(Reason);
- {ok, Res} ->
- file:close(Fd),
- Res
+read_fd(File, Order, Check, Fd, StartLine, Res) ->
+ case do_read(Fd, "", StartLine) of
+ {ok, Row, EndLine} ->
+ ?vtrace("read_fd ->~n"
+ " Row: ~p~n"
+ " EndLine: ~p", [Row,EndLine]),
+ read_fd(
+ File, Order, Check, Fd, EndLine,
+ [{StartLine, Row, EndLine}|Res]);
+ {error, Error, EndLine} ->
+ ?vtrace("read_fd -> read failure:~n"
+ " Error: ~p~n"
+ " EndLine: ~p", [Error,EndLine]),
+ file:close(Fd),
+ error({failed_reading, File, StartLine, EndLine, Error});
+ {eof, _EndLine} ->
+ Lines =
+ lists:sort(
+ fun ({_, RowA, _}, {_, RowB, _}) ->
+ Order(RowA, RowB)
+ end,
+ lists:reverse(Res)),
+ ?vtrace("read_fd to read_check ->~n"
+ " Lines: ~p", [Lines]),
+ read_check(File, Check, Lines, undefined, [])
end.
-open_file(File) ->
- case file:open(File, [read]) of
- {ok, Fd} ->
- Fd;
- {error, Reason} ->
- error({failed_open, File, Reason})
+read_check(_, _, [], _, Res) ->
+ lists:reverse(Res);
+read_check(File, Check, [{StartLine, Row, EndLine}|Lines], State, Res) ->
+ try Check(Row, State) of
+ {Rows, NewState} when is_list(Rows) ->
+ ?vtrace("read_check -> ok:~n"
+ " Rows: ~p~n", [Rows]),
+ read_check(File, Check, Lines, NewState, Rows ++ Res);
+ {ok, NewState} ->
+ ?vtrace("read_check -> ok", []),
+ read_check(File, Check, Lines, NewState, [Row | Res]);
+ {{ok, NewRow}, NewState} ->
+ ?vtrace("read_check -> ok:~n"
+ " NewRow: ~p~n", [NewRow]),
+ read_check(File, Check, Lines, NewState, [NewRow | Res])
+ catch
+ {error, Reason} ->
+ ?vtrace("read_check -> error:~n"
+ " Reason: ~p", [Reason]),
+ error({failed_check, File, StartLine, EndLine, Reason});
+ Class:Reason ->
+ Error = {Class,Reason,erlang:get_stacktrace()},
+ ?vtrace("read_check -> failure:~n"
+ " Error: ~p", [Error]),
+ error({failed_check, File, StartLine, EndLine, Error})
end.
-loop(Fd, Res, Check, StartLine, File) ->
- case do_read(Fd, "", StartLine) of
- {ok, Row, EndLine} ->
- ?vtrace("loop -> "
- "~n Row: ~p"
- "~n EndLine: ~p", [Row, EndLine]),
- case (catch Check(Row)) of
- ok ->
- ?vtrace("loop -> ok", []),
- loop(Fd, [Row | Res], Check, EndLine, File);
- {ok, NewRow} ->
- ?vtrace("loop -> ok: "
- "~n NewRow: ~p", [NewRow]),
- loop(Fd, [NewRow | Res], Check, EndLine, File);
- {error, Reason} ->
- ?vtrace("loop -> check error: "
- "~n Reason: ~p", [Reason]),
- {error, {failed_check, File, StartLine, EndLine, Reason}};
- Error ->
- ?vtrace("loop -> check failure: "
- "~n Error: ~p", [Error]),
- {error, {failed_check, File, StartLine, EndLine, Error}}
- end;
- {error, EndLine, Error} ->
- ?vtrace("loop -> read failure: "
- "~n Error: ~p", [Error]),
- {error, {failed_reading, File, StartLine, EndLine, Error}};
- eof ->
- {ok, Res}
+open_file(File) ->
+ case file:open(File, [read]) of
+ {ok, Fd} ->
+ Fd;
+ {error, Reason} ->
+ error({failed_open, File, Reason})
end.
-
do_read(Io, Prompt, StartLine) ->
case io:request(Io, {get_until,Prompt,erl_scan,tokens,[StartLine]}) of
- {ok, Toks, EndLine} ->
- case erl_parse:parse_term(Toks) of
- {ok, Term} ->
- {ok, Term, EndLine};
- {error, {Line, erl_parse, Error}} ->
- {error, Line, {parse_error, Error}}
- end;
- {error,E,EndLine} ->
- {error, EndLine, E};
- {eof, _EndLine} ->
- eof;
- Other ->
- Other
+ {ok, Toks, EndLine} ->
+ case erl_parse:parse_term(Toks) of
+ {ok, Term} ->
+ {ok, Term, EndLine};
+ {error, {Line, erl_parse, Error}} ->
+ {error, {parse_error, Error}, Line}
+ end;
+ Other ->
+ Other
end.
+
%%-----------------------------------------------------------------
@@ -383,7 +472,7 @@ all_tdomains() ->
check_tdomain(TDomain) ->
SupportedTDomains =
[
- ?snmpUDPDomain,
+ ?snmpUDPDomain, % Legacy
?transportDomainUdpIpv4,
?transportDomainUdpIpv6
],
@@ -403,6 +492,9 @@ check_tdomain(TDomain) ->
%% ---------
+mk_tdomain() ->
+ mk_tdomain(snmpUDPDomain).
+
mk_tdomain(snmpUDPDomain) ->
mk_tdomain(transportDomainUdpIpv4);
mk_tdomain(transportDomainUdpIpv4) ->
@@ -415,40 +507,64 @@ mk_tdomain(BadDomain) ->
%% ---------
-check_taddress(X) ->
- check_taddress(snmpUDPDomain, X).
+tdomain_to_family(snmpUDPDomain) ->
+ inet;
+tdomain_to_family(transportDomainUdpIpv4) ->
+ inet;
+tdomain_to_family(transportDomainUdpIpv6) ->
+ inet6;
+tdomain_to_family(?snmpUDPDomain) ->
+ inet;
+tdomain_to_family(?transportDomainUdpIpv4) ->
+ inet;
+tdomain_to_family(?transportDomainUdpIpv6) ->
+ inet6;
+tdomain_to_family(BadDomain) ->
+ error({bad_domain, BadDomain}).
+
+
+%% ---------
+
+tdomain_to_domain(?snmpUDPDomain) ->
+ snmpUDPDomain;
+tdomain_to_domain(?transportDomainUdpIpv4) ->
+ transportDomainUdpIpv4;
+tdomain_to_domain(?transportDomainUdpIpv6) ->
+ transportDomainUdpIpv6;
+tdomain_to_domain(BadTDomain) ->
+ error({bad_tdomain, BadTDomain}).
+
+
+%% ---------
check_taddress(?snmpUDPDomain, X) ->
check_taddress(transportDomainUdpIpv4, X);
check_taddress(snmpUDPDomain, X) ->
check_taddress(transportDomainUdpIpv4, X);
-
+%%
check_taddress(?transportDomainUdpIpv4, X) ->
check_taddress(transportDomainUdpIpv4, X);
-check_taddress(transportDomainUdpIpv4, X)
- when is_list(X) andalso (length(X) =:= 6) ->
- case (catch all_integer(X)) of
- true ->
+check_taddress(transportDomainUdpIpv4, X) ->
+ case X of
+ [A0,A1,A2,A3,P0,P1]
+ when ?is_ipv4_addr(A0, A1, A2, A3), ?is_word(P0, P1) ->
ok;
- false ->
+ _ ->
error({invalid_taddress, X})
end;
-check_taddress(transportDomainUdpIpv4, X) ->
- error({invalid_taddress, X});
-
+%%
check_taddress(?transportDomainUdpIpv6, X) ->
check_taddress(transportDomainUdpIpv6, X);
-check_taddress(transportDomainUdpIpv6, X)
- when is_list(X) andalso (length(X) =:= 10) ->
- case (catch all_integer(X)) of
- true ->
+check_taddress(transportDomainUdpIpv6, X) ->
+ case X of
+ [A0,A1,A2,A3,A4,A5,A6,A7,P0,P1]
+ when ?is_ipv6_addr(A0, A1, A2, A3, A4, A5, A6, A7),
+ ?is_word(P0, P1) ->
ok;
- false ->
+ _ ->
error({invalid_taddress, X})
end;
-check_taddress(transportDomainUdpIpv6, X) ->
- error({invalid_taddress, X});
-
+%%
check_taddress(BadDomain, _X) ->
error({invalid_tdomain, BadDomain}).
@@ -488,6 +604,7 @@ do_check_timer(WaitFor, Factor, Incr, Retry) ->
check_integer(Retry, {gte, 0}),
ok.
+
%% ---------
all_domains() ->
@@ -510,96 +627,359 @@ all_domains() ->
transportDomainSctpDns
].
+check_domain(snmpUDPDomain) -> ok;
+check_domain(transportDomainUdpIpv4) -> ok;
+check_domain(transportDomainUdpIpv6) -> ok;
check_domain(Domain) ->
- SupportedDomains =
- [
- snmpUDPDomain,
- transportDomainUdpIpv4,
- transportDomainUdpIpv6
- ],
- AllDomains = all_domains(),
- case lists:member(Domain, SupportedDomains) of
+ case lists:member(Domain, all_domains()) of
true ->
- ok;
+ error({unsupported_domain, Domain});
false ->
- case lists:member(Domain, AllDomains) of
- true ->
- error({unsupported_domain, Domain});
- false ->
- error({unknown_domain, Domain})
- end
+ error({unknown_domain, Domain})
end.
-
+
+domain_to_name(snmpUDPDomain) ->
+ undefined;
+domain_to_name(transportDomainUdpIpv4) ->
+ udpIpv4;
+domain_to_name(transportDomainUdpIpv6) ->
+ udpIpv6;
+domain_to_name(transportDomainUdpIpv4z) ->
+ udpIpv4z;
+domain_to_name(transportDomainUdpIpv6z) ->
+ udpIpv6z;
+domain_to_name(transportDomainTcpIpv4) ->
+ tcpIpv4;
+domain_to_name(transportDomainTcpIpv6) ->
+ tcpIpv6;
+domain_to_name(transportDomainTcpIpv4z) ->
+ tcpIpv4z;
+domain_to_name(transportDomainTcpIpv6z) ->
+ tcpIpv6z;
+domain_to_name(transportDomainSctpIpv4) ->
+ sctpIpv4;
+domain_to_name(transportDomainSctpIpv6) ->
+ sctpIpv6;
+domain_to_name(transportDomainSctpIpv4z) ->
+ sctpIpv4z;
+domain_to_name(transportDomainSctpIpv6z) ->
+ sctpIpv6z;
+domain_to_name(transportDomainLocal) ->
+ local;
+domain_to_name(transportDomainUdpDns) ->
+ udpDns;
+domain_to_name(transportDomainTcpDns) ->
+ tcpDns;
+domain_to_name(transportDomainSctpDns) ->
+ sctpDns;
+domain_to_name(BadDomain) ->
+ error({bad_domain, BadDomain}).
%% ---------
-%% The values of Ip and Port has both been checked at this
-%% point, so we dont need to do that again.
-mk_taddress(snmpUDPDomain, Ip, Port) ->
- mk_taddress(transportDomainUdpIpv4, Ip, Port);
-mk_taddress(transportDomainUdpIpv4, Ip, Port) when is_list(Ip) ->
- Ip ++ [Port div 256, Port rem 256];
-mk_taddress(transportDomainUdpIpv4 = Domain, Ip, Port) when is_tuple(Ip) ->
- mk_taddress(Domain, tuple_to_list(Ip), Port);
-mk_taddress(transportDomainUdpIpv6, Ip, Port) when is_list(Ip) ->
- Ip ++ [Port div 256, Port rem 256];
-mk_taddress(transportDomainUdpIpv6 = Domain, Ip, Port) when is_tuple(Ip) ->
- mk_taddress(Domain, tuple_to_list(Ip), Port);
+mk_taddress(Address) ->
+ mk_taddress(snmpUDPDomain, Address).
+%% The values of Domain, Ip and Port has both been checked at this
+%% point, so we dont need to do that again, but this function is
+%% also used on incoming packets from net_if so a little
+%% check that net_if does not supply bad arguments is in order.
+%%
%% These are just for convenience
-mk_taddress(?snmpUDPDomain, Ip, Port) ->
- mk_taddress(snmpUDPDomain, Ip, Port);
-mk_taddress(?transportDomainUdpIpv4, Ip, Port) ->
- mk_taddress(transportDomainUdpIpv4, Ip, Port);
-mk_taddress(?transportDomainUdpIpv6, Ip, Port) ->
- mk_taddress(transportDomainUdpIpv6, Ip, Port);
-
+mk_taddress(?snmpUDPDomain, Address) ->
+ mk_taddress(snmpUDPDomain, Address);
+mk_taddress(?transportDomainUdpIpv4, Address) ->
+ mk_taddress(transportDomainUdpIpv4, Address);
+mk_taddress(?transportDomainUdpIpv6, Address) ->
+ mk_taddress(transportDomainUdpIpv6, Address);
+%%
+mk_taddress(snmpUDPDomain, Address) -> % Legacy
+ mk_taddress(transportDomainUdpIpv4, Address);
+mk_taddress(transportDomainUdpIpv4 = Domain, Address) ->
+ case Address of
+ [] -> % Empty mask
+ [];
+ {Ip, Port} when tuple_size(Ip) =:= 4, is_integer(Port) ->
+ tuple_to_list(Ip) ++ mk_bytes(Port);
+ _ ->
+ erlang:error(badarg, [Domain,Address])
+ end;
+mk_taddress(transportDomainUdpIpv6 = Domain, Address) ->
+ case Address of
+ [] -> % Empty mask
+ [];
+ {{A, B, C, D, E, F, G, H}, Port} ->
+ [A bsr 8, A band 255,
+ B bsr 8, B band 255,
+ C bsr 8, C band 255,
+ D bsr 8, D band 255,
+ E bsr 8, E band 255,
+ F bsr 8, F band 255,
+ G bsr 8, G band 255,
+ H bsr 8, H band 255,
+ Port bsr 8, Port band 255];
+ _ ->
+ erlang:error(badarg, [Domain,Address])
+ end;
%% Bad domain
-mk_taddress(BadDomain, _Ip, _Port) ->
+mk_taddress(BadDomain, _) ->
error({bad_domain, BadDomain}).
-
+
%% ---------
-which_domain(Ip) when is_list(Ip) andalso (length(Ip) =:= 4) ->
+%% XXX remove, when net_if handles one socket per transport domain
+
+which_domain([A0,A1,A2,A3])
+ when ?is_ipv4_addr(A0, A1, A2, A3) ->
transportDomainUdpIpv4;
-which_domain(Ip) when is_tuple(Ip) andalso (size(Ip) =:= 4) ->
+which_domain({A0, A1, A2, A3})
+ when ?is_ipv4_addr(A0, A1, A2, A3) ->
transportDomainUdpIpv4;
-which_domain(Ip) when is_list(Ip) andalso (length(Ip) =:= 8) ->
+which_domain([A0,A1,A2,A3,A4,A5,A6,A7])
+ when ?is_ipv6_addr(A0, A1, A2, A3, A4, A5, A6, A7) ->
transportDomainUdpIpv6;
-which_domain(Ip) when is_tuple(Ip) andalso (size(Ip) =:= 8) ->
+which_domain([A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15])
+ when ?is_ipv6_addr(
+ A0, A1, A2, A3, A4, A5, A6, A7,
+ A8, A9, A10, A11, A12, A13, A14, A15) ->
+ transportDomainUdpIpv6;
+which_domain({A0, A1, A2, A3, A4, A5, A6, A7})
+ when ?is_ipv6_addr(A0, A1, A2, A3, A4, A5, A6, A7) ->
transportDomainUdpIpv6.
-
%% ---------
+mk_addr_string({Domain, Addr}) when is_atom(Domain) ->
+ %% XXX There is only code for IP domains here
+ case check_address_ip(Domain, Addr) of
+ false ->
+ case check_address_ip_port(Domain, Addr) of
+ false ->
+ error({bad_address, {Domain, Addr}});
+ true ->
+ {IP, Port} = Addr,
+ mk_addr_string_ntoa(Domain, IP, Port);
+ {IP, Port} ->
+ mk_addr_string_ntoa(Domain, IP, Port)
+ end;
+ true ->
+ mk_addr_string_ntoa(Domain, Addr);
+ IP ->
+ mk_addr_string_ntoa(Domain, IP)
+ end;
+mk_addr_string({_IP, Port} = Addr) when is_integer(Port) ->
+ mk_addr_string({snmpUDPDomain, Addr});
+mk_addr_string(Strange) ->
+ lists:flatten(io_lib:format("~w", [Strange])).
+
+
+mk_addr_string_ntoa({_, _, _, _} = IP) ->
+ inet:ntoa(IP);
+mk_addr_string_ntoa(IP) ->
+ lists:flatten(io_lib:format("[~s]", [inet:ntoa(IP)])).
+
+mk_addr_string_ntoa(Domain, IP) ->
+ case domain_to_name(Domain) of
+ undefined ->
+ mk_addr_string_ntoa(IP);
+ Name ->
+ lists:flatten(
+ io_lib:format("~w://~s", [Name, mk_addr_string_ntoa(IP)]))
+ end.
+
+mk_addr_string_ntoa(Domain, IP, Port) ->
+ lists:flatten(
+ io_lib:format(
+ "~s:~w", [mk_addr_string_ntoa(Domain, IP), Port])).
+
+%% ---------
+
check_ip(X) ->
check_ip(snmpUDPDomain, X).
-check_ip(snmpUDPDomain, X) ->
- check_ip(transportDomainUdpIpv4, X);
-check_ip(transportDomainUdpIpv4, X) when is_list(X) andalso (length(X) =:= 4) ->
- case (catch all_integer(X)) of
- true ->
+check_ip(Domain, IP) ->
+ %% XXX There is only code for IP domains here
+ case check_address_ip(Domain, IP) of
+ false ->
+ error({bad_address, {Domain, IP}});
+ true ->
ok;
- false ->
- error({invalid_ip_address, X})
- end;
-check_ip(transportDomainUdpIpv4, X) ->
- error({invalid_ip_address, X});
+ FixedIP ->
+ {ok, FixedIP}
+ end.
+
+
+%% ---------
+
+check_port(Port) when ?is_word(Port) ->
+ ok;
+check_port(Port) ->
+ error({bad_port, Port}).
+
+%% ip_port_to_domaddr(IP, Port) when ?is_word(Port) ->
+%% %% XXX There is only code for IP domains here
+%% case check_address_ip(transportDomainUdpIpv4, IP) of
+%% false ->
+%% case check_address_ip(transportDomainUdpIpv6, IP) of
+%% false ->
+%% error({bad_address, {transportDomainUdpIpv4, {IP, Port}}});
+%% true ->
+%% {transportDomainUdpIpv6, {IP, Port}};
+%% FixedIP ->
+%% {transportDomainUdpIpv6, {FixedIP, Port}}
+%% end;
+%% true ->
+%% {transportDomainUdpIpv4, {IP, Port}};
+%% FixedIP ->
+%% {transportDomainUdpIpv4, {FixedIP, Port}}
+%% end;
+%% ip_port_to_domaddr(IP, Port) ->
+%% error({bad_address, {transportDomainUdpIpv4, {IP, Port}}}).
+
+%% Check a configuration term field from a file to see if it
+%% can be fixed to be fed to mk_taddress/2.
+
+check_address(Domain, Address, DefaultPort) ->
+ %% If Address does not contain Port or contains Port =:= 0
+ %% create an address containing DefaultPort
+ %%
+ %% XXX There is only code for IP domains here
+ case check_address_ip(Domain, Address) of
+ false ->
+ case check_address_ip_port(Domain, Address) of
+ false ->
+ error({bad_address, {Domain, Address}});
+ true ->
+ case Address of
+ {IP, 0} ->
+ {ok, {IP, DefaultPort}};
+ _ ->
+ ok
+ end;
+ {FixedIP, 0} ->
+ {ok, {FixedIP, DefaultPort}};
+ FixedAddress ->
+ {ok, FixedAddress}
+ end;
+ true ->
+ {ok, {Address, DefaultPort}};
+ FixedIP ->
+ {ok, {FixedIP, DefaultPort}}
+ end.
-check_ip(transportDomainUdpIpv6, X) when is_list(X) andalso (length(X) =:= 8) ->
- case (catch all_integer(X)) of
- true ->
+check_address(Domain, Address) ->
+ %% Address has to contain Port
+ %%
+ %% XXX There is only code for IP domains here
+ case check_address_ip_port(Domain, Address) of
+ false ->
+ error({bad_address, {Domain, Address}});
+ true ->
ok;
- false ->
- error({invalid_ip_address, X})
+ FixedAddress ->
+ {ok, FixedAddress}
+ end.
+
+%% -> IP
+check_address_ip(Domain, Address)
+ when Domain =:= snmpUDPDomain;
+ Domain =:= transportDomainUdpIpv4 ->
+ case Address of
+ %% Erlang native format
+ {A0, A1, A2, A3}
+ when ?is_ipv4_addr(A0, A1, A2, A3) ->
+ true;
+ %% Erlangish format
+ [A0,A1,A2,A3]
+ when ?is_ipv4_addr(A0, A1, A2, A3) ->
+ {A0, A1, A2, A3};
+ _ ->
+ false
+ end;
+check_address_ip(transportDomainUdpIpv6, Address) ->
+ case Address of
+ %% Erlang native format
+ {A0, A1, A2, A3, A4, A5, A6, A7}
+ when ?is_ipv6_addr(A0, A1, A2, A3, A4, A5, A6, A7) ->
+ true;
+ %% Erlangish format
+ [A0,A1,A2,A3,A4,A5,A6,A7]
+ when ?is_ipv6_addr(A0, A1, A2, A3, A4, A5, A6, A7) ->
+ {A0, A1, A2, A3, A4, A5, A6, A7};
+ %% SNMP standards format
+ [A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15]
+ when ?is_ipv6_addr(
+ A0, A1, A2, A3, A4, A5, A6, A7,
+ A8, A9, A10, A11, A12, A13, A14, A15) ->
+ {mk_word(A0, A1), mk_word(A2, A3),
+ mk_word(A4, A5), mk_word(A6, A7),
+ mk_word(A8, A9), mk_word(A10, A11),
+ mk_word(A12, A13), mk_word(A14, A15)};
+ _ ->
+ false
end;
-check_ip(transportDomainUdpIpv6, X) ->
- error({invalid_ip_address, X});
+check_address_ip(BadDomain, _) ->
+ error({bad_domain, BadDomain}).
-check_ip(BadDomain, _X) ->
- error({invalid_domain, BadDomain}).
+%% -> {IP, Port}
+check_address_ip_port(Domain, Address)
+ when Domain =:= snmpUDPDomain;
+ Domain =:= transportDomainUdpIpv4 ->
+ case Address of
+ {IP, Port} when ?is_word(Port) ->
+ case check_address_ip(Domain, IP) of
+ false ->
+ false;
+ true ->
+ true;
+ FixedIP ->
+ {FixedIP, Port}
+ end;
+ %% SNMP standards format
+ [A0,A1,A2,A3,P0,P1]
+ when ?is_ipv4_addr(A0, A1, A2, A3), ?is_word(P0, P1) ->
+ {{A0, A1, A2, A3}, mk_word(P0, P1)};
+ _ ->
+ false
+ end;
+check_address_ip_port(transportDomainUdpIpv6 = Domain, Address) ->
+ case Address of
+ {IP, Port} when ?is_word(Port) ->
+ case check_address_ip(Domain, IP) of
+ false ->
+ false;
+ true ->
+ true;
+ FixedIP ->
+ {FixedIP, Port}
+ end;
+ %% Erlang friendly list format
+ [A0,A1,A2,A3,A4,A5,A6,A7,P]
+ when ?is_ipv6_addr(A0, A1, A2, A3, A4, A5, A6, A7),
+ ?is_word(P) ->
+ {{A0, A1, A2, A3, A4, A5, A6, A7}, P};
+ %% Strange hybrid format with port as bytes
+ [A0,A1,A2,A3,A4,A5,A6,A7,P0,P1]
+ when ?is_ipv6_addr(A0, A1, A2, A3, A4, A5, A6, A7),
+ ?is_word(P0, P1) ->
+ {{A0, A1, A2, A3, A4, A5, A6, A7}, mk_word(P0, P1)};
+ %% SNMP standards format
+ [A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,P0,P1]
+ when ?is_ipv6_addr(
+ A0, A1, A2, A3, A4, A5, A6, A7,
+ A8, A9, A10, A11, A12, A13, A14, A15),
+ ?is_word(P0, P1) ->
+ {{mk_word(A0, A1), mk_word(A2, A3),
+ mk_word(A4, A5), mk_word(A6, A7),
+ mk_word(A8, A9), mk_word(A10, A11),
+ mk_word(A12, A13), mk_word(A14, A15)},
+ mk_word(P0, P1)};
+ _ ->
+ false
+ end;
+check_address_ip_port(BadDomain, _) ->
+ error({bad_domain, BadDomain}).
@@ -618,6 +998,39 @@ check_oid(X) ->
%% ---------
+%% Check a (view) mask in the internal form (all 0 and 1):
+check_imask(null) ->
+ {ok, []};
+check_imask(IMask) when is_list(IMask) ->
+ do_check_imask(IMask),
+ {ok, IMask}.
+
+do_check_imask([]) ->
+ ok;
+do_check_imask([0|IMask]) ->
+ do_check_imask(IMask);
+do_check_imask([1|IMask]) ->
+ do_check_imask(IMask);
+do_check_imask([X|_]) ->
+ error({invalid_internal_mask_element, X}).
+
+
+%% Check a (view) mask in the external form (according to MIB,
+%% an OCTET STRING of at most length 16).
+check_emask(EMask) when is_list(EMask) andalso (length(EMask) =< 16) ->
+ do_check_emask(EMask).
+
+do_check_emask([]) ->
+ ok;
+do_check_emask([X|EMask])
+ when is_integer(X) andalso (X >= 16#00) andalso (X =< 16#FF) ->
+ do_check_emask(EMask);
+do_check_emask([X|_]) ->
+ error({invalid_external_mask_element, X}).
+
+
+%% ---------
+
all_integer([H|T]) when is_integer(H) -> all_integer(T);
all_integer([_H|_T]) -> false;
all_integer([]) -> true.
diff --git a/lib/snmp/src/misc/snmp_config.erl b/lib/snmp/src/misc/snmp_config.erl
index 0bed097b62..45661b71a7 100644
--- a/lib/snmp/src/misc/snmp_config.erl
+++ b/lib/snmp/src/misc/snmp_config.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -26,24 +27,29 @@
-compile({no_auto_import,[error/1]}).
-export([config/0]).
--export([write_config_file/4, append_config_file/4, read_config_file/3]).
+%%-export([write_config_file/4, append_config_file/4, read_config_file/4]).
+
+-export([write_config_file/6, append_config_file/6, read_config_file/4]).
-export([write_agent_snmp_files/7, write_agent_snmp_files/12,
+ write_agent_snmp_files/6, write_agent_snmp_files/11,
- write_agent_snmp_conf/5,
+ write_agent_snmp_conf/4, write_agent_snmp_conf/5,
write_agent_snmp_context_conf/1,
write_agent_snmp_community_conf/1,
write_agent_snmp_standard_conf/2,
- write_agent_snmp_target_addr_conf/4,
- write_agent_snmp_target_addr_conf/6,
+ write_agent_snmp_target_addr_conf/3,
+ write_agent_snmp_target_addr_conf/4,
+ write_agent_snmp_target_addr_conf/5,
+ write_agent_snmp_target_addr_conf/6,
write_agent_snmp_target_params_conf/2,
write_agent_snmp_notify_conf/2,
write_agent_snmp_usm_conf/5,
write_agent_snmp_vacm_conf/3,
write_manager_snmp_files/8,
- write_manager_snmp_conf/5,
- write_manager_snmp_users_conf/2,
+ write_manager_snmp_conf/4, write_manager_snmp_conf/5,
+ write_manager_snmp_users_conf/2,
write_manager_snmp_agents_conf/2,
write_manager_snmp_usm_conf/2
@@ -90,9 +96,9 @@
]).
--export_type([void/0,
- verify_config_entry_function/0,
- verify_config_function/0,
+-export_type([void/0,
+ order_config_entry_function/0,
+ check_config_entry_function/0,
write_config_function/0]).
@@ -233,114 +239,124 @@ config_agent_sys() ->
fun verify_verbosity/1),
DbDir = ask("5. Database directory (absolute path)?", DefDir,
fun verify_dir/1),
- MibStorageType = ask("6. Mib storage type (ets/dets/mnesia)?", "ets",
+ DbInitError = ask("6. How to handle DB init error?",
+ "terminate", fun verify_db_init_error/1),
+ MibStorageType = ask("7. Mib storage type (ets/dets/mnesia)?", "ets",
fun verify_mib_storage_type/1),
MibStorage =
case MibStorageType of
ets ->
- ets;
+ [{module, snmpa_mib_storage_ets}];
dets ->
- DetsDir = ask("6b. Mib storage directory (absolute path)?",
+ DetsDir = ask("7b. Mib storage directory (absolute path)?",
DbDir, fun verify_dir/1),
- DetsAction = ask("6c. Mib storage [dets] database start "
+ DetsAction = ask("7c. Mib storage [dets] database start "
"action "
"(default/clear/keep)?",
"default", fun verify_mib_storage_action/1),
case DetsAction of
default ->
- {dets, DetsDir};
+ [{module, snmpa_mib_storage_dets},
+ {options, [{dir, DetsDir}]}];
_ ->
- {dets, DetsDir, DetsAction}
+ [{module, snmpa_mib_storage_dets},
+ {options, [{dir, DetsDir},
+ {action, DetsAction}]}]
end;
mnesia ->
-% Nodes = ask("Mib storage nodes?", "none",
-% fun verify_mib_storage_nodes/1),
Nodes = [],
- MnesiaAction = ask("6b. Mib storage [mnesia] database start "
+ MnesiaAction = ask("7b. Mib storage [mnesia] database start "
"action "
"(default/clear/keep)?",
"default", fun verify_mib_storage_action/1),
case MnesiaAction of
default ->
- {mnesia, Nodes};
+ [{module, snmpa_mib_storage_mnesia},
+ {options, [{nodes, Nodes}]}];
_ ->
- {mnesia, Nodes, MnesiaAction}
+ [{module, snmpa_mib_storage_mnesia},
+ {options, [{nodes, Nodes},
+ {action, MnesiaAction}]}]
end
end,
- TargetCacheVerb = ask("7. Target cache verbosity "
+
+ %% Here we should ask about mib-server data module,
+ %% but as we only have one at the moment...
+
+ TargetCacheVerb = ask("8. Target cache verbosity "
"(silence/info/log/debug/trace)?", "silence",
fun verify_verbosity/1),
- SymStoreVerb = ask("8. Symbolic store verbosity "
+ SymStoreVerb = ask("9. Symbolic store verbosity "
"(silence/info/log/debug/trace)?", "silence",
fun verify_verbosity/1),
- LocalDbVerb = ask("9. Local DB verbosity "
+ LocalDbVerb = ask("10. Local DB verbosity "
"(silence/info/log/debug/trace)?", "silence",
fun verify_verbosity/1),
- LocalDbRepair = ask("10. Local DB repair (true/false/force)?", "true",
+ LocalDbRepair = ask("11. Local DB repair (true/false/force)?", "true",
fun verify_dets_repair/1),
- LocalDbAutoSave = ask("11. Local DB auto save (infinity/milli seconds)?",
+ LocalDbAutoSave = ask("12. Local DB auto save (infinity/milli seconds)?",
"5000", fun verify_dets_auto_save/1),
- ErrorMod = ask("12. Error report module?", "snmpa_error_logger", fun verify_module/1),
- Type = ask("13. Agent type (master/sub)?", "master",
+ ErrorMod = ask("13. Error report module?", "snmpa_error_logger", fun verify_module/1),
+ Type = ask("14. Agent type (master/sub)?", "master",
fun verify_agent_type/1),
AgentConfig =
case Type of
master ->
- MasterAgentVerb = ask("14. Master-agent verbosity "
+ MasterAgentVerb = ask("15. Master-agent verbosity "
"(silence/info/log/debug/trace)?",
"silence",
fun verify_verbosity/1),
- ForceLoad = ask("15. Shall the agent re-read the "
+ ForceLoad = ask("16. Shall the agent re-read the "
"configuration files during startup ~n"
" (and ignore the configuration "
"database) (true/false)?", "true",
fun verify_bool/1),
- MultiThreaded = ask("16. Multi threaded agent (true/false)?",
+ MultiThreaded = ask("17. Multi threaded agent (true/false)?",
"false",
fun verify_bool/1),
- MeOverride = ask("17. Check for duplicate mib entries when "
+ MeOverride = ask("18. Check for duplicate mib entries when "
"installing a mib (true/false)?", "false",
fun verify_bool/1),
- TrapOverride = ask("18. Check for duplicate trap names when "
+ TrapOverride = ask("19. Check for duplicate trap names when "
"installing a mib (true/false)?", "false",
fun verify_bool/1),
- MibServerVerb = ask("19. Mib server verbosity "
+ MibServerVerb = ask("20. Mib server verbosity "
"(silence/info/log/debug/trace)?",
"silence",
fun verify_verbosity/1),
- MibServerCache = ask("20. Mib server cache "
+ MibServerCache = ask("21. Mib server cache "
"(true/false)?",
"true",
fun verify_bool/1),
- NoteStoreVerb = ask("21. Note store verbosity "
+ NoteStoreVerb = ask("22. Note store verbosity "
"(silence/info/log/debug/trace)?",
"silence",
fun verify_verbosity/1),
- NoteStoreTimeout = ask("22. Note store GC timeout?", "30000",
+ NoteStoreTimeout = ask("23. Note store GC timeout?", "30000",
fun verify_timeout/1),
ATL =
- case ask("23. Shall the agent use an audit trail log "
+ case ask("24. Shall the agent use an audit trail log "
"(y/n)?",
"n", fun verify_yes_or_no/1) of
yes ->
- ATLType = ask("23b. Audit trail log type "
+ ATLType = ask("24b. Audit trail log type "
"(write/read_write)?",
"read_write", fun verify_atl_type/1),
- ATLDir = ask("23c. Where to store the "
+ ATLDir = ask("24c. Where to store the "
"audit trail log?",
DefDir, fun verify_dir/1),
- ATLMaxFiles = ask("23d. Max number of files?",
+ ATLMaxFiles = ask("24d. Max number of files?",
"10",
fun verify_pos_integer/1),
- ATLMaxBytes = ask("23e. Max size (in bytes) "
+ ATLMaxBytes = ask("24e. Max size (in bytes) "
"of each file?",
"10240",
fun verify_pos_integer/1),
ATLSize = {ATLMaxBytes, ATLMaxFiles},
- ATLRepair = ask("23f. Audit trail log repair "
+ ATLRepair = ask("24f. Audit trail log repair "
"(true/false/truncate/snmp_repair)?", "true",
fun verify_atl_repair/1),
- ATLSeqNo = ask("23g. Audit trail log "
+ ATLSeqNo = ask("24g. Audit trail log "
"sequence-numbering (true/false)?",
"false",
fun verify_atl_seqno/1),
@@ -352,33 +368,33 @@ config_agent_sys() ->
no ->
[]
end,
- NetIfVerb = ask("24. Network interface verbosity "
+ NetIfVerb = ask("25. Network interface verbosity "
"(silence/info/log/debug/trace)?",
"silence",
fun verify_verbosity/1),
- NetIfMod = ask("25. Which network interface module shall be used?",
+ NetIfMod = ask("26. Which network interface module shall be used?",
"snmpa_net_if", fun verify_module/1),
NetIfOpts =
case NetIfMod of
snmpa_net_if ->
NetIfBindTo =
- ask("25a. Bind the agent IP address "
+ ask("26a. Bind the agent IP address "
"(true/false)?",
"false", fun verify_bool/1),
NetIfNoReuse =
- ask("25b. Shall the agents "
+ ask("26b. Shall the agents "
"IP address "
"and port be not reusable "
"(true/false)?",
"false", fun verify_bool/1),
NetIfReqLimit =
- ask("25c. Agent request limit "
+ ask("26c. Agent request limit "
"(used for flow control) "
"(infinity/pos integer)?",
"infinity",
fun verify_netif_req_limit/1),
NetIfRecbuf =
- case ask("25d. Receive buffer size of the "
+ case ask("26d. Receive buffer size of the "
"agent (in bytes) "
"(default/pos integer)?",
"default",
@@ -389,7 +405,7 @@ config_agent_sys() ->
[{recbuf, RecBufSz}]
end,
NetIfSndbuf =
- case ask("25e. Send buffer size of the agent "
+ case ask("26e. Send buffer size of the agent "
"(in bytes) (default/pos integer)?",
"default",
fun verify_netif_sndbuf/1) of
@@ -399,7 +415,7 @@ config_agent_sys() ->
[{sndbuf, SndBufSz}]
end,
NetIfFilter =
- case ask("25f. Do you wish to specify a "
+ case ask("26f. Do you wish to specify a "
"network interface filter module "
"(or use default)",
"default", fun verify_module/1) of
@@ -418,18 +434,18 @@ config_agent_sys() ->
NetIf = [{module, NetIfMod},
{verbosity, NetIfVerb},
{options, NetIfOpts}],
- TermDiscoEnable = ask("26a. Allow terminating discovery "
+ TermDiscoEnable = ask("27. Allow terminating discovery "
"(true/false)?", "true",
fun verify_bool/1),
TermDiscoConf =
case TermDiscoEnable of
true ->
TermDiscoStage2 =
- ask("26b. Second stage behaviour "
+ ask("27a. Second stage behaviour "
"(discovery/plain)?", "discovery",
fun verify_term_disco_behaviour/1),
TermDiscoTrigger =
- ask("26c. Trigger username "
+ ask("27b. Trigger username "
"(default/a string)?", "default",
fun verify_term_disco_trigger_username/1),
[{enable, TermDiscoEnable},
@@ -440,7 +456,7 @@ config_agent_sys() ->
{stage2, discovery},
{trigger_username, ""}]
end,
- OrigDiscoEnable = ask("27a. Allow originating discovery "
+ OrigDiscoEnable = ask("28. Allow originating discovery "
"(true/false)?", "true",
fun verify_bool/1),
OrigDiscoConf =
@@ -463,7 +479,7 @@ config_agent_sys() ->
{verbosity, NoteStoreVerb}]},
{net_if, NetIf}] ++ ATL;
sub ->
- SubAgentVerb = ask("14. Sub-agent verbosity "
+ SubAgentVerb = ask("15. Sub-agent verbosity "
"(silence/info/log/debug/trace)?",
"silence",
fun verify_verbosity/1),
@@ -472,11 +488,12 @@ config_agent_sys() ->
{config, [{dir, ConfigDir}]}]
end,
SysConfig =
- [{priority, Prio},
- {versions, Vsns},
- {db_dir, DbDir},
- {mib_storage, MibStorage},
- {target_cache, [{verbosity, TargetCacheVerb}]},
+ [{priority, Prio},
+ {versions, Vsns},
+ {db_dir, DbDir},
+ {db_init_error, DbInitError},
+ {mib_storage, MibStorage},
+ {target_cache, [{verbosity, TargetCacheVerb}]},
{symbolic_store, [{verbosity, SymStoreVerb}]},
{local_db, [{repair, LocalDbRepair},
{auto_save, LocalDbAutoSave},
@@ -556,11 +573,9 @@ config_agent_snmp(Dir, Vsns) ->
end,
NT
end,
- case (catch write_agent_snmp_files(Dir,
- Vsns, ManagerIP, TrapUdp,
- AgentIP, AgentUDP,
- SysName, NotifType, SecType,
- Passwd, EngineID, MMS)) of
+ case (catch write_agent_snmp_files(
+ Dir, Vsns, ManagerIP, TrapUdp, AgentIP, AgentUDP, SysName,
+ NotifType, SecType, Passwd, EngineID, MMS)) of
ok ->
i("~n- - - - - - - - - - - - -"),
i("Info: 1. SecurityName \"initial\" has noAuthNoPriv read access~n"
@@ -622,19 +637,21 @@ config_manager_sys() ->
fun verify_verbosity/1),
ConfigDbDir = ask("5. Database directory (absolute path)?",
DefDir, fun verify_dir/1),
- ConfigDbRepair = ask("6. Database repair "
+ ConfigDbInitError = ask("6. How to handle DB init error?",
+ "terminate", fun verify_db_init_error/1),
+ ConfigDbRepair = ask("7. Database repair "
"(true/false/force)?", "true",
fun verify_dets_repair/1),
- ConfigDbAutoSave = ask("7. Database auto save "
+ ConfigDbAutoSave = ask("8. Database auto save "
"(infinity/milli seconds)?",
"5000", fun verify_dets_auto_save/1),
IRB =
- case ask("8. Inform request behaviour (auto/user)?",
+ case ask("9. Inform request behaviour (auto/user)?",
"auto", fun verify_irb/1) of
auto ->
auto;
user ->
- case ask("8b. Use default GC timeout"
+ case ask("9b. Use default GC timeout"
"(default/seconds)?",
"default", fun verify_irb_user/1) of
default ->
@@ -643,31 +660,31 @@ config_manager_sys() ->
{user, IrbGcTo}
end
end,
- ServerVerb = ask("9. Server verbosity "
+ ServerVerb = ask("10. Server verbosity "
"(silence/info/log/debug/trace)?",
"silence",
fun verify_verbosity/1),
- ServerTimeout = ask("10. Server GC timeout?", "30000",
+ ServerTimeout = ask("11. Server GC timeout?", "30000",
fun verify_timeout/1),
- NoteStoreVerb = ask("11. Note store verbosity "
+ NoteStoreVerb = ask("12. Note store verbosity "
"(silence/info/log/debug/trace)?",
"silence",
fun verify_verbosity/1),
- NoteStoreTimeout = ask("12. Note store GC timeout?", "30000",
+ NoteStoreTimeout = ask("13. Note store GC timeout?", "30000",
fun verify_timeout/1),
- NetIfMod = ask("13. Which network interface module shall be used?",
+ NetIfMod = ask("14. Which network interface module shall be used?",
"snmpm_net_if", fun verify_module/1),
- NetIfVerb = ask("14. Network interface verbosity "
+ NetIfVerb = ask("15. Network interface verbosity "
"(silence/info/log/debug/trace)?", "silence",
fun verify_verbosity/1),
- NetIfBindTo = ask("15. Bind the manager IP address "
+ NetIfBindTo = ask("16. Bind the manager IP address "
"(true/false)?",
"false", fun verify_bool/1),
- NetIfNoReuse = ask("16. Shall the manager IP address and port "
+ NetIfNoReuse = ask("17. Shall the manager IP address and port "
"be not reusable (true/false)?",
"false", fun verify_bool/1),
NetIfRecbuf =
- case ask("17. Receive buffer size of the manager (in bytes) "
+ case ask("18. Receive buffer size of the manager (in bytes) "
"(default/pos integer)?", "default",
fun verify_netif_recbuf/1) of
default ->
@@ -676,7 +693,7 @@ config_manager_sys() ->
[{recbuf, RecBufSz}]
end,
NetIfSndbuf =
- case ask("18. Send buffer size of the manager (in bytes) "
+ case ask("19. Send buffer size of the manager (in bytes) "
"(default/pos integer)?", "default",
fun verify_netif_sndbuf/1) of
default ->
@@ -692,28 +709,28 @@ config_manager_sys() ->
{verbosity, NetIfVerb},
{options, NetIfOpts}],
ATL =
- case ask("19. Shall the manager use an audit trail log "
+ case ask("20. Shall the manager use an audit trail log "
"(y/n)?",
"n", fun verify_yes_or_no/1) of
yes ->
- ATLType = ask("19b. Audit trail log type "
+ ATLType = ask("20b. Audit trail log type "
"(write/read_write)?",
"read_write", fun verify_atl_type/1),
- ATLDir = ask("19c. Where to store the "
+ ATLDir = ask("20c. Where to store the "
"audit trail log?",
DefDir, fun verify_dir/1),
- ATLMaxFiles = ask("19d. Max number of files?",
+ ATLMaxFiles = ask("20d. Max number of files?",
"10",
fun verify_pos_integer/1),
- ATLMaxBytes = ask("19e. Max size (in bytes) "
+ ATLMaxBytes = ask("20e. Max size (in bytes) "
"of each file?",
"10240",
fun verify_pos_integer/1),
ATLSize = {ATLMaxBytes, ATLMaxFiles},
- ATLRepair = ask("19f. Audit trail log repair "
+ ATLRepair = ask("20f. Audit trail log repair "
"(true/false/truncate/snmp_repair)?", "true",
fun verify_atl_repair/1),
- ATLSeqNo = ask("19g. Audit trail log sequence-numbering "
+ ATLSeqNo = ask("20g. Audit trail log sequence-numbering "
"(true/false)?", "false",
fun verify_atl_seqno/1),
[{audit_trail_log, [{type, ATLType},
@@ -725,14 +742,14 @@ config_manager_sys() ->
[]
end,
DefUser =
- case ask("20. Do you wish to assign a default user [yes] or use~n"
+ case ask("21. Do you wish to assign a default user [yes] or use~n"
" the default settings [no] (y/n)?", "n",
fun verify_yes_or_no/1) of
yes ->
- DefUserMod = ask("20b. Default user module?",
+ DefUserMod = ask("21b. Default user module?",
"snmpm_user_default",
fun verify_module/1),
- DefUserData = ask("20c. Default user data?", "undefined",
+ DefUserData = ask("21c. Default user data?", "undefined",
fun verify_user_data/1),
[{def_user_mod, DefUserMod},
{def_user_data, DefUserData}];
@@ -742,11 +759,12 @@ config_manager_sys() ->
SysConfig =
[{priority, Prio},
{versions, Vsns},
- {config, [{dir, ConfigDir},
- {verbosity, ConfigVerb},
- {db_dir, ConfigDbDir},
- {repair, ConfigDbRepair},
- {auto_save, ConfigDbAutoSave}]},
+ {config, [{dir, ConfigDir},
+ {db_dir, ConfigDbDir},
+ {db_init_error, ConfigDbInitError},
+ {repair, ConfigDbRepair},
+ {auto_save, ConfigDbAutoSave},
+ {verbosity, ConfigVerb}]},
{inform_request_behaviour, IRB},
{mibs, []},
{server, [{timeout, ServerTimeout},
@@ -1061,6 +1079,16 @@ verify_dir(Dir) ->
_E ->
{error, "invalid directory (not absolute): " ++ Dir}
end.
+
+
+verify_db_init_error("terminate") ->
+ {ok, true};
+verify_db_init_error("create") ->
+ {ok, create};
+verify_db_init_error("create_db_and_dir") ->
+ {ok, create_db_and_dir};
+verify_db_init_error(R) ->
+ {error, "invalid DB init error: " ++ R}.
verify_notif_type("trap") -> {ok, trap};
@@ -1156,13 +1184,20 @@ verify_dets_auto_save(I0) ->
%% I know that this is a little of the edge, but...
+verify_module(M) when is_atom(M) ->
+ {ok, M};
+verify_module(M0) when is_list(M0) ->
+ {ok, list_to_atom(M0)};
verify_module(M0) ->
- case (catch list_to_atom(M0)) of
- M when is_atom(M) ->
- {ok, M};
- _ ->
- {error, "invalid module: " ++ M0}
- end.
+ {error, lists:flatten(io_lib:format("invalid module: ~p", [M0]))}.
+
+%% verify_module(M0) ->
+%% case (catch list_to_atom(M0)) of
+%% M when is_atom(M) ->
+%% {ok, M};
+%% _ ->
+%% {error, "invalid module: " ++ M0}
+%% end.
verify_agent_type("master") ->
@@ -1549,35 +1584,63 @@ remove_newline(Str) ->
%% File generation
%%======================================================================
+write_agent_snmp_files(
+ Dir, Vsns, Domain, ManagerAddr, AgentAddr, SysName)
+ when is_list(Dir),
+ is_list(Vsns),
+ is_atom(Domain),
+ is_list(SysName) ->
+ write_agent_snmp_files(
+ Dir, Vsns, Domain, ManagerAddr, AgentAddr, SysName,
+ trap, none, "", "agentEngine", 484).
+
%%----------------------------------------------------------------------
%% Dir: string() (ex: "../conf/")
%% ManagerIP, AgentIP: [int(),int(),int(),int()]
%% TrapUdp, AgentUDP: integer()
%% SysName: string()
%%----------------------------------------------------------------------
-write_agent_snmp_files(Dir, Vsns, ManagerIP, TrapUdp,
- AgentIP, AgentUDP, SysName)
- when is_list(Dir) andalso
- is_list(Vsns) andalso
- is_list(ManagerIP) andalso
- is_integer(TrapUdp) andalso
- is_list(AgentIP) andalso
- is_integer(AgentUDP) andalso
+write_agent_snmp_files(
+ Dir, Vsns, ManagerIP, TrapUDP, AgentIP, AgentUDP, SysName)
+ when is_list(Dir) andalso
+ is_list(Vsns) andalso
+ is_list(ManagerIP) andalso
+ is_integer(TrapUDP) andalso
+ is_list(AgentIP) andalso
+ is_integer(AgentUDP) andalso
is_list(SysName) ->
- write_agent_snmp_files(Dir, Vsns, ManagerIP, TrapUdp, AgentIP, AgentUDP,
- SysName, "trap", none, "", "agentEngine", 484).
+ write_agent_snmp_files(
+ Dir, Vsns, ManagerIP, TrapUDP, AgentIP, AgentUDP, SysName,
+ trap, none, "", "agentEngine", 484).
%%
%% ----- Agent config files generator functions -----
%%
-write_agent_snmp_files(Dir, Vsns, ManagerIP, TrapUdp, AgentIP, AgentUDP,
- SysName, NotifType, SecType, Passwd, EngineID, MMS) ->
+write_agent_snmp_files(
+ Dir, Vsns, Domain, ManagerAddr, AgentAddr, SysName,
+ NotifType, SecType, Passwd, EngineID, MMS) ->
+ write_agent_snmp_conf(Dir, Domain, AgentAddr, EngineID, MMS),
+ write_agent_snmp_context_conf(Dir),
+ write_agent_snmp_community_conf(Dir),
+ write_agent_snmp_standard_conf(Dir, SysName),
+ write_agent_snmp_target_addr_conf(Dir, Domain, ManagerAddr, Vsns),
+ write_agent_snmp_target_params_conf(Dir, Vsns),
+ write_agent_snmp_notify_conf(Dir, NotifType),
+ write_agent_snmp_usm_conf(Dir, Vsns, EngineID, SecType, Passwd),
+ write_agent_snmp_vacm_conf(Dir, Vsns, SecType),
+ ok.
+
+write_agent_snmp_files(
+ Dir, Vsns, ManagerIP, TrapUDP, AgentIP, AgentUDP, SysName,
+ NotifType, SecType, Passwd, EngineID, MMS) ->
+ Domain = snmp_target_mib:default_domain(),
+ ManagerAddr = {ManagerIP, TrapUDP},
write_agent_snmp_conf(Dir, AgentIP, AgentUDP, EngineID, MMS),
write_agent_snmp_context_conf(Dir),
write_agent_snmp_community_conf(Dir),
write_agent_snmp_standard_conf(Dir, SysName),
- write_agent_snmp_target_addr_conf(Dir, ManagerIP, TrapUdp, Vsns),
+ write_agent_snmp_target_addr_conf(Dir, Domain, ManagerAddr, Vsns),
write_agent_snmp_target_params_conf(Dir, Vsns),
write_agent_snmp_notify_conf(Dir, NotifType),
write_agent_snmp_usm_conf(Dir, Vsns, EngineID, SecType, Passwd),
@@ -1585,11 +1648,40 @@ write_agent_snmp_files(Dir, Vsns, ManagerIP, TrapUdp, AgentIP, AgentUDP,
ok.
+
%%
%% ------ [agent] agent.conf ------
%%
-write_agent_snmp_conf(Dir, AgentIP, AgentUDP, EngineID, MMS) ->
+write_agent_snmp_conf(Dir, Transports, EngineID, MMS) ->
+ Conf =
+ [{intAgentTransports, Transports},
+ {snmpEngineID, EngineID},
+ {snmpEngineMaxMessageSize, MMS}],
+ do_write_agent_snmp_conf(Dir, Conf).
+
+write_agent_snmp_conf(Dir, Domain, AgentAddr, EngineID, MMS)
+ when is_atom(Domain) ->
+ {AgentIP, AgentUDP} = AgentAddr,
+ Conf =
+ [{intAgentTransportDomain, Domain},
+ {intAgentUDPPort, AgentUDP},
+ {intAgentIpAddress, AgentIP},
+ {snmpEngineID, EngineID},
+ {snmpEngineMaxMessageSize, MMS}],
+ do_write_agent_snmp_conf(Dir, Conf);
+write_agent_snmp_conf(Dir, AgentIP, AgentUDP, EngineID, MMS)
+ when is_integer(AgentUDP) ->
+ Conf =
+ [{intAgentUDPPort, AgentUDP},
+ {intAgentIpAddress, AgentIP},
+ {snmpEngineID, EngineID},
+ {snmpEngineMaxMessageSize, MMS}],
+ do_write_agent_snmp_conf(Dir, Conf);
+write_agent_snmp_conf(_Dir, Domain, AgentAddr, _EngineID, _MMS) ->
+ error({bad_address, {Domain, AgentAddr}}).
+
+do_write_agent_snmp_conf(Dir, Conf) ->
Comment =
"%% This file defines the Agent local configuration info\n"
"%% The data is inserted into the snmpEngine* variables defined\n"
@@ -1604,11 +1696,7 @@ write_agent_snmp_conf(Dir, AgentIP, AgentUDP, EngineID, MMS) ->
"%% {snmpEngineID, \"agentEngine\"}.\n"
"%% {snmpEngineMaxMessageSize, 484}.\n"
"%%\n\n",
- Hdr = header() ++ Comment,
- Conf = [{intAgentUDPPort, AgentUDP},
- {intAgentIpAddress, AgentIP},
- {snmpEngineID, EngineID},
- {snmpEngineMaxMessageSize, MMS}],
+ Hdr = header() ++ Comment,
write_agent_config(Dir, Hdr, Conf).
write_agent_config(Dir, Hdr, Conf) ->
@@ -1714,17 +1802,19 @@ update_agent_standard_config(Dir, Conf) ->
%% ------ target_addr.conf ------
%%
-write_agent_snmp_target_addr_conf(Dir, ManagerIp, UDP, Vsns) ->
- Timeout = 1500,
- RetryCount = 3,
- write_agent_snmp_target_addr_conf(Dir, ManagerIp, UDP,
- Timeout, RetryCount,
- Vsns).
+write_agent_snmp_target_addr_conf(Dir, Addresses, Vsns) ->
+ Timeout = 1500,
+ RetryCount = 3,
+ write_agent_snmp_target_addr_conf(
+ Dir, Addresses, Timeout, RetryCount, Vsns).
-write_agent_snmp_target_addr_conf(Dir, ManagerIp, UDP,
- Timeout, RetryCount,
- Vsns) ->
- Comment =
+write_agent_snmp_target_addr_conf(Dir, Domain_or_Ip, Addr_or_Port, Vsns) ->
+ Addresses = [{Domain_or_Ip, Addr_or_Port}],
+ write_agent_snmp_target_addr_conf(Dir, Addresses, Vsns).
+
+write_agent_snmp_target_addr_conf(
+ Dir, Addresses, Timeout, RetryCount, Vsns) ->
+ Comment =
"%% This file defines the target address parameters.\n"
"%% The data is inserted into the snmpTargetAddrTable defined\n"
"%% in SNMP-TARGET-MIB, and in the snmpTargetAddrExtTable defined\n"
@@ -1743,36 +1833,59 @@ write_agent_snmp_target_addr_conf(Dir, ManagerIp, UDP,
"%% [127,0,0,0], 2048}.\n"
"%%\n\n",
Hdr = header() ++ Comment,
- F = fun(v1 = Vsn, Acc) ->
- [{mk_ip(ManagerIp, Vsn),
- snmp_target_mib:default_domain(),
- ManagerIp, UDP, Timeout, RetryCount,
- "std_trap", mk_param(Vsn), "", [], 2048}| Acc];
- (v2 = Vsn, Acc) ->
- [{mk_ip(ManagerIp, Vsn),
- snmp_target_mib:default_domain(),
- ManagerIp, UDP, Timeout, RetryCount,
- "std_trap", mk_param(Vsn), "", [], 2048},
- {lists:flatten(io_lib:format("~s.2",[mk_ip(ManagerIp, Vsn)])),
- ManagerIp, UDP, Timeout, RetryCount,
- "std_inform", mk_param(Vsn), "", [], 2048}| Acc];
- (v3 = Vsn, Acc) ->
- [{mk_ip(ManagerIp, Vsn),
- snmp_target_mib:default_domain(),
- ManagerIp, UDP, Timeout, RetryCount,
- "std_trap", mk_param(Vsn), "", [], 2048},
- {lists:flatten(io_lib:format("~s.3",[mk_ip(ManagerIp, Vsn)])),
- ManagerIp, UDP, Timeout, RetryCount,
- "std_inform", mk_param(Vsn), "mgrEngine", [], 2048}| Acc]
- end,
- Conf = lists:foldl(F, [], Vsns),
+ Conf =
+ lists:foldl(
+ fun ({Domain_or_Ip, Addr_or_Port} = Address, OuterAcc) ->
+ lists:foldl(
+ fun(v1 = Vsn, Acc) ->
+ [{mk_name(Address, Vsn),
+ Domain_or_Ip, Addr_or_Port,
+ Timeout, RetryCount,
+ "std_trap", mk_param(Vsn), "",
+ [], 2048}| Acc];
+ (v2 = Vsn, Acc) ->
+ [{mk_name(Address, Vsn),
+ Domain_or_Ip, Addr_or_Port,
+ Timeout, RetryCount,
+ "std_trap", mk_param(Vsn), "",
+ [], 2048},
+ {lists:flatten(
+ io_lib:format(
+ "~s.2", [mk_name(Address, Vsn)])),
+ Domain_or_Ip, Addr_or_Port,
+ Timeout, RetryCount,
+ "std_inform", mk_param(Vsn), "",
+ [], 2048}| Acc];
+ (v3 = Vsn, Acc) ->
+ [{mk_name(Address, Vsn),
+ Domain_or_Ip, Addr_or_Port,
+ Timeout, RetryCount,
+ "std_trap", mk_param(Vsn), "",
+ [], 2048},
+ {lists:flatten(
+ io_lib:format(
+ "~s.3", [mk_name(Address, Vsn)])),
+ Domain_or_Ip, Addr_or_Port,
+ Timeout, RetryCount,
+ "std_inform", mk_param(Vsn), "mgrEngine",
+ [], 2048} | Acc]
+ end, OuterAcc, Vsns)
+ end, [], Addresses),
write_agent_target_addr_config(Dir, Hdr, Conf).
+write_agent_snmp_target_addr_conf(
+ Dir, Domain_or_Ip, Addr_or_Port, Timeout, RetryCount, Vsns) ->
+ Addresses = [{Domain_or_Ip, Addr_or_Port}],
+ write_agent_snmp_target_addr_conf(
+ Dir, Addresses, Timeout, RetryCount, Vsns).
+
mk_param(Vsn) ->
lists:flatten(io_lib:format("target_~w", [Vsn])).
-mk_ip([A,B,C,D], Vsn) ->
- lists:flatten(io_lib:format("~w.~w.~w.~w ~w", [A,B,C,D,Vsn])).
+mk_name(Address, Vsn) ->
+ lists:flatten(
+ io_lib:format(
+ "~s ~w", [snmp_conf:mk_addr_string(Address), Vsn])).
write_agent_target_addr_config(Dir, Hdr, Conf) ->
snmpa_conf:write_target_addr_config(Dir, Hdr, Conf).
@@ -2006,7 +2119,24 @@ write_manager_snmp_files(Dir, IP, Port, MMS, EngineID,
%% ------ manager.conf ------
%%
-write_manager_snmp_conf(Dir, IP, Port, MMS, EngineID) ->
+write_manager_snmp_conf(Dir, Transports, MMS, EngineID) ->
+ Comment =
+"%% This file defines the Manager local configuration info\n"
+"%% Each row is a 2-tuple:\n"
+"%% {Variable, Value}.\n"
+"%% For example\n"
+"%% {transports, [{transportDomainUdpIpv4, {{127,42,17,5}, 5000}}]}.\n"
+"%% {engine_id, \"managerEngine\"}.\n"
+"%% {max_message_size, 484}.\n"
+"%%\n\n",
+ Hdr = header() ++ Comment,
+ Conf =
+ [{transports, Transports},
+ {engine_id, EngineID},
+ {max_message_size, MMS}],
+ write_manager_config(Dir, Hdr, Conf).
+
+write_manager_snmp_conf(Dir, Domain_or_IP, Addr_or_Port, MMS, EngineID) ->
Comment =
"%% This file defines the Manager local configuration info\n"
"%% Each row is a 2-tuple:\n"
@@ -2018,10 +2148,20 @@ write_manager_snmp_conf(Dir, IP, Port, MMS, EngineID) ->
"%% {max_message_size, 484}.\n"
"%%\n\n",
Hdr = header() ++ Comment,
- Conf = [{port, Port},
- {address, IP},
- {engine_id, EngineID},
- {max_message_size, MMS}],
+ Conf =
+ case Addr_or_Port of
+ {IP, Port} when is_integer(Port), is_atom(Domain_or_IP) ->
+ [{domain, Domain_or_IP},
+ {port, Port},
+ {address, IP}];
+ _ when is_integer(Addr_or_Port) ->
+ [{port, Addr_or_Port},
+ {address, Domain_or_IP}];
+ _ ->
+ error({bad_address, {Domain_or_IP, Addr_or_Port}})
+ end ++
+ [{engine_id, EngineID},
+ {max_message_size, MMS}],
write_manager_config(Dir, Hdr, Conf).
write_manager_config(Dir, Hdr, Conf) ->
@@ -2160,6 +2300,8 @@ write_sys_config_file_agent_opt(Fid, {config, Opts}) ->
ok = io:format(Fid, "}", []);
write_sys_config_file_agent_opt(Fid, {db_dir, Dir}) ->
ok = io:format(Fid, " {db_dir, \"~s\"}", [Dir]);
+write_sys_config_file_agent_opt(Fid, {db_init_error, Action}) ->
+ ok = io:format(Fid, " {db_init_error, ~w}", [Action]);
write_sys_config_file_agent_opt(Fid, {mib_storage, ets}) ->
ok = io:format(Fid, " {mib_storage, ets}", []);
write_sys_config_file_agent_opt(Fid, {mib_storage, {dets, Dir}}) ->
@@ -2336,6 +2478,8 @@ write_sys_config_file_manager_config_opt(Fid, {dir, Dir}) ->
ok = io:format(Fid, "{dir, \"~s\"}", [Dir]);
write_sys_config_file_manager_config_opt(Fid, {db_dir, Dir}) ->
ok = io:format(Fid, "{db_dir, \"~s\"}", [Dir]);
+write_sys_config_file_manager_config_opt(Fid, {db_init_error, Action}) ->
+ ok = io:format(Fid, "{db_init_error, ~w}", [Action]);
write_sys_config_file_manager_config_opt(Fid, {repair, Rep}) ->
ok = io:format(Fid, "{repair, ~w}", [Rep]);
write_sys_config_file_manager_config_opt(Fid, {auto_save, As}) ->
@@ -2375,83 +2519,92 @@ header() ->
[?MODULE, ?version, Y, Mo, D, H, Mi, S]).
-%% *If* these functions are successfull, they successfully return anything
-%% (which is ignored), but they fail with either a throw or an exit or
-%% something similar.
-
-%% Verification of one config entry read from a file
--type(verify_config_entry_function() ::
- fun((Entry :: term()) -> ok | {error, Reason :: term()})).
-
-%% Verification of config to be written
--type(verify_config_function() ::
- fun(() -> void())).
-
-%% Write config to file (as defined by Fd)
--type(write_config_function() ::
- fun((Fd :: file:io_device()) -> void())).
-
--spec write_config_file(Dir :: string(),
- FileName :: string(),
- Verify :: verify_config_function(),
- Write :: write_config_function()) ->
- ok | {error, Reason :: term()}.
-
-write_config_file(Dir, FileName, Verify, Write)
- when (is_list(Dir) andalso
- is_list(FileName) andalso
- is_function(Verify) andalso
- is_function(Write)) ->
+%% *If* these functions are successfull, they successfully return
+%% (value is ignored), but they fail preferably with
+%% throw({error, Reason}). Other exceptions are also handled.
+
+%% Sorting order for config entries (see lists:sort/2)
+-type(order_config_entry_function() ::
+ fun((term(), term()) -> boolean())).
+
+%% Check of config entries. Initial State is 'undefined'
+-type(check_config_entry_function() ::
+ fun((Entry :: term(), State :: undefined | term()) ->
+ {ok | {ok, NewEntry :: term()}, NewState :: term()})).
+
+%% Write configuration entries to file descriptor Fd
+-type(write_config_function() ::
+ fun((Fd :: file:io_device(), [Entry :: term()]) -> ok)).
+
+-spec write_config_file(
+ Dir :: string(),
+ FileName :: string(),
+ Order :: order_config_entry_function(),
+ Check :: check_config_entry_function(),
+ Write :: write_config_function(),
+ Entries :: [term()]) ->
+ ok | {error, term()}.
+
+write_config_file(Dir, FileName, Order, Check, Write, Entries)
+ when is_list(Dir), is_list(FileName),
+ is_function(Order), is_function(Check), is_function(Write),
+ is_list(Entries) ->
try
- begin
- do_write_config_file(Dir, FileName, Verify, Write)
- end
+ SortedEntries = lists:sort(Order, Entries),
+ _ =
+ lists:foldl(
+ fun (Entry, State) ->
+ case Check(Entry, State) of
+ {Ok, NewState} when is_list(Ok) ->
+ NewState;
+ {ok, NewState} ->
+ NewState;
+ {{ok, _}, NewState} ->
+ NewState
+ end
+ end, undefined, SortedEntries),
+ ok
+ of
+ _ ->
+ case file:open(filename:join(Dir, FileName), [write]) of
+ {ok, Fd} ->
+ write_config_file(Dir, FileName, Write, Entries, Fd);
+ Error ->
+ Error
+ end
catch
- throw:Error ->
- Error;
- T:E ->
- {error, {failed_write, Dir, FileName, T, E}}
- end.
-
-
-do_write_config_file(Dir, FileName, Verify, Write) ->
- Verify(),
- case file:open(filename:join(Dir, FileName), [write]) of
- {ok, Fd} ->
- file_write_and_close(Write, Fd, Dir, FileName);
Error ->
- Error
- end.
-
-append_config_file(Dir, FileName, Verify, Write)
- when (is_list(Dir) andalso
- is_list(FileName) andalso
- is_function(Verify) andalso
- is_function(Write)) ->
- try
- begin
- do_append_config_file(Dir, FileName, Verify, Write)
- end
- catch
- throw:Error ->
+ S = erlang:get_stacktrace(),
+ d("File write of ~s throwed: ~p~n ~p~n",
+ [FileName, Error, S]),
Error;
- T:E ->
- {error, {failed_append, Dir, FileName, T, E}}
+ C:E ->
+ S = erlang:get_stacktrace(),
+ d("File write of ~s exception: ~p:~p~n ~p~n",
+ [FileName,C,E,S]),
+ {error, {failed_write, Dir, FileName, {C, E, S}}}
end.
-do_append_config_file(Dir, FileName, Verify, Write) ->
- Verify(),
- case file:open(filename:join(Dir, FileName), [read, write]) of
- {ok, Fd} ->
- file:position(Fd, eof),
- file_write_and_close(Write, Fd, Dir, FileName);
+write_config_file(Dir, FileName, Write, Entries, Fd) ->
+ try Write(Fd, Entries) of
+ ok ->
+ close_config_file(Dir, FileName, Fd)
+ catch
Error ->
- Error
+ S = erlang:get_stacktrace(),
+ d("File write of ~s throwed: ~p~n ~p~n",
+ [FileName, Error, S]),
+ close_config_file(Dir, FileName, Fd),
+ Error;
+ C:E ->
+ S = erlang:get_stacktrace(),
+ d("File write of ~s exception: ~p:~p~n ~p~n",
+ [FileName,C,E,S]),
+ close_config_file(Dir, FileName, Fd),
+ {error, {failed_write, Dir, FileName, {C, E, S}}}
end.
-
-file_write_and_close(Write, Fd, Dir, FileName) ->
- ok = Write(Fd),
+close_config_file(Dir, FileName, Fd) ->
case file:sync(Fd) of
ok ->
case file:close(Fd) of
@@ -2461,63 +2614,159 @@ file_write_and_close(Write, Fd, Dir, FileName) ->
{error, {failed_closing, Dir, FileName, Reason}}
end;
{error, Reason} ->
+ _ = file:close(Fd),
{error, {failed_syncing, Dir, FileName, Reason}}
end.
--spec read_config_file(Dir :: string(),
- FileName :: string(),
- Verify :: verify_config_entry_function()) ->
- {ok, Config :: list()} | {error, Reason :: term()}.
-read_config_file(Dir, FileName, Verify)
- when is_list(Dir) andalso is_list(FileName) andalso is_function(Verify) ->
- (catch do_read_config_file(Dir, FileName, Verify)).
+-spec append_config_file(
+ Dir :: string(),
+ FileName :: string(),
+ Order :: order_config_entry_function(),
+ Check :: check_config_entry_function(),
+ Write :: write_config_function(),
+ Entries :: [term()]) ->
+ ok | {error, term()}.
+
+append_config_file(Dir, FileName, Order, Check, Write, Entries)
+ when is_list(Dir), is_list(FileName),
+ is_function(Order), is_function(Check), is_function(Write),
+ is_list(Entries) ->
+ case file:open(filename:join(Dir, FileName), [read, write]) of
+ {ok, Fd} ->
+ append_config_file(
+ Dir, FileName, Order, Check, Write, Entries, Fd);
+ Error ->
+ Error
+ end.
+
+append_config_file(Dir, FileName, Order, Check, Write, Entries, Fd) ->
+ try
+ %% Verify the entries together with the file content
+ LinesInFileR = read_lines(Fd, [], 1),
+ StartLine =
+ case LinesInFileR of
+ [] ->
+ 1;
+ [{_, _, EndLine} | _] ->
+ EndLine
+ end,
+ LinesR = prepend_lines(LinesInFileR, Entries, StartLine),
+ SortedLines = sort_lines(lists:reverse(LinesR), Order),
+ _ = verify_lines(SortedLines, Check, undefined, []),
+ %% Append to the file
+ Write(Fd, Entries)
+ of
+ ok ->
+ close_config_file(Dir, FileName, Fd)
+ catch
+ Error ->
+ S = erlang:get_stacktrace(),
+ d("File append of ~s throwed: ~p~n ~p~n",
+ [FileName, Error, S]),
+ close_config_file(Dir, FileName, Fd),
+ Error;
+ C:E ->
+ S = erlang:get_stacktrace(),
+ d("File append of ~s exception: ~p:~p~n ~p~n",
+ [FileName,C,E,S]),
+ close_config_file(Dir, FileName, Fd),
+ {error, {failed_append, Dir, FileName, {C, E, S}}}
+ end.
+
+%% Fake line numbers, one per entry
+prepend_lines(Lines, [], _) ->
+ Lines;
+prepend_lines(Lines, [Entry | Entries], StartLine) ->
+ EndLine = StartLine + 1,
+ prepend_lines([{StartLine, Entry, EndLine} | Lines], Entries, EndLine).
+
+
+
+-spec read_config_file(
+ Dir :: string(),
+ FileName :: string(),
+ Order :: order_config_entry_function(),
+ Check :: check_config_entry_function()) ->
+ {ok, Config :: [Entry :: term()]} |
+ {error, Reason :: term()}.
-do_read_config_file(Dir, FileName, Verify) ->
+read_config_file(Dir, FileName, Order, Check)
+ when is_list(Dir), is_list(FileName),
+ is_function(Order), is_function(Check) ->
case file:open(filename:join(Dir, FileName), [read]) of
{ok, Fd} ->
- Result = read_loop(Fd, [], Verify, 1),
- file:close(Fd),
- Result;
+ try
+ Lines = lists:reverse(read_lines(Fd, [], 1)),
+ SortedLines = sort_lines(Lines, Order),
+ {ok, verify_lines(SortedLines, Check, undefined, [])}
+ catch
+ Error ->
+ S = erlang:get_stacktrace(),
+ d("File read of ~s throwed: ~p~n ~p~n",
+ [FileName, Error, S]),
+ {error, Error};
+ T:E ->
+ S = erlang:get_stacktrace(),
+ d("File read of ~s exception: ~p:~p~n ~p~n",
+ [FileName,T,E,S]),
+ {error, {failed_read, Dir, FileName, {T, E, S}}}
+ after
+ file:close(Fd)
+ end;
{error, Reason} ->
{error, {Reason, FileName}}
end.
-read_loop(Fd, Acc, Check, StartLine) ->
- case read_term(Fd, StartLine) of
+read_lines(Fd, Acc, StartLine) ->
+ case read_and_parse_term(Fd, StartLine) of
{ok, Term, EndLine} ->
- case (catch Check(Term)) of
- ok ->
- read_loop(Fd, [Term | Acc], Check, EndLine);
- {error, Reason} ->
- {error, {failed_check, StartLine, EndLine, Reason}};
- Error ->
- {error, {failed_check, StartLine, EndLine, Error}}
- end;
- {error, EndLine, Error} ->
- {error, {failed_reading, StartLine, EndLine, Error}};
- eof ->
- {ok, lists:reverse(Acc)}
+ read_lines(Fd, [{StartLine, Term, EndLine}|Acc], EndLine);
+ {error, Error, EndLine} ->
+ throw({failed_reading, StartLine, EndLine, Error});
+ {eof, _EndLine} ->
+ Acc
end.
-
-read_term(Fd, StartLine) ->
+
+read_and_parse_term(Fd, StartLine) ->
case io:request(Fd, {get_until, "", erl_scan, tokens, [StartLine]}) of
{ok, Tokens, EndLine} ->
case erl_parse:parse_term(Tokens) of
{ok, Term} ->
{ok, Term, EndLine};
{error, {Line, erl_parse, Error}} ->
- {error, Line, {parse_error, Error}}
+ {error, {parse_error, Error}, Line}
end;
- {error, E, EndLine} ->
- {error, EndLine, E};
- {eof, _EndLine} ->
- eof;
Other ->
Other
end.
+sort_lines(Lines, Order) ->
+ lists:sort(
+ fun ({_, T1, _}, {_, T2, _}) ->
+ Order(T1, T2)
+ end, Lines).
+
+verify_lines([], _, _, Acc) ->
+ lists:reverse(Acc);
+verify_lines(
+ [{StartLine, Term, EndLine}|Lines], Check, State, Acc) ->
+ try Check(Term, State) of
+ {Terms, NewState} when is_list(Terms) ->
+ verify_lines(Lines, Check, NewState, Terms ++ Acc);
+ {ok, NewState} ->
+ verify_lines(Lines, Check, NewState, [Term|Acc]);
+ {{ok, NewTerm}, NewState} ->
+ verify_lines(Lines, Check, NewState, [NewTerm|Acc])
+ catch
+ {error, Reason} ->
+ throw({failed_check, StartLine, EndLine, Reason});
+ C:R ->
+ S = erlang:get_stacktrace(),
+ throw({failed_check, StartLine, EndLine, {C, R, S}})
+ end.
+
agent_snmp_mk_secret(Alg, Passwd, EngineID) ->
snmp_usm:passwd2localized_key(Alg, Passwd, EngineID).
@@ -2540,8 +2789,8 @@ ensure_started(App) ->
%% -------------------------------------------------------------------------
-% d(F, A) ->
-% i("DBG: " ++ F, A).
+d(F, A) ->
+ i("DBG: " ++ F, A).
i(F) ->
i(F, []).
diff --git a/lib/snmp/src/misc/snmp_debug.hrl b/lib/snmp/src/misc/snmp_debug.hrl
index dc916ac96a..6ed4af7d50 100644
--- a/lib/snmp/src/misc/snmp_debug.hrl
+++ b/lib/snmp/src/misc/snmp_debug.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/misc/snmp_log.erl b/lib/snmp/src/misc/snmp_log.erl
index 1aba3b56f8..767d801eee 100644
--- a/lib/snmp/src/misc/snmp_log.erl
+++ b/lib/snmp/src/misc/snmp_log.erl
@@ -1,22 +1,22 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
-%%
-module(snmp_log).
@@ -24,9 +24,9 @@
-export([
create/4, create/5, create/6, open/1, open/2,
change_size/2, close/1, sync/1, info/1,
- log/4,
- log_to_txt/5, log_to_txt/6, log_to_txt/7,
- log_to_io/4, log_to_io/5, log_to_io/6
+ log/3, log/4,
+ log_to_txt/6, log_to_txt/7, log_to_txt/8,
+ log_to_io/5, log_to_io/6, log_to_io/7
]).
-export([
upgrade/1, upgrade/2,
@@ -35,7 +35,17 @@
-export([
validate/1, validate/2
]).
+%% <BACKWARD-COMPAT>
+-export([
+ log_to_txt/5,
+ log_to_io/4
+ ]).
+%% </BACKWARD-COMPAT>
+-export_type([
+ log/0,
+ log_time/0
+ ]).
-define(SNMP_USE_V3, true).
-include("snmp_types.hrl").
@@ -43,12 +53,24 @@
-define(VMODULE,"LOG").
-include("snmp_verbosity.hrl").
--define(LOG_FORMAT, internal).
--define(LOG_TYPE, wrap).
+-define(LOG_FORMAT, internal).
+-define(LOG_TYPE, wrap).
+-define(BLOCK_DEFAULT, true).
-record(snmp_log, {id, seqno}).
+%%-----------------------------------------------------------------
+%% Types
+%%-----------------------------------------------------------------
+
+-opaque log() :: #snmp_log{}.
+-type log_time() :: null |
+ calendar:datetime() |
+ {local_time, calendar:datetime()} |
+ {universal_time, calendar:datetime()}.
+
+
%% --------------------------------------------------------------------
%% Exported functions
%% --------------------------------------------------------------------
@@ -210,7 +232,20 @@ validate(Log, SeqNoReq)
validate_seqno(PrevSN, SeqNo),
{Timestamp, SeqNo};
- ({Timestamp, _Packet, _Addr, _Port}, {PrevTS, _PrevSN}) when SeqNoReq =:= true ->
+ ({Timestamp, SeqNo, _Packet, _AddrStr}, {PrevTS, PrevSN})
+ when is_integer(SeqNo) ->
+ ?vtrace("validating log entry when"
+ "~n Timestamp: ~p"
+ "~n SeqNo: ~p"
+ "~n PrevTS: ~p"
+ "~n PrevSN: ~p",
+ [Timestamp, SeqNo, PrevTS, PrevSN]),
+ validate_timestamp(PrevTS, Timestamp),
+ validate_seqno(PrevSN, SeqNo),
+ {Timestamp, SeqNo};
+
+ ({Timestamp, _Packet, _Addr, _Port}, {PrevTS, _PrevSN})
+ when SeqNoReq =:= true ->
?vtrace("validating log entry when"
"~n Timestamp: ~p"
"~n PrevTS: ~p",
@@ -323,13 +358,20 @@ validate_loop(Error, _Log, _Write, _PrevTS, _PrevSN) ->
%% log(Log, Packet, Addr, Port)
%%-----------------------------------------------------------------
+log(#snmp_log{id = Log, seqno = SeqNo}, Packet, AddrStr) ->
+ ?vtrace(
+ "log -> entry with~n"
+ " Log: ~p~n"
+ " AddrStr: ~s", [Log, AddrStr]),
+ Entry = make_entry(SeqNo, Packet, AddrStr),
+ disk_log:alog(Log, Entry).
-log(#snmp_log{id = Log, seqno = SeqNo}, Packet, Addr, Port) ->
+log(#snmp_log{id = Log, seqno = SeqNo}, Packet, Ip, Port) ->
?vtrace("log -> entry with"
"~n Log: ~p"
- "~n Addr: ~p"
- "~n Port: ~p", [Log, Addr, Port]),
- Entry = make_entry(SeqNo, Packet, Addr, Port),
+ "~n Ip: ~p"
+ "~n Port: ~p", [Log, Ip, Port]),
+ Entry = make_entry(SeqNo, Packet, Ip, Port),
%% io:format("log -> "
%% "~n Entry: ~p"
%% "~n Info: ~p"
@@ -341,18 +383,35 @@ log(#snmp_log{id = Log, seqno = SeqNo}, Packet, Addr, Port) ->
%% "~n", [Res, disk_log:info(Log)]),
%% disk_log:sync(Log),
Res.
-
-make_entry(SeqNoGen, Packet, Addr, Port) ->
+
+make_entry(SeqNoGen, Packet, AddrStr)
+ when is_integer(Packet);
+ is_tuple(AddrStr) ->
+ erlang:error(badarg, [SeqNoGen, Packet, AddrStr]);
+make_entry(SeqNoGen, Packet, AddrStr) ->
+ try next_seqno(SeqNoGen) of
+ disabled ->
+ {timestamp(), Packet, AddrStr};
+ {ok, NextSeqNo} when is_integer(NextSeqNo) ->
+ {timestamp(), NextSeqNo, Packet, AddrStr}
+ catch
+ _:_ ->
+ {timestamp(), Packet, AddrStr}
+ end.
+
+make_entry(SeqNoGen, Packet, Ip, Port) when is_integer(Packet) ->
+ erlang:error(badarg, [SeqNoGen, Packet, Ip, Port]);
+make_entry(SeqNoGen, Packet, Ip, Port) ->
try next_seqno(SeqNoGen) of
disabled ->
- {timestamp(), Packet, Addr, Port};
- {ok, NextSeqNo} ->
- {timestamp(), NextSeqNo, Packet, Addr, Port}
+ {timestamp(), Packet, Ip, Port};
+ {ok, NextSeqNo} when is_integer(NextSeqNo) ->
+ {timestamp(), NextSeqNo, Packet, Ip, Port}
catch
_:_ ->
- {timestamp(), Packet, Addr, Port}
+ {timestamp(), Packet, Ip, Port}
end.
next_seqno({M, F, A}) ->
@@ -379,57 +438,86 @@ do_change_size(Log, NewSize) ->
%% -- log_to_txt ---
+%% <BACKWARD-COMPAT>
log_to_txt(Log, FileName, Dir, Mibs, TextFile) ->
- log_to_txt(Log, FileName, Dir, Mibs, TextFile, null, null).
+ log_to_txt(Log, ?BLOCK_DEFAULT, FileName, Dir, Mibs, TextFile).
+%% </BACKWARD-COMPAT>
+log_to_txt(Log, Block, FileName, Dir, Mibs, TextFile)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ log_to_txt(Log, Block, FileName, Dir, Mibs, TextFile, null, null);
+%% <BACKWARD-COMPAT>
log_to_txt(Log, FileName, Dir, Mibs, TextFile, Start) ->
- log_to_txt(Log, FileName, Dir, Mibs, TextFile, Start, null).
-
-log_to_txt(Log, FileName, Dir, Mibs, TextFile, Start, Stop)
- when is_list(Mibs) andalso is_list(TextFile) ->
+ log_to_txt(Log, ?BLOCK_DEFAULT, FileName, Dir, Mibs, TextFile, Start, null).
+%% </BACKWARD-COMPAT>
+
+log_to_txt(Log, Block, FileName, Dir, Mibs, TextFile, Start)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ log_to_txt(Log, Block, FileName, Dir, Mibs, TextFile, Start, null);
+%% <BACKWARD-COMPAT>
+log_to_txt(Log, FileName, Dir, Mibs, TextFile, Start, Stop) ->
+ log_to_txt(Log, ?BLOCK_DEFAULT, FileName, Dir, Mibs, TextFile, Start, Stop).
+%% </BACKWARD-COMPAT>
+
+log_to_txt(Log, Block, FileName, Dir, Mibs, TextFile, Start, Stop)
+ when (((Block =:= true) orelse (Block =:= false)) andalso
+ is_list(Mibs) andalso is_list(TextFile)) ->
?vtrace("log_to_txt -> entry with"
"~n Log: ~p"
+ "~n Block: ~p"
"~n FileName: ~p"
"~n Dir: ~p"
"~n Mibs: ~p"
"~n TextFile: ~p"
"~n Start: ~p"
"~n Stop: ~p",
- [Log, FileName, Dir, Mibs, TextFile, Start, Stop]),
+ [Log, Block, FileName, Dir, Mibs, TextFile, Start, Stop]),
File = filename:join(Dir, FileName),
Converter = fun(L) ->
- ?vtrace("log_to_txt:fun -> entry with"
- "~n L: ~p", [L]),
do_log_to_file(L, TextFile, Mibs, Start, Stop)
end,
- log_convert(Log, File, Converter).
+ log_convert(Log, Block, File, Converter).
%% -- log_to_io ---
+%% <BACKWARD-COMPAT>
log_to_io(Log, FileName, Dir, Mibs) ->
- log_to_io(Log, FileName, Dir, Mibs, null, null).
+ log_to_io(Log, ?BLOCK_DEFAULT, FileName, Dir, Mibs, null, null).
+%% </BACKWARD-COMPAT>
+log_to_io(Log, Block, FileName, Dir, Mibs)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ log_to_io(Log, Block, FileName, Dir, Mibs, null, null);
+%% <BACKWARD-COMPAT>
log_to_io(Log, FileName, Dir, Mibs, Start) ->
- log_to_io(Log, FileName, Dir, Mibs, Start, null).
-
-log_to_io(Log, FileName, Dir, Mibs, Start, Stop)
+ log_to_io(Log, ?BLOCK_DEFAULT, FileName, Dir, Mibs, Start, null).
+%% </BACKWARD-COMPAT>
+
+log_to_io(Log, Block, FileName, Dir, Mibs, Start)
+ when ((Block =:= true) orelse (Block =:= false)) ->
+ log_to_io(Log, Block, FileName, Dir, Mibs, Start, null);
+%% <BACKWARD-COMPAT>
+log_to_io(Log, FileName, Dir, Mibs, Start, Stop) ->
+ log_to_io(Log, ?BLOCK_DEFAULT, FileName, Dir, Mibs, Start, Stop).
+%% </BACKWARD-COMPAT>
+
+log_to_io(Log, Block, FileName, Dir, Mibs, Start, Stop)
when is_list(Mibs) ->
?vtrace("log_to_io -> entry with"
"~n Log: ~p"
+ "~n Block: ~p"
"~n FileName: ~p"
"~n Dir: ~p"
"~n Mibs: ~p"
"~n Start: ~p"
"~n Stop: ~p",
- [Log, FileName, Dir, Mibs, Start, Stop]),
+ [Log, Block, FileName, Dir, Mibs, Start, Stop]),
File = filename:join(Dir, FileName),
Converter = fun(L) ->
- ?vtrace("log_to_io:fun -> entry with"
- "~n L: ~p", [L]),
do_log_to_io(L, Mibs, Start, Stop)
end,
- log_convert(Log, File, Converter).
+ log_convert(Log, Block, File, Converter).
%% --------------------------------------------------------------------
@@ -438,23 +526,26 @@ log_to_io(Log, FileName, Dir, Mibs, Start, Stop)
%% -- log_convert ---
-log_convert(#snmp_log{id = Log}, File, Converter) ->
- do_log_convert(Log, File, Converter);
-log_convert(Log, File, Converter) ->
- do_log_convert(Log, File, Converter).
+log_convert(#snmp_log{id = Log}, Block, File, Converter) ->
+ do_log_convert(Log, Block, File, Converter);
+log_convert(Log, Block, File, Converter) ->
+ do_log_convert(Log, Block, File, Converter).
-do_log_convert(Log, File, Converter) ->
+do_log_convert(Log, Block, File, Converter) ->
%% ?vtrace("do_log_converter -> entry with"
- %% "~n Log: ~p"
- %% "~n File: ~p", [Log, File]),
+ %% "~n Log: ~p"
+ %% "~n Block: ~p"
+ %% "~n File: ~p"
+ %% [Log, Block, File]),
Verbosity = get(verbosity),
{Pid, Ref} =
erlang:spawn_monitor(
fun() ->
put(sname, lc),
- put(verbosity, Verbosity),
- Result = do_log_convert2(Log, File, Converter),
- %% ?vlog("convert result: ~p", [Result]),
+ put(verbosity, Verbosity),
+ ?vlog("begin converting", []),
+ Result = do_log_convert2(Log, Block, File, Converter),
+ ?vlog("convert result: ~p", [Result]),
exit(Result)
end),
receive
@@ -464,134 +555,139 @@ do_log_convert(Log, File, Converter) ->
Result
end.
-do_log_convert2(Log, File, Converter) ->
+do_log_convert2(Log, Block, File, Converter) ->
+
+ %% ?vtrace("do_log_converter2 -> entry with"
+ %% "~n Log: ~p"
+ %% "~n Block: ~p"
+ %% "~n File: ~p"
+ %% "~n disk_log:info(Log): ~p",
+ %% [Log, Block, File, disk_log:info(Log)]),
+
%% First check if the caller process has already opened the
%% log, because if we close an already open log we will cause
%% a runtime error.
+
?vtrace("do_log_convert2 -> entry - check if owner", []),
case is_owner(Log) of
true ->
- ?vdebug("do_log_converter2 -> owner - now convert log", []),
- disk_log:block(Log, true),
+ ?vtrace("do_log_converter2 -> convert an already owned log", []),
+ maybe_block(Log, Block),
Res = Converter(Log),
- disk_log:unblock(Log),
+ maybe_unblock(Log, Block),
Res;
false ->
%% Not yet member of the ruling party, apply for membership...
- ?vtrace("do_log_converter2 -> not owner - open log", []),
+ ?vtrace("do_log_converter2 -> convert log", []),
case log_open(Log, File) of
{ok, _} ->
- ?vdebug("do_log_convert2 -> opened - now convert log", []),
- disk_log:block(Log, true),
+ ?vdebug("do_log_convert2 -> opened - now convert", []),
+ maybe_block(Log, Block),
Res = Converter(Log),
- disk_log:unblock(Log),
+ maybe_unblock(Log, Block),
disk_log:close(Log),
+ ?vdebug("do_log_convert2 -> converted - done: "
+ "~n Result: ~p", [Res]),
Res;
{error, {name_already_open, _}} ->
?vdebug("do_log_convert2 -> "
- "already opened - now convert log", []),
- disk_log:block(Log, true),
+ "already opened - now convert", []),
+ maybe_block(Log, Block),
Res = Converter(Log),
- disk_log:unblock(Log),
+ maybe_unblock(Log, Block),
+ ?vdebug("do_log_convert2 -> converted - done: "
+ "~n Result: ~p", [Res]),
Res;
{error, Reason} ->
- ?vinfo("Failed converting log - open failed: "
+ ?vinfo("do_log_converter2 -> "
+ "failed converting log - open failed: "
"~n Reason: ~p", [Reason]),
{error, {Log, Reason}}
end
end.
+maybe_block(_Log, false = _Block) ->
+ %% ?vtrace("maybe_block(false) -> entry", []),
+ ok;
+maybe_block(Log, true = _Block) ->
+ %% ?vtrace("maybe_block(true) -> entry when"
+ %% "~n Log Status: ~p", [log_status(Log)]),
+ Res = disk_log:block(Log, true),
+ %% ?vtrace("maybe_block(true) -> "
+ %% "~n Log Status: ~p"
+ %% "~n Res: ~p", [log_status(Log), Res]),
+ Res.
+
+maybe_unblock(_Log, false = _Block) ->
+ %% ?vtrace("maybe_unblock(false) -> entry", []),
+ ok;
+maybe_unblock(Log, true = _Block) ->
+ %% ?vtrace("maybe_unblock(true) -> entry when"
+ %% "~n Log Status: ~p", [log_status(Log)]),
+ Res = disk_log:unblock(Log),
+ %% ?vtrace("maybe_unblock(true) -> "
+ %% "~n Log Status: ~p"
+ %% "~n Res: ~p", [log_status(Log), Res]),
+ Res.
+
+%% log_status(Log) ->
+%% Info = disk_log:info(Log),
+%% case lists:keysearch(status, 1, Info) of
+%% {value, {status, Status}} ->
+%% Status;
+%% false ->
+%% undefined
+%% end.
+
+
%% -- do_log_to_text ---
do_log_to_file(Log, TextFile, Mibs, Start, Stop) ->
- ?vtrace("do_log_to_txt -> entry with"
- "~n Log: ~p"
- "~n TextFile: ~p"
- "~n Start: ~p"
- "~n Stop: ~p", [Log, TextFile, Start, Stop]),
case file:open(TextFile, [write]) of
{ok, Fd} ->
- ?vtrace("do_log_to_txt -> outfile created - create mini MIB", []),
MiniMib = snmp_mini_mib:create(Mibs),
- ?vtrace("do_log_to_txt -> mini-MIB created - begin conversion", []),
Write = fun(X) ->
- ?vtrace("do_log_to_txt:fun -> "
- "entry - try format", []),
case format_msg(X, MiniMib, Start, Stop) of
{ok, S} ->
- ?vtrace("do_log_to_txt:fun -> "
- "formated - now write", []),
io:format(Fd, "~s", [S]);
_ ->
- ?vdebug("do_log_to_txt:fun -> "
- "format failed", []),
ok
end
end,
Res = (catch loop(disk_log:chunk(Log, start), Log, Write)),
- ?vtrace("do_log_to_txt -> converted - now delete mini-MIB", []),
snmp_mini_mib:delete(MiniMib),
- ?vtrace("do_log_to_txt -> "
- "mini-MIB closed - now close output file", []),
file:close(Fd),
- ?vtrace("do_log_to_txt -> done", []),
Res;
{error, Reason} ->
- ?vinfo("Failed opening output file: "
- "~n TestFile: ~p"
- "~n Reason: ~p", [TextFile, Reason]),
{error, {TextFile, Reason}}
end.
do_log_to_io(Log, Mibs, Start, Stop) ->
- ?vtrace("do_log_to_io -> entry with"
- "~n Log: ~p"
- "~n Mibs: ~p"
- "~n Start: ~p"
- "~n Stop: ~p", [Log, Mibs, Start, Stop]),
MiniMib = snmp_mini_mib:create(Mibs),
- ?vtrace("do_log_to_io -> mini-MIB created - begin conversion", []),
Write = fun(X) ->
- ?vtrace("do_log_to_io:fun -> entry", []),
case format_msg(X, MiniMib, Start, Stop) of
{ok, S} ->
- ?vtrace("do_log_to_io:fun -> "
- "formated - now write", []),
io:format("~s", [S]);
_ ->
- ?vdebug("do_log_to_io:fun -> "
- "format failed", []),
ok
end
end,
(catch loop(disk_log:chunk(Log, start), Log, Write)),
- ?vtrace("do_log_to_io -> converted - now delete mini-MIB", []),
snmp_mini_mib:delete(MiniMib),
- ?vtrace("do_log_to_io -> done", []),
ok.
loop(eof, _Log, _Write) ->
- ?vtrace("loop -> entry when eof", []),
ok;
-loop({error, _Reason} = Error, _Log, _Write) ->
- ?vtrace("loop -> entry with error"
- "~n Reason: ~p", [_Reason]),
+loop({error, _} = Error, _Log, _Write) ->
Error;
loop({Cont, Terms}, Log, Write) ->
- ?vtrace("loop -> entry with terms"
- "~n Cont: ~p"
- "~n length(Terms): ~p", [Cont, length(Terms)]),
- case (catch lists:foreach(Write, Terms)) of
+ case (catch lists:foreach(Write, Terms)) of
{'EXIT', Reason} ->
- ?vtrace("loop -> failure while writing terms"
- "~n Reason: ~p", [Reason]),
{error, Reason};
- _X ->
- ?vtrace("loop -> terms written"
- "~n X: ~p", [_X]),
+ _ ->
loop(disk_log:chunk(Log, Cont), Log, Write)
end;
loop({Cont, Terms, BadBytes}, Log, Write) ->
@@ -604,8 +700,6 @@ loop({Cont, Terms, BadBytes}, Log, Write) ->
loop(disk_log:chunk(Log, Cont), Log, Write)
end;
loop(Error, _Log, _Write) ->
- ?vtrace("loop -> entry with unknown"
- "~n Error: ~p", [Error]),
Error.
@@ -619,211 +713,181 @@ format_msg(Entry, Mib, Start, Stop) ->
end.
%% This is an old-style entry, that never had the sequence-number
-do_format_msg({Timestamp, Packet, {Addr, Port}}, Mib) ->
- ?vdebug("do_format_msg -> old style log entry", []),
- do_format_msg(Timestamp, Packet, Addr, Port, Mib);
+do_format_msg({Timestamp, Packet, {Ip, Port}}, Mib) ->
+ do_format_msg(Timestamp, Packet, ipPort2Str(Ip, Port), Mib);
+%% This is the format without sequence-number
+do_format_msg({Timestamp, Packet, AddrStr}, Mib) ->
+ do_format_msg(Timestamp, Packet, AddrStr, Mib);
+%% This is the format with sequence-number
+do_format_msg({Timestamp, SeqNo, Packet, AddrStr}, Mib)
+ when is_integer(SeqNo) ->
+ do_format_msg(Timestamp, Packet, AddrStr, Mib);
%% This is the format without sequence-number
-do_format_msg({Timestamp, Packet, Addr, Port}, Mib) ->
- ?vdebug("do_format_msg -> log entry without seqno", []),
- do_format_msg(Timestamp, Packet, Addr, Port, Mib);
+do_format_msg({Timestamp, Packet, Ip, Port}, Mib) ->
+ do_format_msg(Timestamp, Packet, ipPort2Str(Ip, Port), Mib);
%% This is the format with sequence-number
-do_format_msg({Timestamp, SeqNo, Packet, Addr, Port}, Mib) ->
- ?vdebug("do_format_msg -> log entry with seqno", []),
- do_format_msg(Timestamp, SeqNo, Packet, Addr, Port, Mib);
+do_format_msg({Timestamp, SeqNo, Packet, Ip, Port}, Mib) ->
+ do_format_msg(Timestamp, SeqNo, Packet, ipPort2Str(Ip, Port), Mib);
%% This is crap...
do_format_msg(_, _) ->
format_tab("** unknown entry in log file\n\n", []).
-do_format_msg(TimeStamp, {V3Hdr, ScopedPdu}, Addr, Port, Mib) ->
- ?vtrace("do_format_msg -> entry with"
- "~n Timestamp: ~p"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n => Try decode scoped pdu",
- [TimeStamp, Addr, Port]),
+do_format_msg(TimeStamp, {V3Hdr, ScopedPdu}, AddrStr, Mib) ->
case (catch snmp_pdus:dec_scoped_pdu(ScopedPdu)) of
ScopedPDU when is_record(ScopedPDU, scopedPdu) ->
- ?vtrace("do_format_msg -> scoped pdu decoded"
- "~n ScopedPDU: ~p", [ScopedPDU]),
Msg = #message{version = 'version-3',
vsn_hdr = V3Hdr,
data = ScopedPDU},
- f(ts2str(TimeStamp), "", Msg, Addr, Port, Mib);
-
+ f(ts2str(TimeStamp), "", Msg, AddrStr, Mib);
{'EXIT', Reason} ->
- ?vinfo("Failed decoding scoped pdu: "
- "~n V3Hdr: ~w"
- "~n ScopedPdu: ~w"
- "~n Reason: ~p", [V3Hdr, ScopedPdu, Reason]),
- format_tab("** error in log file at ~s from ~s:~w ~p\n\n",
- [ts2str(TimeStamp), ip(Addr), Port, Reason])
+ format_tab(
+ "** error in log file at ~s from ~s ~p\n\n",
+ [ts2str(TimeStamp), AddrStr, Reason])
end;
-
-do_format_msg(TimeStamp, Packet, Addr, Port, Mib) ->
- ?vtrace("do_format_msg -> entry with"
- "~n Timestamp: ~p"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n => Try decode packet",
- [TimeStamp, Addr, Port]),
+do_format_msg(TimeStamp, Packet, AddrStr, Mib) ->
case (catch snmp_pdus:dec_message(binary_to_list(Packet))) of
- #message{data = Data} = Msg when (is_record(Data, scopedPdu) orelse
- is_record(Data, pdu) orelse
- is_record(Data, trappdu)) ->
- ?vtrace("do_format_msg -> packet decoded"
- "~n Msg: ~p", [Msg]),
- f(ts2str(TimeStamp), "", Msg, Addr, Port, Mib);
-
- #message{version = Vsn,
- vsn_hdr = VsnHdr} = Msg ->
- ?vinfo("Message not fully decoded: "
- "~n Msg: ~p", [Msg]),
- Reason =
- lists:flatten(
- io_lib:format("Message not fully decoded: "
- "Vsn = ~p, VsnHdr = ~w", [Vsn, VsnHdr])),
- format_tab("** error in log file ~s from ~s:~w => "
- "\n ~s\n\n",
- [ts2str(TimeStamp), ip(Addr), Port, Reason]);
-
+ Msg when is_record(Msg, message) ->
+ f(ts2str(TimeStamp), "", Msg, AddrStr, Mib);
{'EXIT', Reason} ->
- ?vinfo("Failed decoding packet: "
- "~n Packet: ~w"
- "~n Reason: ~p", [Packet, Reason]),
format_tab("** error in log file ~p\n\n", [Reason])
end.
-do_format_msg(TimeStamp, SeqNo, {V3Hdr, ScopedPdu}, Addr, Port, Mib) ->
- ?vtrace("do_format_msg -> entry with"
- "~n Timestamp: ~p"
- "~n SeqNo: ~p"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n => Try decode scoped pdu",
- [TimeStamp, SeqNo, Addr, Port]),
+do_format_msg(TimeStamp, SeqNo, {V3Hdr, ScopedPdu}, AddrStr, Mib) ->
case (catch snmp_pdus:dec_scoped_pdu(ScopedPdu)) of
ScopedPDU when is_record(ScopedPDU, scopedPdu) ->
- ?vtrace("do_format_msg -> scoped pdu decoded"
- "~n ScopedPDU: ~p", [ScopedPDU]),
Msg = #message{version = 'version-3',
vsn_hdr = V3Hdr,
data = ScopedPDU},
- f(ts2str(TimeStamp), sn2str(SeqNo), Msg, Addr, Port, Mib);
-
+ f(ts2str(TimeStamp), sn2str(SeqNo), Msg, AddrStr, Mib);
{'EXIT', Reason} ->
- ?vinfo("Failed decoding scoped pdu: "
- "~n V3Hdr: ~w"
- "~n ScopedPdu: ~w"
- "~n Reason: ~p", [V3Hdr, ScopedPdu, Reason]),
- format_tab("** error in log file at ~s~s from ~s:~w ~p\n\n",
- [ts2str(TimeStamp), sn2str(SeqNo),
- ip(Addr), Port, Reason])
+ format_tab(
+ "** error in log file at ~s from ~s ~p\n\n",
+ [ts2str(TimeStamp), sn2str(SeqNo), AddrStr, Reason])
end;
-do_format_msg(TimeStamp, SeqNo, Packet, Addr, Port, Mib) ->
- ?vtrace("do_format_msg -> entry with"
- "~n Timestamp: ~p"
- "~n SeqNo: ~p"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n => Try decode message",
- [TimeStamp, SeqNo, Addr, Port]),
+do_format_msg(TimeStamp, SeqNo, Packet, AddrStr, Mib) ->
case (catch snmp_pdus:dec_message(binary_to_list(Packet))) of
- #message{data = Data} = Msg when (is_record(Data, scopedPdu) orelse
- is_record(Data, pdu) orelse
- is_record(Data, trappdu)) ->
- ?vtrace("do_format_msg -> message decoded"
- "~n Msg: ~p", [Msg]),
- f(ts2str(TimeStamp), sn2str(SeqNo), Msg, Addr, Port, Mib);
-
- #message{version = Vsn,
- vsn_hdr = VsnHdr} = Msg ->
- ?vinfo("Message not fully decoded: "
- "~n Msg: ~p", [Msg]),
- Reason =
- lists:flatten(
- io_lib:format("Message not fully decoded: "
- "Vsn = ~p, VsnHdr = ~w", [Vsn, VsnHdr])),
- format_tab("** error in log file ~s~s from ~s:~w => "
- "\n ~s\n\n",
- [ts2str(TimeStamp), sn2str(SeqNo),
- ip(Addr), Port, Reason]);
-
+ Msg when is_record(Msg, message) ->
+ f(ts2str(TimeStamp), sn2str(SeqNo), Msg, AddrStr, Mib);
{'EXIT', Reason} ->
- ?vinfo("Failed decoding packet: "
- "~n Packet: ~w"
- "~n Reason: ~p", [Packet, Reason]),
- format_tab("** error in log file ~s (~s) from ~s:~w ~p\n\n",
- [ts2str(TimeStamp), sn2str(SeqNo),
- ip(Addr), Port, Reason])
+ format_tab(
+ "** error in log file ~s from ~s ~p\n\n",
+ [ts2str(TimeStamp), sn2str(SeqNo), AddrStr, Reason])
end.
+%% format_msg({TimeStamp, {V3Hdr, ScopedPdu}, {Addr, Port}},
+%% Mib, Start, Stop) ->
+%% format_msg({TimeStamp, {V3Hdr, ScopedPdu}, Addr, Port},
+%% Mib, Start, Stop);
+%% format_msg({TimeStamp, {V3Hdr, ScopedPdu}, Addr, Port},
+%% Mib, Start, Stop) ->
+%% case timestamp_filter(TimeStamp, Start, Stop) of
+%% true ->
+%% case (catch snmp_pdus:dec_scoped_pdu(ScopedPdu)) of
+%% ScopedPDU when record(ScopedPDU, scopedPdu) ->
+%% Msg = #message{version = 'version-3',
+%% vsn_hdr = V3Hdr,
+%% data = ScopedPDU},
+%% f(ts2str(TimeStamp), Msg, Addr, Port, Mib);
+%% {'EXIT', Reason} ->
+%% format_tab("** error in log file at ~s from ~p:~w ~p\n\n",
+%% [ts2str(TimeStamp), ip(Addr), Port, Reason])
+%% end;
+%% false ->
+%% ignore
+%% end;
+%% format_msg({TimeStamp, Packet, {Addr, Port}}, Mib, Start, Stop) ->
+%% format_msg({TimeStamp, Packet, Addr, Port}, Mib, Start, Stop);
+%% format_msg({TimeStamp, Packet, Addr, Port}, Mib, Start, Stop) ->
+%% case timestamp_filter(TimeStamp, Start, Stop) of
+%% true ->
+%% case (catch snmp_pdus:dec_message(binary_to_list(Packet))) of
+%% Msg when record(Msg, message) ->
+%% f(ts2str(TimeStamp), Msg, Addr, Port, Mib);
+%% {'EXIT', Reason} ->
+%% format_tab("** error in log file ~p\n\n", [Reason])
+%% end;
+%% false ->
+%% ignore
+%% end;
+%% format_msg(_, _Mib, _Start, _Stop) ->
+%% format_tab("** unknown entry in log file\n\n", []).
+
f(TimeStamp, SeqNo,
#message{version = Vsn, vsn_hdr = VsnHdr, data = Data},
- Addr, Port, Mib) ->
- try
- begin
- Str = format_pdu(Data, Mib),
- HdrStr = format_header(Vsn, VsnHdr),
- case get_type(Data) of
- trappdu ->
- f_trap(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
- 'snmpv2-trap' ->
- f_trap(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
- 'inform-request' ->
- f_inform(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
- 'get-response' ->
- f_response(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
- report ->
- f_report(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
- _ ->
- f_request(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port)
- end
- end
- catch
- T:E ->
- ?vinfo("Failed formating log entry"
- "~n TimeStamp: ~p"
- "~n SeqNo: ~p"
- "~n Data: ~p"
- "~n Vsn: ~p"
- "~n VsnHdr: ~p"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Error Type: ~w"
- "~n Error: ~p",
- [TimeStamp, SeqNo, Data, Vsn, VsnHdr, Addr, Port, T, E]),
- format_tab("** error while formating log entry ~p\n\n", [{T, E}])
- end.
-
-f_request(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
- format_tab("request ~s:~w - ~s [~s]~s ~w\n~s",
- [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
-
-f_response(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
- format_tab("response ~s:~w - ~s [~s]~s ~w\n~s",
- [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
-
-f_report(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
- format_tab("report ~s:~w - ~s [~s]~s ~w\n~s",
- [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
-
-f_trap(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
- format_tab("trap ~s:~w - ~s [~s]~s ~w\n~s",
- [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
-
-f_inform(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
- format_tab("inform ~s:~w - ~s [~s]~s ~w\n~s",
- [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
-
+ AddrStr, Mib) ->
+ Str = format_pdu(Data, Mib),
+ HdrStr = format_header(Vsn, VsnHdr),
+ Class =
+ case get_type(Data) of
+ trappdu ->
+ trap;
+ 'snmpv2-trap' ->
+ trap;
+ 'inform-request' ->
+ inform;
+ 'get-response' ->
+ response;
+ report ->
+ report;
+ _ ->
+ request
+ end,
+ format_tab(
+ "~w ~s - ~s [~s]~s ~w\n~s",
+ [Class, AddrStr, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
+
+%% f(TimeStamp, SeqNo,
+%% #message{version = Vsn, vsn_hdr = VsnHdr, data = Data},
+%% Addr, Port, Mib) ->
+%% Str = format_pdu(Data, Mib),
+%% HdrStr = format_header(Vsn, VsnHdr),
+%% case get_type(Data) of
+%% trappdu ->
+%% f_trap(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
+%% 'snmpv2-trap' ->
+%% f_trap(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
+%% 'inform-request' ->
+%% f_inform(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
+%% 'get-response' ->
+%% f_response(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
+%% report ->
+%% f_report(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
+%% _ ->
+%% f_request(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port)
+%% end.
+
+%% f_request(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
+%% format_tab("request ~s:~w - ~s [~s]~s ~w\n~s",
+%% [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
+
+%% f_response(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
+%% format_tab("response ~s:~w - ~s [~s]~s ~w\n~s",
+%% [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
+
+%% f_report(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
+%% format_tab("report ~s:~w - ~s [~s]~s ~w\n~s",
+%% [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
+
+%% f_trap(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
+%% format_tab("trap ~s:~w - ~s [~s]~s ~w\n~s",
+%% [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
+
+%% f_inform(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
+%% format_tab("inform ~s:~w - ~s [~s]~s ~w\n~s",
+%% [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
+
+ipPort2Str(Ip, Port) ->
+ snmp_conf:mk_addr_string({Ip, Port}).
+ %% io_lib:format("~s:~w", [ip(Ip), Port]).
%% Convert a timestamp 2-tupple to a printable string
%%
ts2str({Local,Universal}) ->
- lists:flatten(dat2str(Local) ++ " , " ++ dat2str(Universal));
+ dat2str(Local) ++ " , " ++ dat2str(Universal);
ts2str(_) ->
"".
@@ -919,8 +983,10 @@ get_type(#pdu{type = Type}) ->
Type.
-ip({A,B,C,D}) ->
- lists:flatten(io_lib:format("~w.~w.~w.~w", [A,B,C,D])).
+%% ip(Domain, Addr) ->
+%% snmp_conf:mk_addr_string(Domain, Addr).
+%% ip({A,B,C,D}) ->
+%% io_lib:format("~w.~w.~w.~w", [A,B,C,D]).
diff --git a/lib/snmp/src/misc/snmp_mini_mib.erl b/lib/snmp/src/misc/snmp_mini_mib.erl
index d80270d5c2..92de339001 100644
--- a/lib/snmp/src/misc/snmp_mini_mib.erl
+++ b/lib/snmp/src/misc/snmp_mini_mib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/misc/snmp_misc.erl b/lib/snmp/src/misc/snmp_misc.erl
index a061dcd97c..1f847b7a29 100644
--- a/lib/snmp/src/misc/snmp_misc.erl
+++ b/lib/snmp/src/misc/snmp_misc.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -43,6 +44,7 @@
ip/1, ip/2,
is_auth/1,
is_BitString/1,
+ is_crypto_supported/1,
is_oid/1,
is_priv/1,
is_reportable/1,
@@ -100,30 +102,37 @@ sleep(Time) ->
%% Returns time in ms = sec/1000
% now() -> now(ms).
now(ms) ->
- Now = erlang:now(),
- element(1,Now)*1000000000+
- element(2,Now)*1000+
- (element(3,Now) div 1000);
+ erlang:monotonic_time(milli_seconds);
+
%% Returns time in cs = sec/100
now(cs) ->
- Now = erlang:now(),
- element(1,Now)*100000000+
- element(2,Now)*100+
- (element(3,Now) div 10000);
+ erlang:monotonic_time(100);
+
now(sec) ->
- Now = erlang:now(),
- element(1,Now)*1000000+
- element(2,Now)+
- (element(3,Now) div 1000000).
+ erlang:monotonic_time(seconds).
+is_crypto_supported(Alg) ->
+ %% The 'try catch' handles the case when 'crypto' is
+ %% not present in the system (or not started).
+ try
+ begin
+ Supported = crypto:supports(),
+ Hashs = proplists:get_value(hashs, Supported),
+ Ciphers = proplists:get_value(ciphers, Supported),
+ lists:member(Alg, Hashs ++ Ciphers)
+ end
+ catch
+ _:_ ->
+ false
+ end.
+
is_string([]) -> true;
is_string([Tkn | Str])
when is_integer(Tkn) andalso (Tkn >= 0) andalso (Tkn =< 255) ->
is_string(Str);
is_string(_) -> false.
-
is_oid([E1, E2| Rest])
when (length(Rest) =< 126) andalso (E1 *40 + E2 =< 255) ->
is_oid2(Rest);
@@ -464,7 +473,3 @@ format_val('OBJECT IDENTIFIER', _, Val, MiniMib) ->
io_lib:format("~w", [NVal]);
format_val(_, _, Val, _MiniMib) ->
io_lib:format("~p", [Val]).
-
-
-
-
diff --git a/lib/snmp/src/misc/snmp_note_store.erl b/lib/snmp/src/misc/snmp_note_store.erl
index 608fdcd9ca..606dd8ce4f 100644
--- a/lib/snmp/src/misc/snmp_note_store.erl
+++ b/lib/snmp/src/misc/snmp_note_store.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/misc/snmp_pdus.erl b/lib/snmp/src/misc/snmp_pdus.erl
index 15156f7467..93f06749fd 100644
--- a/lib/snmp/src/misc/snmp_pdus.erl
+++ b/lib/snmp/src/misc/snmp_pdus.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -174,7 +175,7 @@ dec_pdu_tag(168) ->
dec_pdu([164 | Bytes]) -> % It's a trap
Bytes2 = get_data_bytes(Bytes),
{Enterprise, Rest1} = dec_oid_tag(Bytes2),
- {{'IpAddress', AgentAddr}, Rest2} = dec_value(Rest1),
+ {{'IpAddress', [_, _, _, _] = AgentAddr}, Rest2} = dec_value(Rest1),
{GenericTrap, Rest3} = dec_int_tag(Rest2),
{SpecificTrap, Rest4} = dec_int_tag(Rest3),
{{'TimeTicks', TimeStamp}, VBBytes} = dec_value(Rest4),
@@ -664,7 +665,9 @@ enc_value('BITS', Val) ->
enc_oct_str_tag(bits_to_str(Val));
enc_value('OBJECT IDENTIFIER', Val) ->
enc_oid_tag(Val);
-enc_value('IpAddress', Val) ->
+enc_value('IpAddress', {A, B, C, D}) ->
+ enc_value('IpAddress', [A,B,C,D]);
+enc_value('IpAddress', Val) when is_list(Val) ->
Bytes2 = enc_oct_str_notag(Val),
Len2 = elength(length(Bytes2)),
lists:append([64 | Len2],Bytes2);
diff --git a/lib/snmp/src/misc/snmp_usm.erl b/lib/snmp/src/misc/snmp_usm.erl
index df2c1f0b18..bae6bdec72 100644
--- a/lib/snmp/src/misc/snmp_usm.erl
+++ b/lib/snmp/src/misc/snmp_usm.erl
@@ -1,21 +1,24 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
+%% AES: RFC 3826
+%%
-module(snmp_usm).
@@ -24,7 +27,7 @@
-export([passwd2localized_key/3, localize_key/3]).
-export([auth_in/4, auth_out/4, set_msg_auth_params/3]).
-export([des_encrypt/3, des_decrypt/3]).
--export([aes_encrypt/3, aes_decrypt/5]).
+-export([aes_encrypt/5, aes_decrypt/5]).
-define(SNMP_USE_V3, true).
@@ -42,6 +45,9 @@
-define(i32(Int), (Int bsr 24) band 255, (Int bsr 16) band 255, (Int bsr 8) band 255, Int band 255).
+-define(BLOCK_CIPHER_AES, aes_cfb128).
+-define(BLOCK_CIPHER_DES, des_cbc).
+
%%-----------------------------------------------------------------
%% Func: passwd2localized_key/3
@@ -69,7 +75,7 @@ passwd2localized_key(Alg, Passwd, EngineID) when length(Passwd) > 0 ->
%%-----------------------------------------------------------------
localize_key(Alg, Key, EngineID) ->
Str = [Key, EngineID, Key],
- binary_to_list(crypto:Alg(Str)).
+ binary_to_list(crypto:hash(Alg, Str)).
mk_digest(md5, Passwd) ->
@@ -78,25 +84,25 @@ mk_digest(sha, Passwd) ->
mk_sha_digest(Passwd).
mk_md5_digest(Passwd) ->
- Ctx = crypto:md5_init(),
+ Ctx = crypto:hash_init(md5),
Ctx2 = md5_loop(0, [], Ctx, Passwd, length(Passwd)),
- crypto:md5_final(Ctx2).
+ crypto:hash_final(Ctx2).
md5_loop(Count, Buf, Ctx, Passwd, PasswdLen) when Count < 1048576 ->
{Buf64, NBuf} = mk_buf64(length(Buf), Buf, Passwd, PasswdLen),
- NCtx = crypto:md5_update(Ctx, Buf64),
+ NCtx = crypto:hash_update(Ctx, Buf64),
md5_loop(Count+64, NBuf, NCtx, Passwd, PasswdLen);
md5_loop(_Count, _Buf, Ctx, _Passwd, _PasswdLen) ->
Ctx.
mk_sha_digest(Passwd) ->
- Ctx = crypto:sha_init(),
+ Ctx = crypto:hash_init(sha),
Ctx2 = sha_loop(0, [], Ctx, Passwd, length(Passwd)),
- crypto:sha_final(Ctx2).
+ crypto:hash_final(Ctx2).
sha_loop(Count, Buf, Ctx, Passwd, PasswdLen) when Count < 1048576 ->
{Buf64, NBuf} = mk_buf64(length(Buf), Buf, Passwd, PasswdLen),
- NCtx = crypto:sha_update(Ctx, Buf64),
+ NCtx = crypto:hash_update(Ctx, Buf64),
sha_loop(Count+64, NBuf, NCtx, Passwd, PasswdLen);
sha_loop(_Count, _Buf, Ctx, _Passwd, _PasswdLen) ->
Ctx.
@@ -142,26 +148,33 @@ auth_out(?usmHMACSHAAuthProtocol, AuthKey, Message, UsmSecParams) ->
sha_auth_out(AuthKey, Message, UsmSecParams).
md5_auth_out(AuthKey, Message, UsmSecParams) ->
+ %% ?vtrace("md5_auth_out -> entry with"
+ %% "~n AuthKey: ~w"
+ %% "~n Message: ~w"
+ %% "~n UsmSecParams: ~w", [AuthKey, Message, UsmSecParams]),
%% 6.3.1.1
Message2 = set_msg_auth_params(Message, UsmSecParams, ?twelwe_zeros),
- Packet = snmp_pdus:enc_message_only(Message2),
+ Packet = snmp_pdus:enc_message_only(Message2),
%% 6.3.1.2-4 is done by the crypto function
%% 6.3.1.4
- MAC = binary_to_list(crypto:md5_mac_96(AuthKey, Packet)),
+ MAC = binary_to_list(crypto:hmac(md5, AuthKey, Packet, 12)),
+ %% ?vtrace("md5_auth_out -> crypto (md5) encoded"
+ %% "~n MAC: ~w", [MAC]),
%% 6.3.1.5
set_msg_auth_params(Message, UsmSecParams, MAC).
md5_auth_in(AuthKey, AuthParams, Packet) when length(AuthParams) == 12 ->
+ %% ?vtrace("md5_auth_in -> entry with"
+ %% "~n AuthKey: ~w"
+ %% "~n AuthParams: ~w"
+ %% "~n Packet: ~w", [AuthKey, AuthParams, Packet]),
%% 6.3.2.3
Packet2 = patch_packet(binary_to_list(Packet)),
%% 6.3.2.5
- MAC = binary_to_list(crypto:md5_mac_96(AuthKey, Packet2)),
+ MAC = binary_to_list(crypto:hmac(md5, AuthKey, Packet2, 12)),
%% 6.3.2.6
-%% ?vtrace("md5_auth_in -> entry with"
-%% "~n Packet2: ~w"
-%% "~n AuthKey: ~w"
-%% "~n AuthParams: ~w"
-%% "~n MAC: ~w", [Packet2, AuthKey, AuthParams, MAC]),
+ %% ?vtrace("md5_auth_in -> crypto (md5) encoded"
+ %% "~n MAC: ~w", [MAC]),
MAC == AuthParams;
md5_auth_in(_AuthKey, _AuthParams, _Packet) ->
%% 6.3.2.1
@@ -177,7 +190,7 @@ sha_auth_out(AuthKey, Message, UsmSecParams) ->
Packet = snmp_pdus:enc_message_only(Message2),
%% 7.3.1.2-4 is done by the crypto function
%% 7.3.1.4
- MAC = binary_to_list(crypto:sha_mac_96(AuthKey, Packet)),
+ MAC = binary_to_list(crypto:hmac(sha, AuthKey, Packet, 12)),
%% 7.3.1.5
set_msg_auth_params(Message, UsmSecParams, MAC).
@@ -185,7 +198,7 @@ sha_auth_in(AuthKey, AuthParams, Packet) when length(AuthParams) =:= 12 ->
%% 7.3.2.3
Packet2 = patch_packet(binary_to_list(Packet)),
%% 7.3.2.5
- MAC = binary_to_list(crypto:sha_mac_96(AuthKey, Packet2)),
+ MAC = binary_to_list(crypto:hmac(sha, AuthKey, Packet2, 12)),
%% 7.3.2.6
MAC == AuthParams;
sha_auth_in(_AuthKey, _AuthParams, _Packet) ->
@@ -203,7 +216,8 @@ des_encrypt(PrivKey, Data, SaltFun) ->
IV = list_to_binary(snmp_misc:str_xor(PreIV, Salt)),
TailLen = (8 - (length(Data) rem 8)) rem 8,
Tail = mk_tail(TailLen),
- EncData = crypto:des_cbc_encrypt(DesKey, IV, [Data,Tail]),
+ EncData = crypto:block_encrypt(?BLOCK_CIPHER_DES,
+ DesKey, IV, [Data,Tail]),
{ok, binary_to_list(EncData), Salt}.
des_decrypt(PrivKey, MsgPrivParams, EncData)
@@ -217,7 +231,8 @@ des_decrypt(PrivKey, MsgPrivParams, EncData)
Salt = MsgPrivParams,
IV = list_to_binary(snmp_misc:str_xor(PreIV, Salt)),
%% Whatabout errors here??? E.g. not a mulitple of 8!
- Data = binary_to_list(crypto:des_cbc_decrypt(DesKey, IV, EncData)),
+ Data = binary_to_list(crypto:block_decrypt(?BLOCK_CIPHER_DES,
+ DesKey, IV, EncData)),
Data2 = snmp_pdus:strip_encrypted_scoped_pdu_data(Data),
{ok, Data2};
des_decrypt(PrivKey, BadMsgPrivParams, EncData) ->
@@ -229,13 +244,12 @@ des_decrypt(PrivKey, BadMsgPrivParams, EncData) ->
throw({error, {bad_msgPrivParams, PrivKey, BadMsgPrivParams, EncData}}).
-aes_encrypt(PrivKey, Data, SaltFun) ->
+aes_encrypt(PrivKey, Data, SaltFun, EngineBoots, EngineTime) ->
AesKey = PrivKey,
Salt = SaltFun(),
- EngineBoots = snmp_framework_mib:get_engine_boots(),
- EngineTime = snmp_framework_mib:get_engine_time(),
IV = list_to_binary([?i32(EngineBoots), ?i32(EngineTime) | Salt]),
- EncData = crypto:aes_cfb_128_encrypt(AesKey, IV, Data),
+ EncData = crypto:block_encrypt(?BLOCK_CIPHER_AES,
+ AesKey, IV, Data),
{ok, binary_to_list(EncData), Salt}.
aes_decrypt(PrivKey, MsgPrivParams, EncData, EngineBoots, EngineTime)
@@ -244,7 +258,8 @@ aes_decrypt(PrivKey, MsgPrivParams, EncData, EngineBoots, EngineTime)
Salt = MsgPrivParams,
IV = list_to_binary([?i32(EngineBoots), ?i32(EngineTime) | Salt]),
%% Whatabout errors here??? E.g. not a mulitple of 8!
- Data = binary_to_list(crypto:aes_cfb_128_decrypt(AesKey, IV, EncData)),
+ Data = binary_to_list(crypto:block_decrypt(?BLOCK_CIPHER_AES,
+ AesKey, IV, EncData)),
Data2 = snmp_pdus:strip_encrypted_scoped_pdu_data(Data),
{ok, Data2}.
diff --git a/lib/snmp/src/misc/snmp_verbosity.erl b/lib/snmp/src/misc/snmp_verbosity.erl
index 7d063fd702..edfb52a474 100644
--- a/lib/snmp/src/misc/snmp_verbosity.erl
+++ b/lib/snmp/src/misc/snmp_verbosity.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -69,7 +70,7 @@ print2(_Verbosity,Format,Arguments) ->
timestamp() ->
- format_timestamp(now()).
+ format_timestamp(os:timestamp()).
format_timestamp({_N1, _N2, N3} = Now) ->
{Date, Time} = calendar:now_to_datetime(Now),
@@ -154,17 +155,7 @@ image_of_sname(mgr) -> "MGR";
image_of_sname(mgr_misc) -> "MGR_MISC";
image_of_sname(undefined) -> "";
-image_of_sname(S) when is_list(S) ->
- %% The assumption is that its a printable string,
- %% but just in case it is some other list...
- try lists:flatten(io_lib:format("~s", [S])) of
- L ->
- L
- catch
- _:_ ->
- lists:flatten(io_lib:format("~p", [S]))
- end;
-image_of_sname(V) -> lists:flatten(io_lib:format("~p", [V])).
+image_of_sname(V) -> lists:flatten(io_lib:format("~p",[V])).
validate(info) -> info;
@@ -172,4 +163,3 @@ validate(log) -> log;
validate(debug) -> debug;
validate(trace) -> trace;
validate(_) -> silence.
-
diff --git a/lib/snmp/src/misc/snmp_verbosity.hrl b/lib/snmp/src/misc/snmp_verbosity.hrl
index 934d32831f..c79f4c3e88 100644
--- a/lib/snmp/src/misc/snmp_verbosity.hrl
+++ b/lib/snmp/src/misc/snmp_verbosity.hrl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/src/subdirs.mk b/lib/snmp/src/subdirs.mk
index 1cbcd04b54..5f45fd2586 100644
--- a/lib/snmp/src/subdirs.mk
+++ b/lib/snmp/src/subdirs.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/subdirs.mk b/lib/snmp/subdirs.mk
index 850d7d8284..dd8af81d34 100644
--- a/lib/snmp/subdirs.mk
+++ b/lib/snmp/subdirs.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/test/Makefile b/lib/snmp/test/Makefile
index 546d46a002..a9142d911d 100644
--- a/lib/snmp/test/Makefile
+++ b/lib/snmp/test/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
@@ -36,7 +37,7 @@ VSN = $(SNMP_VSN)
include modules.mk
SNMP_ROOT = ..
-SNMP_SUITE = snmp_SUITE
+SNMP_SUITE = snmp_SUITE
ERL_FILES = $(MODULES:%=%.erl)
@@ -86,17 +87,17 @@ RELSYSDIR = $(RELEASE_PATH)/snmp_test
# SNMP FLAGS
# ----------------------------------------------------
ifeq ($(SNMP_DEBUG),)
- SNMP_DEBUG = d
+ # SNMP_DEBUG = d
endif
ifeq ($(SNMP_DEBUG),e)
SNMP_FLAGS += -Dsnmp_error
endif
ifeq ($(SNMP_DEBUG),l)
- SNMP_FLAGS += -Dsnmp_log
+ SNMP_FLAGS += -Dsnmp_error -Dsnmp_log
endif
ifeq ($(SNMP_DEBUG),d)
- SNMP_FLAGS += -Dsnmp_debug
+ SNMP_FLAGS += -Dsnmp_error -Dsnmp_log -Dsnmp_debug
endif
ifeq ($(DONT_USE_TS),true)
@@ -149,7 +150,6 @@ ERL_COMPILE_FLAGS += -I../../snmp/src/app \
-I../../snmp/src/misc \
-I../../snmp/src/agent \
-I../../snmp/src/manager \
- -I$(ERL_TOP)/lib/test_server/include \
-I../../snmp/include \
-Dsnmp_test_data=snmp_test_data \
-Dversion=\"$(VSN)$(PRE_VSN)\" \
@@ -239,6 +239,7 @@ release_tests_spec: opt
$(INSTALL_DATA) $(RELTEST_FILES) $(COVER_SPEC_FILE) "$(RELSYSDIR)"
chmod -R u+w "$(RELSYSDIR)"
tar cf - snmp_test_data | (cd "$(RELSYSDIR)"; tar xf -)
+ tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/snmp/test/exp/snmp_agent_bl_test.erl b/lib/snmp/test/exp/snmp_agent_bl_test.erl
index a5a6e8260b..af53f816f4 100644
--- a/lib/snmp/test/exp/snmp_agent_bl_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_bl_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -95,24 +96,13 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
- case ?OSTYPE() of
- vxworks ->
- %% No crypto app, so skip v3 testcases
- [
- app_info,
- test_v1, test_v2, test_v1_v2,
- test_multi_threaded,
- mib_storage,
- tickets];
- _Else ->
- [
- app_info,
- test_v1, test_v2, test_v1_v2, test_v3,
- test_multi_threaded,
- mib_storage,
- tickets
- ]
- end.
+ [
+ app_info,
+ test_v1, test_v2, test_v1_v2, test_v3,
+ test_multi_threaded,
+ mib_storage,
+ tickets
+ ].
%%%-----------------------------------------------------------------
@@ -1187,21 +1177,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5071,12 +5056,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/exp/snmp_agent_ms_test.erl b/lib/snmp/test/exp/snmp_agent_ms_test.erl
index d5eaea55fa..e615e224dc 100644
--- a/lib/snmp/test/exp/snmp_agent_ms_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_ms_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -28,7 +29,7 @@
-define(application, snmp).
-include_lib("kernel/include/file.hrl").
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-define(SNMP_USE_V3, true).
-include_lib("snmp/include/snmp_types.hrl").
@@ -231,17 +232,13 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
-case ?OSTYPE() of
- vxworks ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_multi_threaded},
- {group, mib_storage}, {group, tickets}];
- _Else ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_v3},
- {group, test_multi_threaded}, {group, mib_storage},
- {group, tickets}]
-end.
+ [
+ app_info,
+ {group, test_v1}, {group, test_v2},
+ {group, test_v1_v2}, {group, test_v3},
+ {group, test_multi_threaded}, {group, mib_storage},
+ {group, tickets}
+ ].
%%%-----------------------------------------------------------------
@@ -1221,21 +1218,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5066,12 +5058,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/exp/snmp_agent_mt_test.erl b/lib/snmp/test/exp/snmp_agent_mt_test.erl
index d62bc6c2e7..a9e68011ea 100644
--- a/lib/snmp/test/exp/snmp_agent_mt_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_mt_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -28,7 +29,7 @@
-define(application, snmp).
-include_lib("kernel/include/file.hrl").
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-define(SNMP_USE_V3, true).
-include_lib("snmp/include/snmp_types.hrl").
@@ -231,17 +232,13 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
-case ?OSTYPE() of
- vxworks ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_multi_threaded},
- {group, mib_storage}, {group, tickets}];
- _Else ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_v3},
- {group, test_multi_threaded}, {group, mib_storage},
- {group, tickets}]
-end.
+ [
+ app_info,
+ {group, test_v1}, {group, test_v2},
+ {group, test_v1_v2}, {group, test_v3},
+ {group, test_multi_threaded}, {group, mib_storage},
+ {group, tickets}
+ ].
%%%-----------------------------------------------------------------
@@ -1221,21 +1218,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5066,12 +5058,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/exp/snmp_agent_v1_test.erl b/lib/snmp/test/exp/snmp_agent_v1_test.erl
index 5379d6d8cf..98e29e55f7 100644
--- a/lib/snmp/test/exp/snmp_agent_v1_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_v1_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -28,7 +29,7 @@
-define(application, snmp).
-include_lib("kernel/include/file.hrl").
--include("test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-define(SNMP_USE_V3, true).
-include_lib("snmp/include/snmp_types.hrl").
diff --git a/lib/snmp/test/exp/snmp_agent_v2_test.erl b/lib/snmp/test/exp/snmp_agent_v2_test.erl
index a86449ca72..c69904daf5 100644
--- a/lib/snmp/test/exp/snmp_agent_v2_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_v2_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -28,7 +29,7 @@
-define(application, snmp).
-include_lib("kernel/include/file.hrl").
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-define(SNMP_USE_V3, true).
-include_lib("snmp/include/snmp_types.hrl").
@@ -231,17 +232,13 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
-case ?OSTYPE() of
- vxworks ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_multi_threaded},
- {group, mib_storage}, {group, tickets}];
- _Else ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_v3},
- {group, test_multi_threaded}, {group, mib_storage},
- {group, tickets}]
-end.
+ [
+ app_info,
+ {group, test_v1}, {group, test_v2},
+ {group, test_v1_v2}, {group, test_v3},
+ {group, test_multi_threaded}, {group, mib_storage},
+ {group, tickets}
+ ].
%%%-----------------------------------------------------------------
@@ -1221,21 +1218,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5066,12 +5058,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/exp/snmp_agent_v3_test.erl b/lib/snmp/test/exp/snmp_agent_v3_test.erl
index c72d845bf2..066a5a26fc 100644
--- a/lib/snmp/test/exp/snmp_agent_v3_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_v3_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -28,7 +29,7 @@
-define(application, snmp).
-include_lib("kernel/include/file.hrl").
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-define(SNMP_USE_V3, true).
-include_lib("snmp/include/snmp_types.hrl").
@@ -231,17 +232,12 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
-case ?OSTYPE() of
- vxworks ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_multi_threaded},
- {group, mib_storage}, {group, tickets}];
- _Else ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_v3},
- {group, test_multi_threaded}, {group, mib_storage},
- {group, tickets}]
-end.
+ [
+ app_info, {group, test_v1}, {group, test_v2},
+ {group, test_v1_v2}, {group, test_v3},
+ {group, test_multi_threaded}, {group, mib_storage},
+ {group, tickets}
+ ].
%%%-----------------------------------------------------------------
@@ -1221,21 +1217,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5066,12 +5057,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/klas3.erl b/lib/snmp/test/klas3.erl
index ec78d19dbb..9a5c388170 100644
--- a/lib/snmp/test/klas3.erl
+++ b/lib/snmp/test/klas3.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -67,11 +68,15 @@ fname(get) ->
end,
case snmpa:current_address() of
{value, {[_A,_B,_C,_D], E}} when is_integer(E) -> ok;
- {value, _} -> throw("bad_ip");
- _ -> throw("bad_adr")
+ {value, {D, _}} when is_atom(D) -> ok;
+ {value, Ip} ->
+ throw(format_string("bad_ip: ~p", [Ip]));
+ Other ->
+ throw(format_string("bad_adr: ~p", [Other]))
end,
case snmpa:current_net_if_data() of
{value, []} -> ok;
+ {value, [{request_ref, R}]} when is_reference(R) -> ok;
{value, _} -> throw("bad_nil");
_ -> throw("bad_nid")
end,
@@ -160,3 +165,6 @@ ftab2(get_next, [9], _Cols) ->
% bad return value
io:format("** Here comes Error Report get_next 3 bad return~n"),
[{[1,5],1},{[2,5],3},{[2,6],3}].
+
+format_string(Format, Args) ->
+ lists:flatten(io_lib:format(Format, Args)).
diff --git a/lib/snmp/test/modules.mk b/lib/snmp/test/modules.mk
index a444cab6d6..0f54e67c65 100644
--- a/lib/snmp/test/modules.mk
+++ b/lib/snmp/test/modules.mk
@@ -2,23 +2,25 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
SUITE_MODULES = \
snmp_SUITE \
+ snmp_to_snmpnet_SUITE \
snmp_app_test \
snmp_appup_test \
snmp_compiler_test \
@@ -29,6 +31,7 @@ SUITE_MODULES = \
snmp_agent_mibs_test \
snmp_agent_nfilter_test \
snmp_agent_test \
+ snmp_agent_conf_test \
snmp_agent_test_lib \
snmp_manager_config_test \
snmp_manager_user \
@@ -42,6 +45,7 @@ TEST_UTIL_MODULES = \
snmp_test_manager \
snmp_test_mgr \
snmp_test_mgr_misc \
+ snmp_test_mgr_counter_server \
sa \
klas3 \
test1 \
@@ -79,5 +83,5 @@ MIB_FILES = \
Test2.mib \
Test3.mib
-SPECS = snmp.spec snmp.spec.vxworks
+SPECS = snmp.spec
diff --git a/lib/snmp/test/sa.erl b/lib/snmp/test/sa.erl
index fee50c0e8c..99e1ad55fd 100644
--- a/lib/snmp/test/sa.erl
+++ b/lib/snmp/test/sa.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/test/snmp.spec.vxworks b/lib/snmp/test/snmp.spec.vxworks
deleted file mode 100644
index 654aa96d8c..0000000000
--- a/lib/snmp/test/snmp.spec.vxworks
+++ /dev/null
@@ -1,4 +0,0 @@
-{topcase, {dir, "../snmp_test"}}.
-{skip, {snmp_SUITE, test_v3, "Requires crypto"}}.
-
-
diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl
index 22b9c64588..05bd86253b 100644
--- a/lib/snmp/test/snmp_SUITE.erl
+++ b/lib/snmp/test/snmp_SUITE.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -80,7 +81,9 @@ groups() ->
{group, note_store_test}]},
{agent, [], [{group, mibs_test},
{group, nfilter_test},
- {group, agent_test}]},
+ {group, agent_test},
+ {group, agent_conf_test},
+ {group, snmpnet_test}]},
{manager, [], [{group, manager_config_test},
{group, manager_user_test},
{group, manager_test}]},
@@ -95,6 +98,8 @@ groups() ->
{mibs_test, [], [{snmp_agent_mibs_test, all}]},
{nfilter_test, [], [{snmp_agent_nfilter_test, all}]},
{agent_test, [], [{snmp_agent_test, all}]},
+ {agent_conf_test, [], [{snmp_agent_conf_test, all}]},
+ {snmpnet_test, [], [{snmp_to_snmpnet_SUITE, all}]},
{manager_config_test, [], [{snmp_manager_config_test, all}]},
{manager_user_test, [], [{snmp_manager_user_test, all}]},
{manager_test, [], [{snmp_manager_test, all}]}
@@ -107,15 +112,18 @@ init_per_group(GroupName, Config0) ->
"~n GroupName: ~p"
"~n Config0: ~p", [GroupName, Config0]),
- %% Group name is not really the suite name
- %% (but it is a good enough approximation),
- %% but it does not matter since we only need
- %% it to be unique.
- snmp_test_lib:init_suite_top_dir(GroupName, Config0).
-
-
+ case GroupName of
+ snmpnet_test ->
+ Config0;
+ _ ->
+ %% Group name is not really the suite name
+ %% (but it is a good enough approximation),
+ %% but it does not matter since we only need
+ %% it to be unique.
+ snmp_test_lib:init_suite_top_dir(GroupName, Config0)
+ end.
+
+end_per_group(snmpnet_test, Config) ->
+ Config;
end_per_group(_GroupName, Config) ->
lists:keydelete(snmp_suite_top_dir, 1, Config).
-
-
-
diff --git a/lib/snmp/test/snmp_agent_conf_test.erl b/lib/snmp/test/snmp_agent_conf_test.erl
new file mode 100644
index 0000000000..0a22bd47d1
--- /dev/null
+++ b/lib/snmp/test/snmp_agent_conf_test.erl
@@ -0,0 +1,210 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(snmp_agent_conf_test).
+
+%%----------------------------------------------------------------------
+%% Include files
+%%----------------------------------------------------------------------
+
+%-include_lib("test_server/include/test_server.hrl").
+%-include("snmp_test_lib.hrl").
+-include_lib("common_test/include/ct.hrl").
+
+-export([
+ all/0,
+ groups/0,
+ init_per_suite/1,
+ end_per_suite/1,
+
+ check_agent/1,
+ check_usm/1,
+ check_vacm/1
+ ]).
+
+
+all() -> [
+ check_agent,
+ check_usm,
+ check_vacm
+ ].
+
+
+groups() ->
+ [].
+
+
+init_per_suite(Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ PrivSubdir = filename:join(PrivDir, "snmp_agent_conf_test"),
+ ok = filelib:ensure_dir(filename:join(PrivSubdir, "dummy")),
+ [{priv_subdir, PrivSubdir} | Config].
+
+end_per_suite(_Config) ->
+ ok.
+
+%%======================================================================
+%% Test data
+%%======================================================================
+
+engine_ids() -> [
+ "plain eid",
+ "here\"eid",
+ "comes\neid",
+ "trouble\0eid",
+ binary_to_list(<<"中国引擎标识符"/utf8>>)
+].
+
+snmp_admin_strings() -> [
+ "plain string",
+ "heres\"eid",
+ "trouble\neid",
+ binary_to_list(<<"中国引擎标识符"/utf8>>)
+].
+
+
+%%======================================================================
+%% Test functions
+%%======================================================================
+
+
+check_agent(Config) ->
+ Dir = ?config(priv_subdir, Config),
+ lists:foreach(
+ fun(EngineId) -> check_agent_by_engineid(Dir, EngineId) end,
+ engine_ids()
+ ),
+ ok.
+
+check_agent_by_engineid(Dir, EngineId) ->
+ WEntries = [
+ snmpa_conf:agent_entry(intAgentIpAddress, {0,0,0,0}),
+ snmpa_conf:agent_entry(intAgentUDPPort, 161),
+ snmpa_conf:agent_entry(snmpEngineMaxMessageSize, 484),
+ snmpa_conf:agent_entry(snmpEngineID, EngineId)
+ ],
+
+ ok = snmpa_conf:write_agent_config(Dir, WEntries),
+ {ok, REntries} = snmpa_conf:read_agent_config(Dir),
+
+ true = is_subset(WEntries, REntries),
+ ok.
+
+%%======================================================================
+
+check_usm(Config) ->
+ Dir = ?config(priv_subdir, Config),
+ EngineId = hd(engine_ids()),
+ UserName = hd(snmp_admin_strings()),
+ SecName = hd(snmp_admin_strings()),
+
+ %% vary engine id
+ lists:foreach(
+ fun(EngineId_) -> check_usm_by_params(Dir, EngineId_, UserName, SecName) end,
+ engine_ids()
+ ),
+
+ %% vary user name
+ lists:foreach(
+ fun(UserName_) -> check_usm_by_params(Dir, EngineId, UserName_, SecName) end,
+ snmp_admin_strings()
+ ),
+
+ %% vary sec name
+ lists:foreach(
+ fun(SecName_) -> check_usm_by_params(Dir, EngineId, UserName, SecName_) end,
+ snmp_admin_strings()
+ ),
+
+ ok.
+
+check_usm_by_params(Dir, EngineId, UserName, SecName) ->
+ WEntries = [
+ snmpa_conf:usm_entry(
+ EngineId,
+ UserName,
+ SecName,
+ zeroDotZero,
+ usmNoAuthProtocol, % authproto
+ "", "",
+ usmNoPrivProtocol, % privproto
+ "", "", "",
+ [], %AuthKey
+ []) %PrivKey
+ ],
+
+ ok = snmpa_conf:write_usm_config(Dir, WEntries),
+ {ok, REntries} = snmpa_conf:read_usm_config(Dir),
+
+ true = is_subset(WEntries, REntries),
+ ok.
+
+%%======================================================================
+
+check_vacm(Config) ->
+ Dir = ?config(priv_subdir, Config),
+
+ %% vary sec name
+ lists:foreach(
+ fun(SecName_) -> check_vacm_by_params(Dir, SecName_) end,
+ snmp_admin_strings()
+ ),
+
+ ok.
+
+
+check_vacm_by_params(Dir, SecName) ->
+ WEntries = [
+ %% SecModel, SecName, GroupName
+ snmpa_conf:vacm_s2g_entry(usm, SecName, SecName),
+ %% GroupName,Prefix,SecModel,SecLevel,Match,ReadView,WriteView,NotifyView
+ snmpa_conf:vacm_acc_entry(SecName, "", any, noAuthNoPriv, exact, "all", "all", "all")
+ ],
+
+ ok = snmpa_conf:write_vacm_config(Dir, WEntries),
+ {ok, REntries} = snmpa_conf:read_vacm_config(Dir),
+
+ true = is_subset(WEntries, REntries),
+ ok.
+
+
+
+%%======================================================================
+
+
+%% additional tests needed:
+% check_context()
+% check_community()
+% check_standard()
+% check_target_addr()
+% check_target_params()
+% check_notify()
+
+
+%%======================================================================
+%% Local utility functions
+%%======================================================================
+
+is_subset(List1, List2) ->
+ io:format("Check ~p is subset of ~p\n", [List1, List2]),
+ sets:is_subset(
+ sets:from_list(List1),
+ sets:from_list(List2)
+ ).
diff --git a/lib/snmp/test/snmp_agent_mibs_test.erl b/lib/snmp/test/snmp_agent_mibs_test.erl
index 3e48130fac..4babffef43 100644
--- a/lib/snmp/test/snmp_agent_mibs_test.erl
+++ b/lib/snmp/test/snmp_agent_mibs_test.erl
@@ -1,32 +1,37 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
%%
%%----------------------------------------------------------------------
-%% Purpose:
+%% Purpose: Test suite of the agent mib-server.
+%% Some of these tests should really be in a mib-storage suite.
%%----------------------------------------------------------------------
+
-module(snmp_agent_mibs_test).
+
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include_lib("test_server/include/test_server.hrl").
+
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-include_lib("snmp/include/snmp_types.hrl").
-include_lib("snmp/include/SNMP-COMMUNITY-MIB.hrl").
@@ -39,13 +44,25 @@
%% External exports
%%----------------------------------------------------------------------
-export([
- all/0,groups/0,init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2,
- init_per_suite/1, end_per_suite/1,
+ all/0,
+ groups/0,
+
+ init_per_suite/1,
+ end_per_suite/1,
+
+ init_per_group/2,
+ end_per_group/2,
+
+ init_per_testcase/2,
+ end_per_testcase/2,
start_and_stop/1,
- size_check_ets/1,
+ size_check_ets1/1,
+ size_check_ets2/1,
+ size_check_ets2_bad_file1/1,
+ size_check_ets3/1,
+ size_check_ets3_bad_file1/1,
size_check_dets/1,
size_check_mnesia/1,
load_unload/1,
@@ -55,6 +72,7 @@
]).
+
%%----------------------------------------------------------------------
%% Internal exports
%%----------------------------------------------------------------------
@@ -71,18 +89,51 @@
%% External functions
%%======================================================================
-init_per_testcase(size_check_dets, Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
- DetsDir = join(Dir, "dets_dir/"),
- ?line ok = file:make_dir(DetsDir),
- [{dets_dir, DetsDir}|Config];
-init_per_testcase(size_check_mnesia, Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
- MnesiaDir = join(Dir, "mnesia_dir/"),
- ?line ok = file:make_dir(MnesiaDir),
- mnesia_start([{dir, MnesiaDir}]),
- [{mnesia_dir, MnesiaDir}|Config];
-init_per_testcase(cache_test, Config) when is_list(Config) ->
+init_per_suite(Config0) when is_list(Config0) ->
+
+ ?DBG("init_per_suite -> entry with"
+ "~n Config0: ~p", [Config0]),
+
+ Config1 = snmp_test_lib:init_suite_top_dir(?MODULE, Config0),
+
+ ?DBG("init_per_suite -> done when"
+ "~n Config1: ~p", [Config1]),
+
+ Config1.
+
+end_per_suite(Config) when is_list(Config) ->
+
+ ?DBG("end_per_suite -> entry with"
+ "~n Config: ~p", [Config]),
+
+ Config.
+
+
+init_per_testcase(Case, Config0) when is_list(Config0) ->
+ Config1 = snmp_test_lib:fix_data_dir(Config0),
+ CaseTopDir = snmp_test_lib:init_testcase_top_dir(Case, Config1),
+ DbDir = join(CaseTopDir, "db_dir/"),
+ ?line ok = file:make_dir(DbDir),
+ init_per_testcase2(Case, [{db_dir, DbDir},
+ {case_top_dir, CaseTopDir} | Config1]).
+
+init_per_testcase2(size_check_ets2_bad_file1, Config) when is_list(Config) ->
+ DbDir = ?config(db_dir, Config),
+ %% Create a ad file
+ ok = file:write_file(join(DbDir, "snmpa_symbolic_store.db"),
+ "calvin and hoppes play chess"),
+ Config;
+init_per_testcase2(size_check_ets3_bad_file1, Config) when is_list(Config) ->
+ DbDir = ?config(db_dir, Config),
+ %% Create a ad file
+ ok = file:write_file(join(DbDir, "snmpa_symbolic_store.db"),
+ "calvin and hoppes play chess"),
+ Config;
+init_per_testcase2(size_check_mnesia, Config) when is_list(Config) ->
+ DbDir = ?config(db_dir, Config),
+ mnesia_start([{dir, DbDir}]),
+ Config;
+init_per_testcase2(cache_test, Config) when is_list(Config) ->
Min = timer:minutes(5),
Timeout =
case lists:keysearch(tc_timeout, 1, Config) of
@@ -95,18 +146,26 @@ init_per_testcase(cache_test, Config) when is_list(Config) ->
end,
Dog = test_server:timetrap(Timeout),
[{watchdog, Dog} | Config];
-init_per_testcase(_Case, Config) when is_list(Config) ->
+init_per_testcase2(_Case, Config) when is_list(Config) ->
Config.
-end_per_testcase(size_check_dets, Config) when is_list(Config) ->
- Dir = ?config(dets_dir, Config),
- ?line ok = ?DEL_DIR(Dir),
- lists:keydelete(dets_dir, 1, Config);
+%% end_per_testcase(EtsCase, Config)
+%% when (is_list(Config) andalso
+%% ((EtsCase =:= size_check_ets2) orelse
+%% (EtsCase =:= size_check_ets3))) ->
+%% Dir = ?config(ets_dir, Config),
+%% ?line ok = ?DEL_DIR(Dir),
+%% lists:keydelete(ets_dir, 1, Config);
+%% end_per_testcase(size_check_dets, Config) when is_list(Config) ->
+%% Dir = ?config(dets_dir, Config),
+%% ?line ok = ?DEL_DIR(Dir),
+%% lists:keydelete(dets_dir, 1, Config);
end_per_testcase(size_check_mnesia, Config) when is_list(Config) ->
mnesia_stop(),
- Dir = ?config(mnesia_dir, Config),
- ?line ok = ?DEL_DIR(Dir),
- lists:keydelete(mnesia_dir, 1, Config);
+ %% Dir = ?config(db_dir, Config),
+ %% ?line ok = ?DEL_DIR(Dir),
+ %% lists:keydelete(mnesia_dir, 1, Config);
+ Config;
end_per_testcase(cache_test, Config) when is_list(Config) ->
Dog = ?config(watchdog, Config),
test_server:timetrap_cancel(Dog),
@@ -120,33 +179,40 @@ end_per_testcase(_Case, Config) when is_list(Config) ->
%%======================================================================
all() ->
-cases().
+ cases().
groups() ->
[{size_check, [],
- [size_check_ets, size_check_dets, size_check_mnesia]}].
+ [
+ size_check_ets1, % Plain ets
+ size_check_ets2, % ets with a file
+ size_check_ets2_bad_file1, % ets with a bad file
+ size_check_ets3, % ets with a checksummed file
+ size_check_ets3_bad_file1, % ets with bad file (checksummed)
+ size_check_dets, % Plain dets
+ size_check_mnesia % Plain mnesia
+ ]
+ }].
-init_per_group(_GroupName, Config) ->
- Config.
+
+init_per_group(GroupName, Config) ->
+ snmp_test_lib:init_group_top_dir(GroupName, Config).
end_per_group(_GroupName, Config) ->
- Config.
+ %% Do we really need to do this?
+ %% lists:keydelete(snmp_group_top_dir, 1, Config).
+ Config.
cases() ->
-[start_and_stop, load_unload, {group, size_check},
- me_lookup, which_mib, cache_test].
-
-init_per_suite(Config) when is_list(Config) ->
- %% Data dir points wrong
- DataDir0 = ?config(data_dir, Config),
- DataDir1 = filename:split(filename:absname(DataDir0)),
- [_|DataDir2] = lists:reverse(DataDir1),
- DataDir = filename:join(lists:reverse(DataDir2) ++ [?snmp_test_data]),
- [{snmp_data_dir, DataDir ++ "/"}|Config].
-
-end_per_suite(Config) when is_list(Config) ->
- lists:keydelete(snmp_data_dir, 1, Config).
+ [
+ start_and_stop,
+ load_unload,
+ {group, size_check},
+ me_lookup,
+ which_mib,
+ cache_test
+ ].
%%======================================================================
@@ -173,10 +239,11 @@ start_and_stop(Config) when is_list(Config) ->
load_unload(suite) -> [];
load_unload(Config) when is_list(Config) ->
+ ?DBG("load_unload -> start", []),
+
Prio = normal,
Verbosity = log,
- %% MibStorage = ets,
- MibDir = ?config(snmp_data_dir, Config),
+ MibDir = ?config(data_dir, Config),
?DBG("load_unload -> start symbolic store", []),
?line sym_start(Prio, Verbosity),
@@ -189,8 +256,10 @@ load_unload(Config) when is_list(Config) ->
?line ok = load_mibs(MibsPid, MibDir, ["Test2"]),
?line ok = verify_loaded_mibs(MibsPid, MibDir, ["Test2"]),
- ?DBG("load_unload -> load one already loaded mib", []),
- ?line {error, _} = load_mibs(MibsPid, MibDir, ["Test2"]),
+ ?DBG("load_unload -> try load one *already loaded* mib", []),
+ EMib = join(MibDir, "Test2"),
+ ?line {error, {'load aborted at', EMib, already_loaded}} =
+ load_mibs(MibsPid, MibDir, ["Test2"]),
?DBG("load_unload -> load 2 not already loaded mibs", []),
?line ok = load_mibs(MibsPid, MibDir, ["TestTrap", "TestTrapv2"]),
@@ -202,7 +271,8 @@ load_unload(Config) when is_list(Config) ->
?line ok = verify_loaded_mibs(MibsPid, MibDir, ["TestTrap", "TestTrapv2"]),
?DBG("load_unload -> try unload two loaded mibs and one not loaded", []),
- ?line {error, _} = unload_mibs(MibsPid, ["TestTrap","Test2","TestTrapv2"]),
+ ?line {error, {'unload aborted at', "Test2", not_loaded}} =
+ unload_mibs(MibsPid, ["TestTrap","Test2","TestTrapv2"]),
?line ok = verify_loaded_mibs(MibsPid, MibDir, ["TestTrapv2"]),
?DBG("load_unload -> unload the remaining loaded mib", []),
@@ -215,36 +285,81 @@ load_unload(Config) when is_list(Config) ->
?DBG("load_unload -> stop symbolic store", []),
?line sym_stop(),
+ ?DBG("load_unload -> done", []),
ok.
%% ---------------------------------------------------------------------
-size_check_ets(suite) ->
+size_check_ets1(suite) ->
[];
-size_check_ets(Config) when is_list(Config) ->
- do_size_check([{mib_storage, ets}|Config]).
+size_check_ets1(Config) when is_list(Config) ->
+ MibStorage = [{module, snmpa_mib_storage_ets}],
+ do_size_check([{mib_storage, MibStorage}|Config]).
+
+size_check_ets2(suite) ->
+ [];
+size_check_ets2(Config) when is_list(Config) ->
+ Dir = ?config(db_dir, Config),
+ MibStorage = [{module, snmpa_mib_storage_ets},
+ {options, [{dir, Dir}]}],
+ do_size_check([{mib_storage, MibStorage}|Config]).
+
+size_check_ets2_bad_file1(suite) ->
+ [];
+size_check_ets2_bad_file1(Config) when is_list(Config) ->
+ Dir = ?config(db_dir, Config),
+ %% Ensure that the bad file does not cause any problems (action = clear)
+ MibStorage = [{module, snmpa_mib_storage_ets},
+ {options, [{dir, Dir},
+ {action, clear}]}],
+ do_size_check([{mib_storage, MibStorage}|Config]).
+
+size_check_ets3(suite) ->
+ [];
+size_check_ets3(Config) when is_list(Config) ->
+ Dir = ?config(db_dir, Config),
+ MibStorage = [{module, snmpa_mib_storage_ets},
+ {options, [{dir, Dir},
+ {checksum, true}]}],
+ do_size_check([{mib_storage, MibStorage}|Config]).
+
+size_check_ets3_bad_file1(suite) ->
+ [];
+size_check_ets3_bad_file1(Config) when is_list(Config) ->
+ Dir = ?config(db_dir, Config),
+ %% Ensure that the bad file does not cause any problems (action = clear)
+ MibStorage = [{module, snmpa_mib_storage_ets},
+ {options, [{dir, Dir},
+ {action, clear},
+ {checksum, true}]}],
+ do_size_check([{mib_storage, MibStorage}|Config]).
size_check_dets(suite) ->
[];
size_check_dets(Config) when is_list(Config) ->
- Dir = ?config(dets_dir, Config),
- do_size_check([{mib_storage, {dets, Dir}}|Config]).
+ Dir = ?config(db_dir, Config),
+ MibStorage = [{module, snmpa_mib_storage_dets},
+ {options, [{dir, Dir}]}],
+ do_size_check([{mib_storage, MibStorage}|Config]).
size_check_mnesia(suite) ->
[];
size_check_mnesia(Config) when is_list(Config) ->
- do_size_check([{mib_storage, {mnesia, [node()]}}|Config]).
+ MibStorage = [{module, snmpa_mib_storage_mnesia},
+ {options, [{nodes, [node()]}]}],
+ do_size_check([{mib_storage, MibStorage}|Config]).
do_size_check(Config) ->
- ?DBG("do_size_check -> start", []),
+ ?DBG("do_size_check -> start with"
+ "~n Config: ~p", [Config]),
Prio = normal,
Verbosity = trace,
MibStorage = ?config(mib_storage, Config),
?DBG("do_size_check -> MibStorage: ~p", [MibStorage]),
- MibDir = ?config(snmp_data_dir, Config),
+ MibDir = ?config(data_dir, Config),
StdMibDir = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
?DBG("do_size_check -> start symbolic store", []),
@@ -294,8 +409,7 @@ me_lookup(suite) -> [];
me_lookup(Config) when is_list(Config) ->
Prio = normal,
Verbosity = trace,
- %% MibStorage = ets,
- MibDir = ?config(snmp_data_dir, Config),
+ MibDir = ?config(data_dir, Config),
StdMibDir = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
Mibs = ["Test2", "TestTrap", "TestTrapv2"],
StdMibs = ["OTP-SNMPEA-MIB",
@@ -348,8 +462,7 @@ which_mib(suite) -> [];
which_mib(Config) when is_list(Config) ->
Prio = normal,
Verbosity = trace,
- %% MibStorage = ets,
- MibDir = ?config(snmp_data_dir, Config),
+ MibDir = ?config(data_dir, Config),
StdMibDir = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
Mibs = ["Test2", "TestTrap", "TestTrapv2"],
StdMibs = ["OTP-SNMPEA-MIB",
@@ -406,28 +519,28 @@ cache_test(Config) when is_list(Config) ->
?DBG("cache_test -> start", []),
Prio = normal,
Verbosity = trace,
- MibStorage = ets,
- MibDir = ?config(snmp_data_dir, Config),
+ MibStorage = [{module, snmpa_mib_storage_ets}],
+ MibDir = ?config(data_dir, Config),
StdMibDir = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
- Mibs = ["Test2", "TestTrap", "TestTrapv2"],
- StdMibs = ["OTP-SNMPEA-MIB",
- "SNMP-COMMUNITY-MIB",
- "SNMP-FRAMEWORK-MIB",
- "SNMP-MPD-MIB",
- "SNMP-NOTIFICATION-MIB",
- "SNMP-TARGET-MIB",
- %% "SNMP-USER-BASED-SM-MIB",
- "SNMP-VIEW-BASED-ACM-MIB",
- "SNMPv2-MIB",
- "SNMPv2-TC",
- "SNMPv2-TM"],
+ Mibs = ["Test2", "TestTrap", "TestTrapv2"],
+ StdMibs = ["OTP-SNMPEA-MIB",
+ "SNMP-COMMUNITY-MIB",
+ "SNMP-FRAMEWORK-MIB",
+ "SNMP-MPD-MIB",
+ "SNMP-NOTIFICATION-MIB",
+ "SNMP-TARGET-MIB",
+ %% "SNMP-USER-BASED-SM-MIB",
+ "SNMP-VIEW-BASED-ACM-MIB",
+ "SNMPv2-MIB",
+ "SNMPv2-TC",
+ "SNMPv2-TM"],
?DBG("cache_test -> start symbolic store", []),
?line sym_start(Prio, MibStorage, Verbosity),
?DBG("cache_test -> start mib server", []),
- GcLimit = 2,
- Age = timer:seconds(10),
+ GcLimit = 2,
+ Age = timer:seconds(10),
CacheOpts = [{autogc, false}, {age, Age}, {gclimit, GcLimit}],
?line MibsPid = mibs_start(Prio, MibStorage, [], Verbosity, CacheOpts),
@@ -537,7 +650,7 @@ mnesia_stop() ->
%% - Symbolic Store mini interface
sym_start(Prio, Verbosity) ->
- sym_start(Prio, ets, Verbosity).
+ sym_start(Prio, mib_storage(), Verbosity).
sym_start(Prio, MibStorage, Verbosity) ->
Opts = [{mib_storage, MibStorage}, {verbosity,Verbosity}],
@@ -554,7 +667,7 @@ sym_info() ->
%% -- MIB server mini interface
mibs_start(Prio, Verbosity) when is_atom(Prio) andalso is_atom(Verbosity) ->
- mibs_start(Prio, ets, [], Verbosity).
+ mibs_start(Prio, mib_storage(), [], Verbosity).
mibs_start(Prio, MibStorage, Verbosity)
when is_atom(Prio) andalso is_atom(Verbosity) ->
@@ -585,10 +698,16 @@ mibs_info(Pid) ->
load_mibs(Pid, Dir, Mibs0) ->
Mibs = [join(Dir, Mib) || Mib <- Mibs0],
- snmpa_mib:load_mibs(Pid, Mibs).
+ Res = snmpa_mib:load_mibs(Pid, Mibs),
+ %% ?DBG("load_mibs -> "
+ %% "~n Res: ~p", [Res]),
+ Res.
unload_mibs(Pid, Mibs) ->
- snmpa_mib:unload_mibs(Pid, Mibs).
+ Res = snmpa_mib:unload_mibs(Pid, Mibs),
+ %% ?DBG("unload_mibs -> "
+ %% "~n Res: ~p", [Res]),
+ Res.
verify_loaded_mibs(Pid, Dir, ExpectedMibs0) ->
ExpectedMibs = [join(Dir, Mib) || Mib <- ExpectedMibs0],
@@ -671,6 +790,11 @@ which_mib(M1, M2) ->
{error, {invalid_mib, M1, M2}}.
+%% Default mib-storage
+mib_storage() ->
+ [{module, snmpa_mib_storage_ets}].
+
+
%% --
display_memory_usage(MibsPid) ->
diff --git a/lib/snmp/test/snmp_agent_nfilter_test.erl b/lib/snmp/test/snmp_agent_nfilter_test.erl
index f08060cee3..64fdf20c3f 100644
--- a/lib/snmp/test/snmp_agent_nfilter_test.erl
+++ b/lib/snmp/test/snmp_agent_nfilter_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -25,7 +26,7 @@
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl
index e1d7f33b3f..3c1a6f2afd 100644
--- a/lib/snmp/test/snmp_agent_test.erl
+++ b/lib/snmp/test/snmp_agent_test.erl
@@ -1,43 +1,432 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
-module(snmp_agent_test).
-%% TODO
-%% * Test fault-tolerance (kill master etc)
-%%
-
--compile(export_all).
+-export([
+ all/0,
+ groups/0,
+ init_per_suite/1, end_per_suite/1,
+ init_per_group/2, end_per_group/2,
+ init_per_testcase/2, end_per_testcase/2,
+
+ %% all_tcs - misc
+ app_info/1,
+ info_test/1,
+ create_local_db_dir/1,
+
+ %% all_tcs - test_v1
+ simple/1,
+ db_notify_client/1,
+ v1_processing/1,
+ big/1,
+ big2/1,
+ loop_mib_1/1,
+ api/1,
+ subagent/1,
+ mnesia/1,
+ sa_register/1,
+ v1_trap/1,
+ sa_error/1,
+ next_across_sa/1,
+ undo/1,
+ sparse_table/1,
+ cnt_64/1,
+ opaque/1,
+ change_target_addr_config/1,
+
+ %% all_tcs - test_v1 - multiple_reqs
+ mul_get/1,
+ mul_get_err/1,
+ mul_next/1,
+ mul_next_err/1,
+ mul_set/1,
+ mul_set_err/1,
+
+ %% all_tcs - test_v1 - reported_bugs
+ otp_1128/1,
+ otp_1129/1,
+ otp_1131/1,
+ otp_1162/1,
+ otp_1222/1,
+ otp_1298/1,
+ otp_1331/1,
+ otp_1338/1,
+ otp_1342/1,
+ otp_1366/1,
+ otp_2776/1,
+ otp_2979/1,
+ otp_3187/1,
+ otp_3725/1,
+
+ %% all_tcs - test_v1 - standard_mibs
+ snmp_standard_mib/1,
+ snmp_community_mib/1,
+ snmp_framework_mib/1,
+ snmp_target_mib/1,
+ snmp_notification_mib/1,
+ snmp_view_based_acm_mib/1,
+
+ %% all_tcs - test_v2
+ simple_2/1,
+ v2_processing/1,
+ big_2/1,
+ big2_2/1,
+ loop_mib_2/1,
+ api_2/1,
+ subagent_2/1,
+ mnesia_2/1,
+ sa_register_2/1,
+ v2_trap/1,
+ sa_error_2/1,
+ next_across_sa_2/1,
+ undo_2/1,
+ v2_types/1,
+ implied/1,
+ sparse_table_2/1,
+ cnt_64_2/1,
+ opaque_2/1,
+ v2_caps/1,
+
+ %% all_tcs - test_v2 - multiple_reqs_2
+ mul_get_2/1,
+ mul_get_err_2/1,
+ mul_next_2/1,
+ mul_next_err_2/1,
+ mul_set_2/1,
+ mul_set_err_2/1,
+
+ %% all_tcs - test_v2 - v2_inform
+ v2_inform_i/1,
+
+ %% all_tcs - test_v2 - reported_bugs_2
+ otp_1128_2/1,
+ otp_1129_2/1,
+ otp_1131_2/1,
+ otp_1162_2/1,
+ otp_1222_2/1,
+ otp_1298_2/1,
+ otp_1331_2/1,
+ otp_1338_2/1,
+ otp_1342_2/1,
+ otp_1366_2/1,
+ otp_2776_2/1,
+ otp_2979_2/1,
+ otp_3187_2/1,
+
+ %% all_tcs - test_v2 - standard_mibs_2
+ snmpv2_mib_2/1,
+ snmp_community_mib_2/1,
+ snmp_framework_mib_2/1,
+ snmp_target_mib_2/1,
+ snmp_notification_mib_2/1,
+ snmp_view_based_acm_mib_2/1,
+
+ %% all_tcs - test_v1_v2
+ simple_bi/1,
+
+ %% all_tcs - test_v3
+ simple_3/1,
+ v3_processing/1,
+ big_3/1,
+ big2_3/1,
+ api_3/1,
+ subagent_3/1,
+ mnesia_3/1,
+ loop_mib_3/1,
+ sa_register_3/1,
+ v3_trap/1,
+ sa_error_3/1,
+ next_across_sa_3/1,
+ undo_3/1,
+ v2_types_3/1,
+ implied_3/1,
+ sparse_table_3/1,
+ cnt_64_3/1,
+ opaque_3/1,
+ v2_caps_3/1,
+
+ %% all_tcs - test_v3 - multiple_reqs_3
+ mul_get_3/1,
+ mul_get_err_3/1,
+ mul_next_3/1,
+ mul_next_err_3/1,
+ mul_set_3/1,
+ mul_set_err_3/1,
+
+ %% all_tcs - test_v3 - v3_inform
+ v3_inform_i/1,
+
+ %% all_tcs - test_v3 - reported_bugs_3
+ otp_1128_3/1,
+ otp_1129_3/1,
+ otp_1131_3/1,
+ otp_1162_3/1,
+ otp_1222_3/1,
+ otp_1298_3/1,
+ otp_1331_3/1,
+ otp_1338_3/1,
+ otp_1342_3/1,
+ otp_1366_3/1,
+ otp_2776_3/1,
+ otp_2979_3/1,
+ otp_3187_3/1,
+ otp_3542/1,
+
+ %% all_tcs - test_v3 - standard_mibs_3
+ snmpv2_mib_3/1,
+ snmp_framework_mib_3/1,
+ snmp_mpd_mib_3/1,
+ snmp_target_mib_3/1,
+ snmp_notification_mib_3/1,
+ snmp_view_based_acm_mib_3/1,
+ snmp_user_based_sm_mib_3/1,
+
+ %% all_tcs - test_v3 - v3_security
+ v3_crypto_basic/1,
+ v3_md5_auth/1,
+ v3_sha_auth/1,
+ v3_des_priv/1,
+
+ %% all_tcs - test_multi_threaded
+ multi_threaded/1,
+ mt_trap/1,
+
+ %% all_tcs - mib_storage - mib_storage_ets
+ mse_simple/1,
+ mse_v1_processing/1,
+ mse_big/1,
+ mse_big2/1,
+ mse_loop_mib/1,
+ mse_api/1,
+ mse_sa_register/1,
+ mse_v1_trap/1,
+ mse_sa_error/1,
+ mse_next_across_sa/1,
+ mse_undo/1,
+ mse_standard_mib/1,
+ mse_community_mib/1,
+ mse_framework_mib/1,
+ mse_target_mib/1,
+ mse_notification_mib/1,
+ mse_view_based_acm_mib/1,
+ mse_sparse_table/1,
+ mse_me_of/1,
+ mse_mib_of/1,
+
+ %% all_tcs - mib_storage - mib_storage_dets
+ msd_simple/1,
+ msd_v1_processing/1,
+ msd_big/1,
+ msd_big2/1,
+ msd_loop_mib/1,
+ msd_api/1,
+ msd_sa_register/1,
+ msd_v1_trap/1,
+ msd_sa_error/1,
+ msd_next_across_sa/1,
+ msd_undo/1,
+ msd_standard_mib/1,
+ msd_community_mib/1,
+ msd_framework_mib/1,
+ msd_target_mib/1,
+ msd_notification_mib/1,
+ msd_view_based_acm_mib/1,
+ msd_sparse_table/1,
+ msd_me_of/1,
+ msd_mib_of/1,
+
+ %% all_tcs - mib_storage - mib_storage_mnesia
+ msm_simple/1,
+ msm_v1_processing/1,
+ msm_big/1,
+ msm_big2/1,
+ msm_loop_mib/1,
+ msm_api/1,
+ msm_sa_register/1,
+ msm_v1_trap/1,
+ msm_sa_error/1,
+ msm_next_across_sa/1,
+ msm_undo/1,
+ msm_standard_mib/1,
+ msm_community_mib/1,
+ msm_framework_mib/1,
+ msm_target_mib/1,
+ msm_notification_mib/1,
+ msm_view_based_acm_mib/1,
+ msm_sparse_table/1,
+ msm_me_of/1,
+ msm_mib_of/1,
+
+ %% all_tcs - mib_storage - mse_size_check
+ mse_size_check/1,
+
+ %% all_tcs - mib_storage - msd_size_check
+ msd_size_check/1,
+
+ %% all_tcs - mib_storage - msm_size_check
+ msm_size_check/1,
+
+ %% all_tcs - mib_storage - varm_mib_storage_dets
+ msd_varm_mib_start/1,
+
+ %% all_tcs - mib_storage - varm_mib_storage_mnesia
+ msm_varm_mib_start/1,
+
+ %% all_tcs - tickets1 - otp4394
+ otp_4394/1,
+
+ %% all_tcs - tickets1 - otp7157
+ otp_7157/1,
+
+ %% tickets2
+ otp8395/1,
+ otp9884/1
+ ]).
+
+%% Internal exports
+-export([dummy_manager_init/2,
+ v3_sync/1,
+ v3_inform_sync/1,
+ v2_caps_i/1,
+ v1_proc/0,
+ v2_proc/0,
+ big_test/0,
+ big_test_2/0,
+ simple_standard_test/0,
+ db_notify_client_test/0,
+ notify/2,
+ multi_threaded_test/0,
+ mt_trap_test/1,
+ types_v2_test/0,
+ implied_test/1,
+ sparse_table_test/0,
+ cnt_64_test/1,
+ opaque_test/0,
+ api_test/1,
+ unreg_test/0,
+ load_test/0,
+ load_test_sa/0,
+ api_test2/0,
+ api_test3/0,
+ do_mul_get/0,
+ do_mul_get_err/0,
+ do_mul_next/0,
+ do_mul_next_err/0,
+ do_mul_set/0,
+ do_mul_set_err/0,
+ sa_mib/0,
+ ma_trap1/1,
+ ma_trap2/1,
+ ma_v2_2_v1_trap/1,
+ ma_v2_2_v1_trap2/1,
+ sa_trap1/1,
+ sa_trap2/1,
+ sa_trap3/1,
+ ma_v2_trap1/1,
+ ma_v2_trap2/1,
+ ma_v2_inform1/1,
+ ma_v2_inform2/1,
+ ma_v2_inform3/1,
+ delivery_targets/3,
+ delivery_info/4,
+ ma_v1_2_v2_trap/1,
+ ma_v1_2_v2_trap2/1,
+ sa_v1_2_v2_trap1/1,
+ sa_v1_2_v2_trap2/1,
+ sa_v1_2_v2_trap3/1,
+ sa_errs_bad_value/0,
+ sa_errs_gen_err/0,
+ sa_too_big/0,
+ next_across_sa_test/0,
+ undo_test/0,
+ bad_return/0,
+ standard_mib_a/0,
+ std_mib_read/0,
+ std_mib_write/0,
+ std_mib_init/0,
+ std_mib_finish/0,
+ standard_mib_test_finish/0,
+ std_mib_asn_err/0,
+ snmpv2_mib_test_finish/0,
+ std_mib_a/0,
+ std_mib_b/1,
+ std_mib_c/1,
+ snmpv2_mib_a/0,
+ snmp_community_mib_test/0,
+ snmp_framework_mib_test/0,
+ snmp_mpd_mib_a/0,
+ snmp_mpd_mib_b/0,
+ snmp_mpd_mib_c/1,
+ snmp_target_mib_test/0,
+ snmp_notification_mib_test/0,
+ do_set/1,
+ add_row/1,
+ del_row/1,
+ use_no_rights/0,
+ use_rights/0,
+ usm_add_user1/0,
+ usm_use_user/0,
+ usm_key_change1/2,
+ usm_key_change2/4,
+ usm_key_change3/4,
+ usm_read/0,
+ usm_del_user/0,
+ usm_bad/0,
+ loop_mib_1_test/0,
+ loop_mib_2_test/0,
+ loop_mib_3_test/0,
+ otp_1129_i/1,
+ otp_1162_test/0,
+ otp_1131_test/0,
+ otp_1222_test/0,
+ otp_1298_test/0,
+ otp_1331_test/0,
+ otp_1338_test/0,
+ otp_1342_test/0,
+ otp_1366_test/0,
+ otp_1128_test/0,
+ otp_2776_test/0,
+ otp_2979_test/0,
+ otp_3542_test/0,
+ otp_3725_test/1,
+ otp_4394_test/0,
+ otp_7157_test/1,
+ otp9884_backup/4,
+ agent_log_validation/0,
+ mnesia_init/1,
+ mnesia_start/0,
+ mnesia_stop/0,
+ start_stdalone_agent/1,
+ do_info/1
+ ]).
-define(application, snmp).
-include_lib("kernel/include/file.hrl").
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-define(SNMP_USE_V3, true).
-include_lib("snmp/include/snmp_types.hrl").
-include_lib("snmp/src/agent/snmpa_atl.hrl").
-%% -include_lib("snmp/include/SNMP-COMMUNITY-MIB.hrl").
-%% -include_lib("snmp/include/SNMP-VIEW-BASED-ACM-MIB.hrl").
-%% -include_lib("snmp/include/SNMP-USER-BASED-SM-MIB.hrl").
-
-define(klas1, [1,3,6,1,2,1,7]).
-define(klas2, [1,3,6,1,2,1,9]).
@@ -85,6 +474,26 @@
end).
+-define(expect1(What),
+ snmp_agent_test_lib:expect(?MODULE, ?LINE,
+ What)).
+-define(expect2(What, ExpVBs),
+ snmp_agent_test_lib:expect(?MODULE, ?LINE,
+ What, ExpVBs)).
+-define(expect3(Err, Idx, ExpVBs),
+ snmp_agent_test_lib:expect(?MODULE, ?LINE,
+ Err, Idx, ExpVBs)).
+-define(expect4(Err, Idx, ExpVBs, To),
+ snmp_agent_test_lib:expect(?MODULE, ?LINE,
+ Err, Idx, ExpVBs, To)).
+-define(expect5(Type, Ent, Gen, Spec, ExpVBs),
+ snmp_agent_test_lib:expect(?MODULE, ?LINE,
+ Type, Ent, Gen, Spec, ExpVBs)).
+-define(expect6(Type, Ent, Gen, Spec, ExpVBs, To),
+ snmp_agent_test_lib:expect(?MODULE, ?LINE,
+ Type, Ent, Gen, Spec, ExpVBs, To)).
+
+
all() ->
%% Reqs = [mnesia, distribution, {local_slave_nodes, 2}, {time, 360}],
Conf1 = [{group, all_tcs}],
@@ -93,19 +502,8 @@ all() ->
groups() ->
[
- {all_tcs, [], cases()},
- {mib_storage, [],
- [
- {group, mib_storage_ets},
- {group, mib_storage_dets},
- {group, mib_storage_mnesia},
- {group, mib_storage_size_check_ets},
- {group, mib_storage_size_check_dets},
- {group, mib_storage_size_check_mnesia},
- {group, mib_storage_varm_dets},
- {group, mib_storage_varm_mnesia}
- ]
- },
+ {all_tcs, [], cases()},
+ {mib_storage, [], mib_storage_cases()},
{mib_storage_ets, [], mib_storage_ets_cases()},
{mib_storage_dets, [], mib_storage_dets_cases()},
{mib_storage_mnesia, [], mib_storage_mnesia_cases()},
@@ -116,156 +514,93 @@ groups() ->
{mib_storage_varm_mnesia, [], varm_mib_storage_mnesia_cases()},
{misc, [], misc_cases()},
{test_v1, [], v1_cases()},
+ {test_v1_ipv6, [], v1_cases_ipv6()},
{test_v2, [], v2_cases()},
+ {test_v2_ipv6, [], v2_cases_ipv6()},
{test_v1_v2, [], v1_v2_cases()},
+ {test_v1_v2_ipv6, [], v1_v2_cases()},
{test_v3, [], v3_cases()},
+ {test_v3_ipv6, [], v3_cases_ipv6()},
{test_multi_threaded, [], mt_cases()},
{multiple_reqs, [], mul_cases()},
{multiple_reqs_2, [], mul_cases_2()},
- {v2_inform, [],
- [
- v2_inform_i
- ]
- },
- {v3_security, [],
- [
- v3_crypto_basic,
- v3_md5_auth,
- v3_sha_auth,
- v3_des_priv
- ]
- },
- {standard_mibs, [],
- [
- snmp_standard_mib,
- snmp_community_mib,
- snmp_framework_mib,
- snmp_target_mib,
- snmp_notification_mib,
- snmp_view_based_acm_mib
- ]
- },
- {standard_mibs_2, [],
- [
- snmpv2_mib_2,
- snmp_community_mib_2,
- snmp_framework_mib_2,
- snmp_target_mib_2,
- snmp_notification_mib_2,
- snmp_view_based_acm_mib_2
- ]
- },
- {standard_mibs_3, [],
- [
- snmpv2_mib_3,
- snmp_framework_mib_3,
- snmp_mpd_mib_3,
- snmp_target_mib_3,
- snmp_notification_mib_3,
- snmp_view_based_acm_mib_3,
- snmp_user_based_sm_mib_3
- ]
- },
- {reported_bugs, [],
- [
- otp_1128,
- otp_1129,
- otp_1131,
- otp_1162,
- otp_1222,
- otp_1298,
- otp_1331,
- otp_1338,
- otp_1342,
- otp_2776,
- otp_2979,
- otp_3187,
- otp_3725
- ]
- },
- {reported_bugs_2, [],
- [
- otp_1128_2,
- otp_1129_2,
- otp_1131_2,
- otp_1162_2,
- otp_1222_2,
- otp_1298_2,
- otp_1331_2,
- otp_1338_2,
- otp_1342_2,
- otp_2776_2,
- otp_2979_2,
- otp_3187_2
- ]
- },
- {reported_bugs_3, [],
- [
- otp_1128_3,
- otp_1129_3,
- otp_1131_3,
- otp_1162_3,
- otp_1222_3,
- otp_1298_3,
- otp_1331_3,
- otp_1338_3,
- otp_1342_3,
- otp_2776_3,
- otp_2979_3,
- otp_3187_3,
- otp_3542
- ]
- },
- {tickets1, [],
- [
- {group, otp_4394},
- {group, otp_7157}
- ]
- },
- {tickets2, [], [otp8395, otp9884]},
- {otp_4394, [], [otp_4394_test]},
- {otp_7157, [], [otp_7157_test]}
+ {multiple_reqs_3, [], mul_cases_3()},
+ {v2_inform, [], v2_inform_cases()},
+ {v3_inform, [], v3_inform_cases()},
+ {v3_security, [], v3_security_cases()},
+ {standard_mibs, [], standard_mibs_cases()},
+ {standard_mibs_ipv6, [], standard_mibs_cases_ipv6()},
+ {standard_mibs_2, [], standard_mibs2_cases()},
+ {standard_mibs_3, [], standard_mibs3_cases()},
+ {reported_bugs, [], reported_bugs_cases()},
+ {reported_bugs_2, [], reported_bugs2_cases()},
+ {reported_bugs_3, [], reported_bugs3_cases()},
+ {tickets1, [], tickets1_cases()},
+ {tickets2, [], tickets2_cases()},
+ {otp4394, [], [otp_4394]},
+ {otp7157, [], [otp_7157]}
].
init_per_suite(Config0) when is_list(Config0) ->
- ?DBG("init_per_suite -> entry with"
- "~n Config0: ~p", [Config0]),
+ p("init_per_suite -> entry with"
+ "~n Config: ~p"
+ "~n Nodes: ~p", [Config0, erlang:nodes()]),
Config1 = snmp_test_lib:init_suite_top_dir(?MODULE, Config0),
Config2 = snmp_test_lib:fix_data_dir(Config1),
%% Mib-dirs
MibDir = snmp_test_lib:lookup(data_dir, Config2),
- StdMibDir = filename:join([code:priv_dir(snmp), "mibs"]),
+ StdMibDir = join([code:priv_dir(snmp), "mibs"]),
Config3 = [{mib_dir, MibDir}, {std_mib_dir, StdMibDir} | Config2],
- ?DBG("init_per_suite -> end with"
- "~n Config3: ~p", [Config3]),
+ snmp_test_mgr_counter_server:start(),
+
+ p("init_per_suite -> end when"
+ "~n Config: ~p"
+ "~n Nodes: ~p", [Config3, erlang:nodes()]),
Config3.
end_per_suite(Config) when is_list(Config) ->
- ?DBG("end_per_suite -> entry with"
- "~n Config: ~p", [Config]),
+ p("end_per_suite -> entry with"
+ "~n Config: ~p"
+ "~n Nodes: ~p", [Config, erlang:nodes()]),
+
+ case snmp_test_mgr_counter_server:stop() of
+ {ok, _Counters} ->
+ p("end_per_suite -> sucessfully stopped counter server"
+ "~n Counters: ~p", [_Counters]);
+
+ {error, Reason} ->
+ p("end_per_suite -> failed stopping counter server"
+ "~n Reason: ~p", [Reason])
+ end,
+ p("end_per_suite -> end when"
+ "~n Nodes: ~p", [erlang:nodes()]),
Config.
init_per_group(all_tcs = GroupName, Config) ->
init_all(snmp_test_lib:init_group_top_dir(GroupName, Config));
-init_per_group(otp_7157 = GroupName, Config) ->
- init_otp_7157(snmp_test_lib:init_group_top_dir(GroupName, Config));
-init_per_group(otp_4394 = GroupName, Config) ->
- init_otp_4394(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(otp7157 = GroupName, Config) ->
+ otp_7157_init(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(otp4394 = GroupName, Config) ->
+ otp_4394_init(snmp_test_lib:init_group_top_dir(GroupName, Config));
init_per_group(v2_inform = GroupName, Config) ->
init_v2_inform(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(v3_inform = GroupName, Config) ->
+ init_v3_inform(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(multiple_reqs = GroupName, Config) ->
+ init_mul(snmp_test_lib:init_group_top_dir(GroupName, Config));
init_per_group(multiple_reqs_2 = GroupName, Config) ->
init_mul(snmp_test_lib:init_group_top_dir(GroupName, Config));
-init_per_group(multiple_reqs = GroupName, Config) ->
+init_per_group(multiple_reqs_3 = GroupName, Config) ->
init_mul(snmp_test_lib:init_group_top_dir(GroupName, Config));
init_per_group(test_multi_threaded = GroupName, Config) ->
init_mt(snmp_test_lib:init_group_top_dir(GroupName, Config));
@@ -277,14 +612,24 @@ init_per_group(test_v2 = GroupName, Config) ->
init_v2(snmp_test_lib:init_group_top_dir(GroupName, Config));
init_per_group(test_v1 = GroupName, Config) ->
init_v1(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(test_v1_ipv6 = GroupName, Config) ->
+ init_per_group_ipv6(GroupName, Config, fun init_v1/1);
+init_per_group(test_v2_ipv6 = GroupName, Config) ->
+ init_per_group_ipv6(GroupName, Config, fun init_v2/1);
+init_per_group(test_v1_v2_ipv6 = GroupName, Config) ->
+ init_per_group_ipv6(GroupName, Config, fun init_v1_v2/1);
+init_per_group(test_v3_ipv6 = GroupName, Config) ->
+ init_per_group_ipv6(GroupName, Config, fun init_v3/1);
init_per_group(misc = GroupName, Config) ->
init_misc(snmp_test_lib:init_group_top_dir(GroupName, Config));
init_per_group(mib_storage_varm_mnesia = GroupName, Config) ->
init_varm_mib_storage_mnesia(snmp_test_lib:init_group_top_dir(GroupName,
Config));
init_per_group(mib_storage_varm_dets = GroupName, Config) ->
- init_varm_mib_storage_dets(snmp_test_lib:init_group_top_dir(GroupName,
- Config));
+ ?DBG("init_per_group(mib_storage_varm_dets) -> entry with"
+ "~n Config: ~p", [Config]),
+ init_varm_mib_storage_dets(
+ snmp_test_lib:init_group_top_dir(GroupName, Config));
init_per_group(mib_storage_size_check_mnesia = GroupName, Config) ->
init_size_check_msm(snmp_test_lib:init_group_top_dir(GroupName, Config));
init_per_group(mib_storage_size_check_dets = GroupName, Config) ->
@@ -301,45 +646,76 @@ init_per_group(mib_storage_ets = GroupName, Config) ->
init_per_group(GroupName, Config) ->
snmp_test_lib:init_group_top_dir(GroupName, Config).
+init_per_group_ipv6(GroupName, Config, Init) ->
+ {ok, Hostname0} = inet:gethostname(),
+ case ct:require(ipv6_hosts) of
+ ok ->
+ case lists:member(list_to_atom(Hostname0), ct:get_config(ipv6_hosts)) of
+ true ->
+ Init(
+ snmp_test_lib:init_group_top_dir(
+ GroupName,
+ [{ipfamily, inet6},
+ {ip, ?LOCALHOST(inet6)}
+ | lists:keydelete(ip, 1, Config)]));
+ false ->
+ {skip, "Host does not support IPV6"}
+ end;
+ _ ->
+ {skip, "Test config ipv6_hosts is missing"}
+ end.
+
end_per_group(all_tcs, Config) ->
finish_all(Config);
-end_per_group(otp_7157, Config) ->
- finish_otp_7157(Config);
-end_per_group(otp_4394, Config) ->
- finish_otp_4394(Config);
+end_per_group(otp7157, Config) ->
+ otp_7157_finish(Config);
+end_per_group(otp4394, Config) ->
+ otp_4394_finish(Config);
end_per_group(v2_inform, Config) ->
- finish_v2_inform(Config);
-end_per_group(multiple_reqs_2, Config) ->
- finish_mul(Config);
+ finish_v2_inform(Config);
+end_per_group(v3_inform, Config) ->
+ finish_v3_inform(Config);
end_per_group(multiple_reqs, Config) ->
finish_mul(Config);
+end_per_group(multiple_reqs_2, Config) ->
+ finish_mul(Config);
+end_per_group(multiple_reqs_3, Config) ->
+ finish_mul(Config);
end_per_group(test_multi_threaded, Config) ->
finish_mt(Config);
-end_per_group(test_v3, Config) ->
+end_per_group(test_v3_ipv6, Config) ->
finish_v3(Config);
-end_per_group(test_v1_v2, Config) ->
+end_per_group(test_v1_v2_ipv6, Config) ->
finish_v1_v2(Config);
-end_per_group(test_v2, Config) ->
+end_per_group(test_v2_ipv6, Config) ->
finish_v2(Config);
-end_per_group(test_v1, Config) ->
+end_per_group(test_v1_ipv6, Config) ->
finish_v1(Config);
-end_per_group(misc, Config) ->
+end_per_group(test_v3, Config) ->
+ finish_v3(Config);
+end_per_group(test_v1_v2, Config) ->
+ finish_v1_v2(Config);
+end_per_group(test_v2, Config) ->
+ finish_v2(Config);
+end_per_group(test_v1, Config) ->
+ finish_v1(Config);
+end_per_group(misc, Config) ->
finish_misc(Config);
-end_per_group(mib_storage_varm_mnesia, Config) ->
+end_per_group(mib_storage_varm_mnesia, Config) ->
finish_varm_mib_storage_mnesia(Config);
-end_per_group(mib_storage_varm_dets, Config) ->
+end_per_group(mib_storage_varm_dets, Config) ->
finish_varm_mib_storage_dets(Config);
-end_per_group(mib_storage_size_check_mnesia, Config) ->
+end_per_group(mib_storage_size_check_mnesia, Config) ->
finish_size_check_msm(Config);
-end_per_group(mib_storage_size_check_dets, Config) ->
+end_per_group(mib_storage_size_check_dets, Config) ->
finish_size_check_msd(Config);
-end_per_group(mib_storage_size_check_ets, Config) ->
+end_per_group(mib_storage_size_check_ets, Config) ->
finish_size_check_mse(Config);
-end_per_group(mib_storage_mnesia, Config) ->
+end_per_group(mib_storage_mnesia, Config) ->
finish_mib_storage_mnesia(Config);
-end_per_group(mib_storage_dets, Config) ->
+end_per_group(mib_storage_dets, Config) ->
finish_mib_storage_dets(Config);
-end_per_group(mib_storage_ets, Config) ->
+end_per_group(mib_storage_ets, Config) ->
finish_mib_storage_ets(Config);
end_per_group(_GroupName, Config) ->
Config.
@@ -349,13 +725,16 @@ end_per_group(_GroupName, Config) ->
%% ---- Init Per TestCase ----
init_per_testcase(Case, Config) when is_list(Config) ->
- ?DBG("init_per_testcase -> entry with"
- "~n Config: ~p", [Config]),
+ p("init_per_testcase -> entry with"
+ "~n Config: ~p"
+ "~n Nodes: ~p", [Config, erlang:nodes()]),
- p("Agent Info: "
- "~n ~p", [snmpa:info()]),
+ Result = init_per_testcase1(Case, Config),
- init_per_testcase1(Case, Config).
+ p("init_per_testcase -> done when"
+ "~n Result: ~p"
+ "~n Nodes: ~p", [Result, erlang:nodes()]),
+ Result.
init_per_testcase1(otp8395 = Case, Config) when is_list(Config) ->
?DBG("init_per_testcase1 -> entry with"
@@ -367,7 +746,7 @@ init_per_testcase1(otp9884 = Case, Config) when is_list(Config) ->
"~n Case: ~p"
"~n Config: ~p", [Case, Config]),
otp9884({init, init_per_testcase2(Case, Config)});
-init_per_testcase1(otp_7157_test = _Case, Config) when is_list(Config) ->
+init_per_testcase1(otp_7157 = _Case, Config) when is_list(Config) ->
?DBG("init_per_testcase1 -> entry with"
"~n Case: ~p"
"~n Config: ~p", [_Case, Config]),
@@ -396,15 +775,18 @@ init_per_testcase1(_Case, Config) when is_list(Config) ->
%% ---- End Per TestCase ----
end_per_testcase(Case, Config) when is_list(Config) ->
- ?DBG("end_per_testcase -> entry with"
- "~n Config: ~p", [Config]),
-
- p("Agent Info: "
- "~n ~p", [snmpa:info()]),
+ p("end_per_testcase -> entry with"
+ "~n Config: ~p"
+ "~n Nodes: ~p", [Config, erlang:nodes()]),
display_log(Config),
- end_per_testcase1(Case, Config).
+ Result = end_per_testcase1(Case, Config),
+
+ p("end_per_testcase -> done with"
+ "~n Result: ~p"
+ "~n Nodes: ~p", [Result, erlang:nodes()]),
+ Result.
end_per_testcase1(otp8395, Config) when is_list(Config) ->
otp8395({fin, Config});
@@ -428,21 +810,21 @@ init_per_testcase2(Case, Config) ->
CaseTopDir = snmp_test_lib:init_testcase_top_dir(Case, Config),
%% Create agent top-dir(s)
- AgentTopDir = filename:join([CaseTopDir, agent]),
+ AgentTopDir = join([CaseTopDir, agent]),
ok = file:make_dir(AgentTopDir),
- AgentConfDir = filename:join([AgentTopDir, config]),
+ AgentConfDir = join([AgentTopDir, config]),
ok = file:make_dir(AgentConfDir),
- AgentDbDir = filename:join([AgentTopDir, db]),
+ AgentDbDir = join([AgentTopDir, db]),
ok = file:make_dir(AgentDbDir),
- AgentLogDir = filename:join([AgentTopDir, log]),
+ AgentLogDir = join([AgentTopDir, log]),
ok = file:make_dir(AgentLogDir),
%% Create sub-agent top-dir(s)
- SubAgentTopDir = filename:join([CaseTopDir, sub_agent]),
+ SubAgentTopDir = join([CaseTopDir, sub_agent]),
ok = file:make_dir(SubAgentTopDir),
%% Create manager top-dir(s)
- ManagerTopDir = filename:join([CaseTopDir, manager]),
+ ManagerTopDir = join([CaseTopDir, manager]),
ok = file:make_dir(ManagerTopDir),
[{case_top_dir, CaseTopDir},
@@ -453,34 +835,25 @@ init_per_testcase2(Case, Config) ->
{sub_agent_top_dir, SubAgentTopDir},
{manager_top_dir, ManagerTopDir} | Config].
-end_per_testcase2(_Case, Config) ->
- Config.
+%% end_per_testcase2(_Case, Config) ->
+%% Config.
cases() ->
- case ?OSTYPE() of
- vxworks ->
- [
- {group, misc},
- {group, test_v1},
- {group, test_v2},
- {group, test_v1_v2},
- {group, test_multi_threaded},
- {group, mib_storage},
- {group, tickets1}
- ];
- _Else ->
- [
- {group, misc},
- {group, test_v1},
- {group, test_v2},
- {group, test_v1_v2},
- {group, test_v3},
- {group, test_multi_threaded},
- {group, mib_storage},
- {group, tickets1}
- ]
- end.
+ [
+ {group, misc},
+ {group, test_v1},
+ {group, test_v2},
+ {group, test_v1_v2},
+ {group, test_v3},
+ {group, test_v1_ipv6},
+ {group, test_v2_ipv6},
+ {group, test_v1_v2_ipv6},
+ {group, test_v3_ipv6},
+ {group, test_multi_threaded},
+ {group, mib_storage},
+ {group, tickets1}
+ ].
%%%-----------------------------------------------------------------
@@ -532,8 +905,8 @@ start_v2_agent(Config) ->
start_v2_agent(Config, Opts) ->
snmp_agent_test_lib:start_v2_agent(Config, Opts).
-start_v3_agent(Config) ->
- snmp_agent_test_lib:start_v3_agent(Config).
+%% start_v3_agent(Config) ->
+%% snmp_agent_test_lib:start_v3_agent(Config).
start_v3_agent(Config, Opts) ->
snmp_agent_test_lib:start_v3_agent(Config, Opts).
@@ -565,7 +938,7 @@ delete_tables() ->
mnesia:delete_table(kompissTable2),
mnesia:delete_table(snmp_variables).
-%% Creation is done in runtime!
+%% Tables are created in runtime!
delete_mib_storage_mnesia_tables() ->
mnesia:delete_table(snmpa_mib_data),
mnesia:delete_table(snmpa_mib_tree),
@@ -588,40 +961,89 @@ delete_mib_storage_mnesia_tables() ->
%% versions as well, <base>_N.
%%-----------------------------------------------------------------
-
-
-
-
-
-
-
-
+mib_storage_cases() ->
+ [
+ {group, mib_storage_ets},
+ {group, mib_storage_dets},
+ {group, mib_storage_mnesia},
+ {group, mib_storage_size_check_ets},
+ {group, mib_storage_size_check_dets},
+ {group, mib_storage_size_check_mnesia},
+ {group, mib_storage_varm_dets},
+ {group, mib_storage_varm_mnesia}
+ ].
+
mib_storage_ets_cases() ->
-[mse_simple, mse_v1_processing, mse_big, mse_big2,
- mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap,
- mse_sa_error, mse_next_across_sa, mse_undo,
- mse_standard_mib, mse_community_mib, mse_framework_mib,
- mse_target_mib, mse_notification_mib,
- mse_view_based_acm_mib, mse_sparse_table, mse_me_of,
- mse_mib_of].
+ [
+ mse_simple,
+ mse_v1_processing,
+ mse_big,
+ mse_big2,
+ mse_loop_mib,
+ mse_api,
+ mse_sa_register,
+ mse_v1_trap,
+ mse_sa_error,
+ mse_next_across_sa,
+ mse_undo,
+ mse_standard_mib,
+ mse_community_mib,
+ mse_framework_mib,
+ mse_target_mib,
+ mse_notification_mib,
+ mse_view_based_acm_mib,
+ mse_sparse_table,
+ mse_me_of,
+ mse_mib_of
+ ].
mib_storage_dets_cases() ->
-[msd_simple, msd_v1_processing, msd_big, msd_big2,
- msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap,
- msd_sa_error, msd_next_across_sa, msd_undo,
- msd_standard_mib, msd_community_mib, msd_framework_mib,
- msd_target_mib, msd_notification_mib,
- msd_view_based_acm_mib, msd_sparse_table, msd_me_of,
- msd_mib_of].
+ [
+ msd_simple,
+ msd_v1_processing,
+ msd_big,
+ msd_big2,
+ msd_loop_mib,
+ msd_api,
+ msd_sa_register,
+ msd_v1_trap,
+ msd_sa_error,
+ msd_next_across_sa,
+ msd_undo,
+ msd_standard_mib,
+ msd_community_mib,
+ msd_framework_mib,
+ msd_target_mib,
+ msd_notification_mib,
+ msd_view_based_acm_mib,
+ msd_sparse_table,
+ msd_me_of,
+ msd_mib_of
+ ].
mib_storage_mnesia_cases() ->
-[msm_simple, msm_v1_processing, msm_big, msm_big2,
- msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap,
- msm_sa_error, msm_next_across_sa, msm_undo,
- msm_standard_mib, msm_community_mib, msm_framework_mib,
- msm_target_mib, msm_notification_mib,
- msm_view_based_acm_mib, msm_sparse_table, msm_me_of,
- msm_mib_of].
+ [
+ msm_simple,
+ msm_v1_processing,
+ msm_big,
+ msm_big2,
+ msm_loop_mib,
+ msm_api,
+ msm_sa_register,
+ msm_v1_trap,
+ msm_sa_error,
+ msm_next_across_sa,
+ msm_undo,
+ msm_standard_mib,
+ msm_community_mib,
+ msm_framework_mib,
+ msm_target_mib,
+ msm_notification_mib,
+ msm_view_based_acm_mib,
+ msm_sparse_table,
+ msm_me_of,
+ msm_mib_of
+ ].
mse_size_check_cases() ->
[mse_size_check].
@@ -640,22 +1062,27 @@ varm_mib_storage_mnesia_cases() ->
init_mib_storage_ets(Config) when is_list(Config) ->
?LOG("init_mib_storage_ets -> entry", []),
- MibStorage = {snmp_mib_storage,ets},
+ MibStorage = {mib_storage, [{module, snmpa_mib_storage_ets}]},
init_ms(Config, [MibStorage]).
init_mib_storage_dets(Config) when is_list(Config) ->
- ?LOG("init_mib_storage_ets -> entry", []),
+ ?LOG("init_mib_storage_dets -> entry", []),
?line AgentDbDir = ?GCONF(agent_db_dir, Config),
- MibStorage = {snmp_mib_storage, {dets, AgentDbDir}},
+ MibStorage = {mib_storage, [{module, snmpa_mib_storage_dets},
+ {options, [{dir, AgentDbDir}]}]},
init_ms(Config, [MibStorage]).
init_mib_storage_mnesia(Config) when is_list(Config) ->
- ?LOG("init_mib_storage_ets -> entry", []),
- MibStorage = {snmp_mib_storage, {mnesia,[]}},
+ ?LOG("init_mib_storage_mnesia -> entry", []),
+ ?line AgentNode = ?GCONF(snmp_master, Config),
+ MibStorage = {mib_storage, [{module, snmpa_mib_storage_mnesia},
+ {options, [{nodes, [AgentNode]}]}]},
init_ms(Config, [MibStorage]).
init_ms(Config, Opts) when is_list(Config) ->
- ?LOG("init_mib_storage_ets -> entry", []),
+ ?LOG("init_ms -> entry with"
+ "~n Config: ~p"
+ "~n Opts: ~p", [Config, Opts]),
?line SaNode = ?GCONF(snmp_sa, Config),
?line create_tables(SaNode),
?line AgentConfDir = ?GCONF(agent_conf_dir, Config),
@@ -663,23 +1090,26 @@ init_ms(Config, Opts) when is_list(Config) ->
?line Ip = ?GCONF(ip, Config),
?line config([v1], MgrDir, AgentConfDir,
tuple_to_list(Ip), tuple_to_list(Ip)),
- MasterAgentVerbosity = {snmp_master_agent_verbosity, trace},
- MibsVerbosity = {snmp_mibserver_verbosity, trace},
- SymStoreVerbosity = {snmp_symbolic_store_verbosity, trace},
+ MasterAgentVerbosity = {agent_verbosity, trace},
+ MibsVerbosity = {mib_server, [{verbosity, trace}]},
+ SymStoreVerbosity = {symbolic_store, [{verbosity, trace}]},
Opts1 = [MasterAgentVerbosity, MibsVerbosity, SymStoreVerbosity | Opts],
[{vsn, v1} | start_v1_agent(Config, Opts1)].
init_size_check_mse(Config) when is_list(Config) ->
- MibStorage = {snmp_mib_storage, ets},
+ MibStorage = {mib_storage, [{module, snmpa_mib_storage_ets}]},
init_size_check_ms(Config, [MibStorage]).
init_size_check_msd(Config) when is_list(Config) ->
AgentDbDir = ?GCONF(agent_db_dir, Config),
- MibStorage = {snmp_mib_storage, {dets, AgentDbDir}},
+ MibStorage = {mib_storage, [{module, snmpa_mib_storage_dets},
+ {options, [{dir, AgentDbDir}]}]},
init_size_check_ms(Config, [MibStorage]).
init_size_check_msm(Config) when is_list(Config) ->
- MibStorage = {snmp_mib_storage, {mnesia,[]}},
+ ?line AgentNode = ?GCONF(snmp_master, Config),
+ MibStorage = {mib_storage, [{module, snmpa_mib_storage_mnesia},
+ {options, [{nodes, [AgentNode]}]}]},
init_size_check_ms(Config, [MibStorage]).
init_size_check_ms(Config, Opts) when is_list(Config) ->
@@ -714,12 +1144,16 @@ init_varm_mib_storage_dets(Config) when is_list(Config) ->
?line Ip = ?GCONF(ip, Config),
?line config([v1], MgrDir, AgentConfDir,
tuple_to_list(Ip), tuple_to_list(Ip)),
- MibStorage = {snmp_mib_storage, {dets, AgentDbDir}},
- MasterAgentVerbosity = {snmp_master_agent_verbosity, trace},
- MibsVerbosity = {snmp_mibserver_verbosity, trace},
- SymStoreVerbosity = {snmp_symbolic_store_verbosity, trace},
- Opts = [MibStorage,MasterAgentVerbosity,MibsVerbosity,SymStoreVerbosity],
- [{vsn, v1}, {agent_opts,Opts} | Config].
+ MibStorage = {mib_storage, [{module, snmpa_mib_storage_dets},
+ {options, [{dir, AgentDbDir}]}]},
+ MasterAgentVerbosity = {agent_verbosity, trace},
+ MibsVerbosity = {mib_server, [{verbosity, trace}]},
+ SymStoreVerbosity = {symbolic_store, [{verbosity, trace}]},
+ Opts = [MibStorage,
+ MasterAgentVerbosity,
+ MibsVerbosity,
+ SymStoreVerbosity],
+ [{vsn, v1}, {agent_opts, Opts} | Config].
init_varm_mib_storage_mnesia(Config) when is_list(Config) ->
?LOG("init_varm_mib_storage_mnesia -> entry", []),
@@ -730,12 +1164,17 @@ init_varm_mib_storage_mnesia(Config) when is_list(Config) ->
?line Ip = ?GCONF(ip, Config),
?line config([v1], MgrDir, AgentConfDir,
tuple_to_list(Ip), tuple_to_list(Ip)),
- MibStorage = {snmp_mib_storage,{mnesia,[]}},
- MasterAgentVerbosity = {snmp_master_agent_verbosity, trace},
- MibsVerbosity = {snmp_mibserver_verbosity, trace},
- SymStoreVerbosity = {snmp_symbolic_store_verbosity, trace},
- Opts = [MibStorage,MasterAgentVerbosity,MibsVerbosity,SymStoreVerbosity],
- [{vsn, v1}, {agent_opts,Opts} | Config].
+ ?line AgentNode = ?GCONF(snmp_master, Config),
+ MibStorage = {mib_storage, [{module, snmpa_mib_storage_mnesia},
+ {options, [{nodes, [AgentNode]}]}]},
+ MasterAgentVerbosity = {agent_verbosity, trace},
+ MibsVerbosity = {mib_server, [{verbosity, trace}]},
+ SymStoreVerbosity = {symbolic_store, [{verbosity, trace}]},
+ Opts = [MibStorage,
+ MasterAgentVerbosity,
+ MibsVerbosity,
+ SymStoreVerbosity],
+ [{vsn, v1}, {agent_opts, Opts} | Config].
finish_mib_storage_ets(Config) when is_list(Config) ->
?LOG("finish_mib_storage_ets -> entry", []),
@@ -800,7 +1239,7 @@ mse_simple(X) -> ?P(mse_simple), simple(X).
mse_v1_processing(X) -> ?P(mse_v1_processing), v1_processing(X).
mse_big(X) -> ?P(mse_big), big(X).
mse_big2(X) -> ?P(mse_big2), big2(X).
-mse_loop_mib(X) -> ?P(mse_loop_mib), loop_mib(X).
+mse_loop_mib(X) -> ?P(mse_loop_mib), loop_mib_1(X).
mse_api(X) -> ?P(mse_api), api(X).
mse_sa_register(X) -> ?P(mse_sa_register), sa_register(X).
mse_v1_trap(X) -> ?P(mse_v1_trap), v1_trap(X).
@@ -821,7 +1260,7 @@ msd_simple(X) -> ?P(msd_simple), simple(X).
msd_v1_processing(X) -> ?P(msd_v1_processing), v1_processing(X).
msd_big(X) -> ?P(msd_big), big(X).
msd_big2(X) -> ?P(msd_big2), big2(X).
-msd_loop_mib(X) -> ?P(msd_loop_mib), loop_mib(X).
+msd_loop_mib(X) -> ?P(msd_loop_mib), loop_mib_1(X).
msd_api(X) -> ?P(msd_api), api(X).
msd_sa_register(X) -> ?P(msd_sa_register), sa_register(X).
msd_v1_trap(X) -> ?P(msd_v1_trap), v1_trap(X).
@@ -842,7 +1281,7 @@ msm_simple(X) -> ?P(msm_simple), simple(X).
msm_v1_processing(X) -> ?P(msm_v1_processing), v1_processing(X).
msm_big(X) -> ?P(msm_big2), big(X).
msm_big2(X) -> ?P(msm_loop_mib), big2(X).
-msm_loop_mib(X) -> ?P(msm_loop_mib), loop_mib(X).
+msm_loop_mib(X) -> ?P(msm_loop_mib), loop_mib_1(X).
msm_api(X) -> ?P(msm_api), api(X).
msm_sa_register(X) -> ?P(msm_sa_register), sa_register(X).
msm_v1_trap(X) -> ?P(msm_v1_trap), v1_trap(X).
@@ -968,10 +1407,10 @@ varm_mib_start(Config) when is_list(Config) ->
%% Perform the test(s)
?DBG("varm_mib_start -> perform the tests", []),
- try_test(snmp_community_mib),
- try_test(snmp_framework_mib),
- try_test(snmp_target_mib),
- try_test(snmp_notification_mib),
+ try_test(snmp_community_mib_test),
+ try_test(snmp_framework_mib_test),
+ try_test(snmp_target_mib_test),
+ try_test(snmp_notification_mib_test),
%% Stop the agent (without deleting the stored files)
?DBG("varm_mib_start -> stop the agent", []),
@@ -1131,7 +1570,11 @@ finish_misc(Config) ->
finish_v1(Config).
misc_cases() ->
-[app_info, info_test].
+ [
+ app_info,
+ info_test,
+ create_local_db_dir
+ ].
app_info(suite) -> [];
app_info(Config) when is_list(Config) ->
@@ -1147,11 +1590,11 @@ app_info(Config) when is_list(Config) ->
false ->
"undefined"
end,
- io:format("Root dir: ~s~n"
- "SNMP: Application dir: ~s~n"
- " Application ver: ~s~n"
- "SSL: Application dir: ~s~n"
- "CRYPTO: Application dir: ~s~n",
+ io:format("Root dir: ~ts~n"
+ "SNMP: Application dir: ~ts~n"
+ " Application ver: ~ts~n"
+ "SSL: Application dir: ~ts~n"
+ "CRYPTO: Application dir: ~ts~n",
[code:root_dir(), SnmpDir, AppVsn, SslDir, CryptoDir]),
ok.
@@ -1163,9 +1606,78 @@ app_dir(App) ->
"undefined"
end.
+create_local_db_dir(Config) when is_list(Config) ->
+ ?P(create_local_db_dir),
+ DataDir = snmp_test_lib:lookup(data_dir, Config),
+ UName = erlang:unique_integer([positive]),
+ T = {UName, UName, UName},
+ [As,Bs,Cs] = [integer_to_list(I) || I <- tuple_to_list(T)],
+ DbDir = filename:join([DataDir, As, Bs, Cs]),
+ ok = del_dir(DbDir, 3),
+ Name = list_to_atom(atom_to_list(create_local_db_dir)
+ ++"-"++As++"-"++Bs++"-"++Cs),
+ Pa = filename:dirname(code:which(?MODULE)),
+ {ok,Node} = ?t:start_node(Name, slave, [{args, "-pa "++Pa}]),
+
+ %% first start with a nonexisting DbDir
+ Fun1 = fun() ->
+ false = filelib:is_dir(DbDir),
+ process_flag(trap_exit,true),
+ {error, {error, {failed_open_dets, {file_error, _, _}}}} =
+ snmpa_local_db:start_link(normal, DbDir, [{verbosity,trace}]),
+ false = filelib:is_dir(DbDir),
+ {ok, not_found}
+ end,
+ {ok, not_found} = nodecall(Node, Fun1),
+ %% now start with a nonexisting DbDir but pass the
+ %% create_local_db_dir option as well
+ Fun2 = fun() ->
+ false = filelib:is_dir(DbDir),
+ process_flag(trap_exit,true),
+ {ok, _Pid} =
+ snmpa_local_db:start_link(normal, DbDir,
+ create_db_and_dir, [{verbosity,trace}]),
+ snmpa_local_db:stop(),
+ true = filelib:is_dir(DbDir),
+ {ok, found}
+ end,
+ {ok, found} = nodecall(Node, Fun2),
+ %% cleanup
+ ?t:stop_node(Node),
+ ok = del_dir(DbDir, 3),
+ ok.
+nodecall(Node, Fun) ->
+ Parent = self(),
+ Ref = make_ref(),
+ spawn_link(Node,
+ fun() ->
+ Res = Fun(),
+ unlink(Parent),
+ Parent ! {Ref, Res}
+ end),
+ receive
+ {Ref, Res} ->
+ Res
+ end.
+
+del_dir(_Dir, 0) ->
+ ok;
+del_dir(Dir, Depth) ->
+ case filelib:is_dir(Dir) of
+ true ->
+ {ok, Files} = file:list_dir(Dir),
+ lists:map(fun(F) ->
+ Nm = filename:join(Dir,F),
+ ok = file:delete(Nm)
+ end, Files),
+ ok = file:del_dir(Dir),
+ del_dir(filename:dirname(Dir), Depth-1);
+ false ->
+ ok
+ end.
-%v1_cases() -> [loop_mib];
+%v1_cases() -> [loop_mib_1];
v1_cases() ->
[
simple,
@@ -1173,7 +1685,7 @@ v1_cases() ->
v1_processing,
big,
big2,
- loop_mib,
+ loop_mib_1,
api,
subagent,
mnesia,
@@ -1191,14 +1703,40 @@ v1_cases() ->
change_target_addr_config
].
+v1_cases_ipv6() ->
+ [
+ simple,
+ v1_processing,
+ loop_mib_1,
+%% big,
+%% big2,
+ api,
+ subagent,
+%% mnesia,
+%% {group, multiple_reqs},
+ sa_register,
+%% v1_trap, % sends v1 trap
+%% sa_error,
+ next_across_sa,
+ undo,
+%% {group, reported_bugs},
+ {group, standard_mibs_ipv6},
+ sparse_table,
+%% cnt_64, % sends v1 trap
+ opaque
+%% change_target_addr_config % sends v1 trap
+ ].
+
init_v1(Config) when is_list(Config) ->
?line SaNode = ?config(snmp_sa, Config),
?line create_tables(SaNode),
?line AgentConfDir = ?config(agent_conf_dir, Config),
?line MgrDir = ?config(mgr_dir, Config),
?line Ip = ?config(ip, Config),
- ?line config([v1], MgrDir, AgentConfDir,
- tuple_to_list(Ip), tuple_to_list(Ip)),
+ ?line IpFamily = config_ipfamily(Config),
+ ?line config(
+ [v1], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip), IpFamily),
[{vsn, v1} | start_v1_agent(Config)].
finish_v1(Config) when is_list(Config) ->
@@ -1235,14 +1773,43 @@ v2_cases() ->
v2_caps
].
+v2_cases_ipv6() ->
+ [
+ simple_2,
+ v2_processing,
+%% big_2,
+%% big2_2,
+ loop_mib_2,
+ api_2,
+ subagent_2,
+%% mnesia_2,
+%% {group, multiple_reqs_2},
+ sa_register_2,
+ v2_trap,
+ {group, v2_inform},
+%% sa_error_2,
+ next_across_sa_2,
+ undo_2,
+%% {group, reported_bugs_2},
+ {group, standard_mibs_2},
+ v2_types,
+ implied,
+ sparse_table_2,
+ cnt_64_2,
+ opaque_2,
+ v2_caps
+ ].
+
init_v2(Config) when is_list(Config) ->
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
AgentConfDir = ?config(agent_conf_dir, Config),
MgrDir = ?config(mgr_dir, Config),
Ip = ?config(ip, Config),
- config([v2], MgrDir, AgentConfDir,
- tuple_to_list(Ip), tuple_to_list(Ip)),
+ IpFamily = config_ipfamily(Config),
+ config(
+ [v2], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip), IpFamily),
[{vsn, v2} | start_v2_agent(Config)].
finish_v2(Config) when is_list(Config) ->
@@ -1261,8 +1828,9 @@ init_v1_v2(Config) when is_list(Config) ->
AgentConfDir = ?config(agent_conf_dir, Config),
MgrDir = ?config(mgr_dir, Config),
Ip = ?config(ip, Config),
+ IpFamily = config_ipfamily(Config),
config([v1,v2], MgrDir, AgentConfDir,
- tuple_to_list(Ip), tuple_to_list(Ip)),
+ tuple_to_list(Ip), tuple_to_list(Ip), IpFamily),
[{vsn, bilingual} | start_bilingual_agent(Config)].
finish_v1_v2(Config) when is_list(Config) ->
@@ -1282,10 +1850,10 @@ v3_cases() ->
subagent_3,
mnesia_3,
loop_mib_3,
- multiple_reqs_3,
+ {group, multiple_reqs_3},
sa_register_3,
v3_trap,
- v3_inform,
+ {group, v3_inform},
sa_error_3,
next_across_sa_3,
undo_3,
@@ -1300,35 +1868,65 @@ v3_cases() ->
v2_caps_3
].
+v3_cases_ipv6() ->
+ [
+ simple_3,
+ v3_processing,
+%% big_3,
+%% big2_3,
+ api_3,
+ subagent_3,
+%% mnesia_3,
+ loop_mib_3,
+%% {group, multiple_reqs_3},
+ sa_register_3,
+ v3_trap,
+ {group, v3_inform},
+%% sa_error_3,
+ next_across_sa_3,
+ undo_3,
+%% {group, reported_bugs_3},
+ {group, standard_mibs_3},
+ {group, v3_security},
+ v2_types_3,
+ implied_3,
+ sparse_table_3,
+ cnt_64_3,
+ opaque_3,
+ v2_caps_3
+ ].
+
init_v3(Config) when is_list(Config) ->
%% Make sure crypto works, otherwise start_agent will fail
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
AgentConfDir = ?config(agent_conf_dir, Config),
MgrDir = ?config(mgr_dir, Config),
Ip = ?config(ip, Config),
- ?line ok = config([v3], MgrDir, AgentConfDir,
- tuple_to_list(Ip), tuple_to_list(Ip)),
- [{vsn, v3} | start_v3_agent(Config)].
+ IpFamily = config_ipfamily(Config),
+ ?line ok =
+ config(
+ [v3], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip), IpFamily),
+ Opts =
+ [{master_agent_verbosity, trace},
+ {agent_verbosity, trace},
+ {net_if_verbosity, trace}],
+ [{vsn, v3} | start_v3_agent(Config, Opts)].
finish_v3(Config) when is_list(Config) ->
delete_tables(),
@@ -1367,19 +1965,19 @@ init_case(Config) ->
load_master(Mib) ->
?DBG("load_master -> entry with"
"~n Mib: ~p", [Mib]),
- snmpa:unload_mibs(snmp_master_agent, [Mib]), % Unload for safety
- ok = snmpa:load_mibs(snmp_master_agent, [get(mib_dir) ++ Mib]).
+ snmpa:unload_mib(snmp_master_agent, Mib), % Unload for safety
+ ok = snmpa:load_mib(snmp_master_agent, join(get(mib_dir), Mib)).
load_master_std(Mib) ->
?DBG("load_master_std -> entry with"
"~n Mib: ~p", [Mib]),
- snmpa:unload_mibs(snmp_master_agent, [Mib]), % Unload for safety
- ok = snmpa:load_mibs(snmp_master_agent, [get(std_mib_dir) ++ Mib]).
+ snmpa:unload_mib(snmp_master_agent, Mib), % Unload for safety
+ ok = snmpa:load_mib(snmp_master_agent, join(get(std_mib_dir), Mib)).
unload_master(Mib) ->
?DBG("unload_master -> entry with"
"~n Mib: ~p", [Mib]),
- ok = snmpa:unload_mibs(snmp_master_agent, [Mib]).
+ ok = snmpa:unload_mib(snmp_master_agent, Mib).
loaded_mibs() ->
?DBG("loaded_mibs -> entry",[]),
@@ -1643,7 +2241,7 @@ change_target_addr_config(Config) when is_list(Config) ->
dummy_manager_start(MA) ->
?DBG("dummy_manager_start -> entry",[]),
- Pid = spawn(get(mgr_node), ?MODULE,dummy_manager_init,[self(),MA]),
+ Pid = spawn(get(mgr_node), ?MODULE, dummy_manager_init, [self(), MA]),
?DBG("dummy_manager_start -> Pid: ~p",[Pid]),
await_dummy_manager_started(Pid).
@@ -1655,9 +2253,9 @@ await_dummy_manager_started(Pid) ->
{ok,Pid,Port};
{'EXIT', Pid, Reason} ->
{error, Pid, Reason};
- O ->
+ _O ->
?LOG("dummy_manager_start -> received unknown message:"
- "~n ~p",[O]),
+ "~n ~p",[_O]),
await_dummy_manager_started(Pid)
end.
@@ -1680,16 +2278,16 @@ dummy_manager_send_trap2(Pid) ->
dummy_manager_await_trap2_ack() ->
?DBG("dummy_manager_await_trap2 -> entry",[]),
receive
- {received_trap,Trap} ->
- ?LOG("dummy_manager_await_trap2 -> received trap: ~p",[Trap]),
+ {received_trap, _Trap} ->
+ ?LOG("dummy_manager_await_trap2 -> received trap: ~p", [_Trap]),
%% Note:
%% Without this sleep the v2_inform_i testcase failes! There
%% is no relation between these two test cases as far as I
%% able to figure out...
?SLEEP(60000),
ok;
- O ->
- ?ERR("dummy_manager_await_trap2 -> unexpected message: ~p",[O]),
+ _O ->
+ ?ERR("dummy_manager_await_trap2 -> unexpected message: ~p",[_O]),
ok
after 10000 ->
?ERR("dummy_manager_await_trap2 -> timeout",[]),
@@ -1715,32 +2313,34 @@ dummy_manager_loop(P,S,MA) ->
"~n Trap: ~p",[Trap]),
snmpa:send_trap(MA, Trap, "standard trap"),
dummy_manager_loop(P,S,MA);
- {udp, _UdpId, Ip, UdpPort, Bytes} ->
+ {udp, _UdpId, _Ip, _UdpPort, Bytes} ->
?LOG("dummy_manager_loop -> received upd message"
"~n from: ~p:~p"
"~n size: ~p",
- [Ip, UdpPort, dummy_manager_message_sz(Bytes)]),
+ [_Ip, _UdpPort, dummy_manager_message_sz(Bytes)]),
R = dummy_manager_handle_message(Bytes),
- ?DBG("dummy_manager_loop -> R: ~p",[R]),
+ ?DBG("dummy_manager_loop -> R: ~p", [R]),
P ! R,
- dummy_manager_loop(P,S,MA);
+ dummy_manager_loop(P, S, MA);
stop ->
?DBG("dummy_manager_loop -> received stop request",[]),
P ! {dummy_manager_stopping, self()},
gen_udp:close(S),
exit(normal);
- O ->
+ _O ->
?LOG("dummy_manager_loop -> received unknown message:"
- "~n ~p",[O]),
- dummy_manager_loop(P,S,MA)
+ "~n ~p", [_O]),
+ dummy_manager_loop(P, S, MA)
end.
+-ifdef(snmp_log).
dummy_manager_message_sz(B) when is_binary(B) ->
size(B);
dummy_manager_message_sz(L) when is_list(L) ->
length(L);
dummy_manager_message_sz(_) ->
undefined.
+-endif.
dummy_manager_handle_message(Bytes) ->
case (catch snmp_pdus:dec_message(Bytes)) of
@@ -1784,11 +2384,11 @@ subagent(Config) when is_list(Config) ->
try_test(unreg_test),
?P1("Loading previous subagent mib in master and testing..."),
- ?line ok = snmpa:load_mibs(MA, [MibDir ++ "Klas1"]),
+ ?line ok = snmpa:load_mib(MA, join(MibDir, "Klas1")),
try_test(load_test),
?P1("Unloading previous subagent mib in master and testing..."),
- ?line ok = snmpa:unload_mibs(MA, [MibDir ++ "Klas1"]),
+ ?line ok = snmpa:unload_mib(MA, join(MibDir, "Klas1")),
try_test(unreg_test),
?P1("Testing register subagent..."),
rpc:call(SaNode, snmp, register_subagent,
@@ -1835,23 +2435,37 @@ mnesia_2(X) -> ?P(mnesia_2), mnesia(X).
mnesia_3(X) -> ?P(mnesia_3), mnesia(X).
-
mul_cases() ->
-[mul_get, mul_get_err, mul_next, mul_next_err,
- mul_set_err].
-
-
-multiple_reqs_3(_X) ->
- {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}.
+ [
+ mul_get,
+ mul_get_err,
+ mul_next,
+ mul_next_err,
+ mul_set,
+ mul_set_err
+ ].
mul_cases_2() ->
-[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2,
- mul_set_err_2].
-
+ [
+ mul_get_2,
+ mul_get_err_2,
+ mul_next_2,
+ mul_next_err_2,
+ mul_set_2,
+ mul_set_err_2
+ ].
+
mul_cases_3() ->
- [mul_get_3, mul_get_err_3, mul_next_3, mul_next_err_3, mul_set_err_3].
+ [
+ mul_get_3,
+ mul_get_err_3,
+ mul_next_3,
+ mul_next_err_3,
+ mul_set_3,
+ mul_set_err_3
+ ].
init_mul(Config) when is_list(Config) ->
@@ -1966,11 +2580,11 @@ sa_register(Config) when is_list(Config) ->
?P1("Unloading Klas1..."),
?DBG("sa_register -> unload mibs", []),
- snmpa:unload_mibs(SA, [MibDir ++ "Klas1"]),
+ snmpa:unload_mib(SA, join(MibDir, "Klas1")),
?P1("Loading SA-MIB..."),
?DBG("sa_register -> unload mibs", []),
- snmpa:load_mibs(SA, [MibDir ++ "SA-MIB"]),
+ snmpa:load_mib(SA, join(MibDir, "SA-MIB")),
?P1("register subagent..."),
?DBG("sa_register -> register subagent", []),
@@ -2073,27 +2687,32 @@ v3_trap(Config) when is_list(Config) ->
trap2(Config).
-v3_inform(_X) ->
- %% v2_inform(X).
- {req, [], {conf, init_v3_inform, [v3_inform_i], finish_v3_inform}}.
+v3_inform_cases() ->
+ [
+ v3_inform_i
+ ].
+
+init_v3_inform(X) ->
+ init_v2_inform(X).
+
+finish_v3_inform(X) ->
+ finish_v2_inform(X).
+
init_v2_inform(Config) when is_list(Config) ->
_Dir = ?config(agent_conf_dir, Config),
%% snmp_internal_mib:configure(Dir),
Config.
-init_v3_inform(X) ->
- init_v2_inform(X).
-
finish_v2_inform(Config) when is_list(Config) ->
_Dir = ?config(agent_conf_dir, Config),
%% snmp_internal_mib:configure(Dir),
Config.
-finish_v3_inform(X) ->
- finish_v2_inform(X).
-
-
+v2_inform_cases() ->
+ [
+ v2_inform_i
+ ].
v2_inform_i(suite) -> [];
v2_inform_i(Config) when is_list(Config) ->
@@ -2184,7 +2803,7 @@ next_across_sa(Config) when is_list(Config) ->
?line {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"),
?P1("Loading another subagent mib (Klas1)..."),
- ?line ok = snmpa:load_mibs(SA, [MibDir ++ "Klas1"]),
+ ?line ok = snmpa:load_mib(SA, MibDir ++ "Klas1"),
?P1("register subagent..."),
rpc:call(SaNode, snmp, register_subagent, [MA, ?klas1, SA]),
@@ -2193,17 +2812,17 @@ next_across_sa(Config) when is_list(Config) ->
try_test(load_test_sa),
?P1("Testing next across subagent (endOfMibView from SA)..."),
- try_test(next_across_sa),
+ try_test(next_across_sa_test),
?P1("Unloading mib (Klas1)"),
- snmpa:unload_mibs(SA, [MibDir ++ "Klas1"]),
+ snmpa:unload_mib(SA, join(MibDir, "Klas1")),
rpc:call(SaNode, snmp, unregister_subagent, [MA, ?klas1]),
try_test(unreg_test),
?P1("Starting another subagent (2) "),
?line {ok, SA2} = start_subagent(SaNode, ?klas1, "Klas1"),
?P1("Testing next across subagent (wrong prefix from SA)..."),
- try_test(next_across_sa),
+ try_test(next_across_sa_test),
?P1("stop subagent (1)..."),
stop_subagent(SA),
@@ -2237,25 +2856,25 @@ undo(Config) when is_list(Config) ->
?line {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"),
?P1("Load Klas3 & Klas4..."),
- ?line ok = snmpa:load_mibs(MA, [MibDir ++ "Klas3"]),
- ?line ok = snmpa:load_mibs(MA, [MibDir ++ "Klas4"]),
+ ?line ok = snmpa:load_mib(MA, join(MibDir, "Klas3")),
+ ?line ok = snmpa:load_mib(MA, join(MibDir, "Klas4")),
?P1("Testing undo phase at master agent..."),
try_test(undo_test),
try_test(api_test2),
?P1("Unload Klas3..."),
- ?line ok = snmpa:unload_mibs(MA, [MibDir ++ "Klas3"]),
+ ?line ok = snmpa:unload_mib(MA, join(MibDir, "Klas3")),
?P1("Testing bad return values from instrum. funcs..."),
try_test(bad_return),
?P1("Unload Klas4..."),
- ?line ok = snmpa:unload_mibs(MA, [MibDir ++ "Klas4"]),
+ ?line ok = snmpa:unload_mib(MA, join(MibDir, "Klas4")),
?P1("Testing undo phase at subagent..."),
- ?line ok = snmpa:load_mibs(SA, [MibDir ++ "Klas3"]),
- ?line ok = snmpa:load_mibs(SA, [MibDir ++ "Klas4"]),
+ ?line ok = snmpa:load_mib(SA, join(MibDir, "Klas3")),
+ ?line ok = snmpa:load_mib(SA, join(MibDir, "Klas4")),
?line ok = snmpa:register_subagent(MA, ?klas3, SA),
?line ok = snmpa:register_subagent(MA, ?klas4, SA),
try_test(undo_test),
@@ -2332,6 +2951,15 @@ v3_processing(Config) when is_list(Config) ->
%% report, which makes it in sync. The notification-generating
%% application times out, and send again. This time it'll work.
+v3_security_cases() ->
+ [
+ v3_crypto_basic,
+ v3_md5_auth,
+ v3_sha_auth,
+ v3_des_priv
+ ].
+
+
v3_crypto_basic(suite) -> [];
v3_crypto_basic(_Config) ->
?P(v3_crypto_basic),
@@ -2470,9 +3098,9 @@ v3_des_priv(Config) when is_list(Config) ->
v3_sync(Funcs) ->
?DBG("v3_sync -> entry with Funcs: ~p",[Funcs]),
g([[sysDescr, 0]]),
- expect(432, report, [{?usmStatsNotInTimeWindows_instance, any}]),
+ ?expect2(report, [{?usmStatsNotInTimeWindows_instance, any}]),
g([[sysDescr, 0]]),
- expect(433, [{[sysDescr,0], any}]),
+ ?expect1([{[sysDescr,0], any}]),
lists:foreach(fun({Func, Args}) -> apply(?MODULE, Func, Args) end, Funcs).
v3_inform_sync(MA) ->
@@ -2483,9 +3111,9 @@ v3_inform_sync(MA) ->
?DBG("v3_sync -> wait some time: ",[]),
?SLEEP(20000), % more than 1500*10 in target_addr.conf
?DBG("v3_sync -> await response",[]),
- ?line expect(1, {inform, true},
- [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?system ++ [0,1]}]).
+ ?line ?expect2({inform, true},
+ [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?system ++ [0,1]}]).
v2_caps(suite) -> [];
@@ -2501,11 +3129,11 @@ v2_caps_3(X) -> ?P(v2_caps_3), v2_caps(X).
v2_caps_i(Node) ->
?line Idx = rpc:call(Node, snmp, add_agent_caps, [[1,2,3,4,5], "test cap"]),
g([[sysORID, Idx], [sysORDescr, Idx]]),
- ?line expect(1, [{[sysORID, Idx], [1,2,3,4,5]},
- {[sysORDescr, Idx], "test cap"}]),
+ ?line ?expect1([{[sysORID, Idx], [1,2,3,4,5]},
+ {[sysORDescr, Idx], "test cap"}]),
?line rpc:call(Node, snmp, del_agent_caps, [Idx]),
g([[sysORID, Idx]]),
- ?line expect(2, [{[sysORID, Idx], noSuchInstance}]).
+ ?line ?expect1([{[sysORID, Idx], noSuchInstance}]).
%% Req. Test2
@@ -2521,86 +3149,85 @@ v1_proc() ->
v1_get_p() ->
%% 4.1.2:1
g([[test2]]),
- ?line expect(10, noSuchName, 1, [{[test2], 'NULL'}]),
+ ?line ?expect3(noSuchName, 1, [{[test2], 'NULL'}]),
g([[tDescr]]),
- ?line expect(11, noSuchName, 1, [{[tDescr], 'NULL'}]),
+ ?line ?expect3(noSuchName, 1, [{[tDescr], 'NULL'}]),
g([[tDescr2,0]]),
- ?line expect(12, noSuchName, 1, [{[tDescr2,0], 'NULL'}]),
+ ?line ?expect3(noSuchName, 1, [{[tDescr2,0], 'NULL'}]),
g([[tDescr3,0]]),
- ?line expect(131, noSuchName, 1, [{[tDescr3,0], 'NULL'}]),
+ ?line ?expect3(noSuchName, 1, [{[tDescr3,0], 'NULL'}]),
g([[tDescr4,0]]),
- ?line expect(132, noSuchName, 1, [{[tDescr4,0], 'NULL'}]),
+ ?line ?expect3(noSuchName, 1, [{[tDescr4,0], 'NULL'}]),
g([[sysDescr, 0], [tDescr,0]]), % Outside mibview
- ?line expect(14, noSuchName, 2, [{[sysDescr, 0], 'NULL'},
- {[tDescr,0], 'NULL'}]),
+ ?line ?expect3(noSuchName, 2, [{[sysDescr, 0], 'NULL'},
+ {[tDescr,0], 'NULL'}]),
g([[sysDescr,3]]),
- ?line expect(15, noSuchName, 1, [{[sysDescr, 3], 'NULL'}]),
+ ?line ?expect3(noSuchName, 1, [{[sysDescr, 3], 'NULL'}]),
%% 4.1.2:2
g([[tTable]]),
- ?line expect(20, noSuchName, 1, [{[tTable], 'NULL'}]),
+ ?line ?expect3(noSuchName, 1, [{[tTable], 'NULL'}]),
g([[tEntry]]),
- ?line expect(21, noSuchName, 1, [{[tEntry], 'NULL'}]),
+ ?line ?expect3(noSuchName, 1, [{[tEntry], 'NULL'}]),
%% 4.1.2:3
g([[tTooBig, 0]]),
- ?line expect(30, tooBig, 0, [{[tTooBig, 0], 'NULL'}]),
+ ?line ?expect3(tooBig, 0, [{[tTooBig, 0], 'NULL'}]),
%% 4.1.2:4
g([[tGenErr1, 0]]),
- ?line expect(40, genErr, 1, [{[tGenErr1, 0], 'NULL'}]),
+ ?line ?expect3(genErr, 1, [{[tGenErr1, 0], 'NULL'}]),
g([[tGenErr2, 0]]),
- ?line expect(41, genErr, 1, [{[tGenErr2, 0], 'NULL'}]),
+ ?line ?expect3(genErr, 1, [{[tGenErr2, 0], 'NULL'}]),
g([[sysDescr, 0], [tGenErr3, 0]]),
- ?line expect(42, genErr, 2, [{[sysDescr, 0], 'NULL'},
- {[tGenErr3, 0], 'NULL'}]).
+ ?line ?expect3(genErr, 2, [{[sysDescr, 0], 'NULL'},
+ {[tGenErr3, 0], 'NULL'}]).
v1_get_next_p() ->
%% 4.1.3:1
gn([[1,3,7,1]]),
- ?line expect(10, noSuchName, 1, [{[1,3,7,1], 'NULL'}]),
+ ?line ?expect3(noSuchName, 1, [{[1,3,7,1], 'NULL'}]),
gn([[tDescr2]]),
- ?line expect(11, tooBig, 0, any),
+ ?line ?expect3(tooBig, 0, any),
%% 4.1.3:2
gn([[tTooBig]]),
io:format("We currently don't handle tooBig correct!!!\n"),
-% ?line expect(20, tooBig, 0, [{[tTooBig], 'NULL'}]),
- ?line expect(20, tooBig, 0, any),
+
+ ?line ?expect3(tooBig, 0, any),
%% 4.1.3:3
gn([[tGenErr1]]),
-% ?line expect(40, genErr, 1, [{[tGenErr1], 'NULL'}]),
- ?line expect(40, genErr, 1, any),
+
+ ?line ?expect3(genErr, 1, any),
gn([[tGenErr2]]),
-% ?line expect(41, genErr, 1, [{[tGenErr2], 'NULL'}]),
- ?line expect(41, genErr, 1, any),
+
+ ?line ?expect3(genErr, 1, any),
gn([[sysDescr], [tGenErr3]]),
-% ?line expect(42, genErr, 2, [{[sysDescr], 'NULL'},
-% {[tGenErr3], 'NULL'}]).
- ?line expect(42, genErr, 2, any).
+
+ ?line ?expect3(genErr, 2, any).
v1_set_p() ->
%% 4.1.5:1
s([{[1,3,7,0], i, 4}]),
- ?line expect(10, noSuchName, 1, [{[1,3,7,0], 4}]),
+ ?line ?expect3(noSuchName, 1, [{[1,3,7,0], 4}]),
s([{[tDescr,0], s, "outside mibview"}]),
- ?line expect(11, noSuchName, 1, [{[tDescr,0], "outside mibview"}]),
+ ?line ?expect3(noSuchName, 1, [{[tDescr,0], "outside mibview"}]),
s([{[tDescr3,0], s, "read-only"}]),
- ?line expect(12, noSuchName, 1, [{[tDescr3,0], "read-only"}]),
+ ?line ?expect3(noSuchName, 1, [{[tDescr3,0], "read-only"}]),
s([{[tDescr3], s, "noSuchObject"}]),
- ?line expect(13, noSuchName, 1, [{[tDescr3], "noSuchObject"}]),
+ ?line ?expect3(noSuchName, 1, [{[tDescr3], "noSuchObject"}]),
s([{[tDescr3,1], s, "noSuchInstance"}]),
- ?line expect(14, noSuchName, 1, [{[tDescr3,1], "noSuchInstance"}]),
+ ?line ?expect3(noSuchName, 1, [{[tDescr3,1], "noSuchInstance"}]),
s([{[tDescr2,0], s, "inconsistentName"}]),
- ?line expect(15, noSuchName, 1, [{[tDescr2,0], "inconsistentName"}]),
+ ?line ?expect3(noSuchName, 1, [{[tDescr2,0], "inconsistentName"}]),
%% 4.1.5:2
s([{[tDescr2, 0], i, 4}]),
- ?line expect(20, badValue, 1, [{[tDescr2, 0], 4}]),
+ ?line ?expect3(badValue, 1, [{[tDescr2, 0], 4}]),
s([{[tDescr2, 0], s, "badValue"}]),
- ?line expect(21, badValue, 1, [{[tDescr2, 0], "badValue"}]),
+ ?line ?expect3(badValue, 1, [{[tDescr2, 0], "badValue"}]),
%% 4.1.5:3
%% The standard is quite incorrect here. The resp pdu was too big. In
@@ -2610,14 +3237,14 @@ v1_set_p() ->
%% of the std-like original value.
s([{[tTooBig, 0], s, ?tooBigStr}]),
%% according to std:
-% ?line expect(30, tooBig, 0, [{[tTooBig, 0], ?tooBigStr}]),
- ?line expect(30, tooBig, 0, [{[tTooBig, 0], 'NULL'}]),
+% ?line ?expect3(tooBig, 0, [{[tTooBig, 0], ?tooBigStr}]),
+ ?line ?expect3(tooBig, 0, [{[tTooBig, 0], 'NULL'}]),
%% 4.1.5:4
s([{[tDescr2, 0], s, "is_set_ok_fail"}]),
- ?line expect(40, genErr, 1, [{[tDescr2, 0], "is_set_ok_fail"}]),
+ ?line ?expect3(genErr, 1, [{[tDescr2, 0], "is_set_ok_fail"}]),
s([{[tDescr2, 0], s, "commit_fail"}]),
- ?line expect(41, genErr, 1, [{[tDescr2, 0], "commit_fail"}]).
+ ?line ?expect3(genErr, 1, [{[tDescr2, 0], "commit_fail"}]).
%% Req. Test2
v2_proc() ->
@@ -2633,183 +3260,183 @@ v2_get_p() ->
%% 4.2.1:2
?DBG("v2_get_p -> entry",[]),
g([[test2]]),
- ?line expect(10, [{[test2], noSuchObject}]),
+ ?line ?expect1([{[test2], noSuchObject}]),
g([[tDescr]]),
- ?line expect(11, [{[tDescr], noSuchObject}]),
+ ?line ?expect1([{[tDescr], noSuchObject}]),
g([[tDescr4,0]]),
- ?line expect(12, [{[tDescr4,0], noSuchObject}]),
+ ?line ?expect1([{[tDescr4,0], noSuchObject}]),
g([[sysDescr, 0], [tDescr,0]]), % Outside mibview
- ?line expect(13, [{[sysDescr,0], "Erlang SNMP agent"},
- {[tDescr,0], noSuchObject}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"},
+ {[tDescr,0], noSuchObject}]),
g([[tTable]]),
- ?line expect(14, [{[tTable], noSuchObject}]),
+ ?line ?expect1([{[tTable], noSuchObject}]),
g([[tEntry]]),
- ?line expect(15, [{[tEntry], noSuchObject}]),
+ ?line ?expect1([{[tEntry], noSuchObject}]),
%% 4.2.1:3
g([[tDescr2,0]]), %% instrum ret noSuchName!!!
- ?line expect(20, [{[tDescr2,0], noSuchInstance}]),
+ ?line ?expect1([{[tDescr2,0], noSuchInstance}]),
g([[tDescr3,0]]),
- ?line expect(21, [{[tDescr3,0], noSuchInstance}]),
+ ?line ?expect1([{[tDescr3,0], noSuchInstance}]),
g([[sysDescr,3]]),
- ?line expect(22, [{[sysDescr, 3], noSuchInstance}]),
+ ?line ?expect1([{[sysDescr, 3], noSuchInstance}]),
g([[tIndex,1]]),
- ?line expect(23, [{[tIndex, 1], noSuchInstance}]),
+ ?line ?expect1([{[tIndex, 1], noSuchInstance}]),
%% 4.2.1 - any other error: genErr
g([[tGenErr1, 0]]),
- ?line expect(30, genErr, 1, [{[tGenErr1, 0], 'NULL'}]),
+ ?line ?expect3(genErr, 1, [{[tGenErr1, 0], 'NULL'}]),
g([[tGenErr2, 0]]),
- ?line expect(31, genErr, 1, [{[tGenErr2, 0], 'NULL'}]),
+ ?line ?expect3(genErr, 1, [{[tGenErr2, 0], 'NULL'}]),
g([[sysDescr, 0], [tGenErr3, 0]]),
- ?line expect(32, genErr, 2, [{[sysDescr, 0], 'NULL'},
- {[tGenErr3, 0], 'NULL'}]),
+ ?line ?expect3(genErr, 2, [{[sysDescr, 0], 'NULL'},
+ {[tGenErr3, 0], 'NULL'}]),
%% 4.2.1 - tooBig
g([[tTooBig, 0]]),
- ?line expect(40, tooBig, 0, []).
+ ?line ?expect3(tooBig, 0, []).
v2_get_next_p() ->
%% 4.2.2:2
?DBG("v2_get_next_p -> entry",[]),
gn([[1,3,7,1]]),
- ?line expect(10, [{[1,3,7,1], endOfMibView}]),
+ ?line ?expect1([{[1,3,7,1], endOfMibView}]),
gn([[sysDescr], [1,3,7,1]]),
- ?line expect(11, [{[sysDescr, 0], "Erlang SNMP agent"},
- {[1,3,7,1], endOfMibView}]),
+ ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"},
+ {[1,3,7,1], endOfMibView}]),
gn([[tCnt2, 1]]),
- ?line expect(12, [{[tCnt2,2], 100}]),
+ ?line ?expect1([{[tCnt2,2], 100}]),
gn([[tCnt2, 2]]),
- ?line expect(12, [{[tCnt2,2], endOfMibView}]),
+ ?line ?expect1([{[tCnt2,2], endOfMibView}]),
%% 4.2.2 - any other error: genErr
gn([[tGenErr1]]),
- ?line expect(20, genErr, 1, [{[tGenErr1], 'NULL'}]),
+ ?line ?expect3(genErr, 1, [{[tGenErr1], 'NULL'}]),
gn([[tGenErr2]]),
- ?line expect(21, genErr, 1, [{[tGenErr2], 'NULL'}]),
+ ?line ?expect3(genErr, 1, [{[tGenErr2], 'NULL'}]),
gn([[sysDescr], [tGenErr3]]),
- ?line expect(22, genErr, 2, [{[sysDescr], 'NULL'},
- {[tGenErr3], 'NULL'}]),
+ ?line ?expect3(genErr, 2, [{[sysDescr], 'NULL'},
+ {[tGenErr3], 'NULL'}]),
%% 4.2.2 - tooBig
gn([[tTooBig]]),
- ?line expect(20, tooBig, 0, []).
+ ?line ?expect3(tooBig, 0, []).
v2_get_bulk_p() ->
%% 4.2.3
?DBG("v2_get_bulk_p -> entry",[]),
gb(1, 1, []),
- ?line expect(10, []),
+ ?line ?expect1([]),
gb(-1, 1, []),
- ?line expect(11, []),
+ ?line ?expect1([]),
gb(-1, -1, []),
- ?line expect(12, []),
+ ?line ?expect1([]),
gb(-1, -1, []),
- ?line expect(13, []),
+ ?line ?expect1([]),
gb(2, 0, [[sysDescr], [1,3,7,1]]),
- ?line expect(14, [{[sysDescr, 0], "Erlang SNMP agent"},
- {[1,3,7,1], endOfMibView}]),
+ ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"},
+ {[1,3,7,1], endOfMibView}]),
gb(1, 2, [[sysDescr], [1,3,7,1]]),
- ?line expect(15, [{[sysDescr, 0], "Erlang SNMP agent"},
- {[1,3,7,1], endOfMibView}]),
+ ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"},
+ {[1,3,7,1], endOfMibView}]),
gb(0, 2, [[sysDescr], [1,3,7,1]]),
- ?line expect(16, [{[sysDescr, 0], "Erlang SNMP agent"},
- {[1,3,7,1], endOfMibView},
- {[sysObjectID, 0], [1,2,3]},
- {[1,3,7,1], endOfMibView}]),
+ ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"},
+ {[1,3,7,1], endOfMibView},
+ {[sysObjectID, 0], [1,2,3]},
+ {[1,3,7,1], endOfMibView}]),
gb(2, 2, [[sysDescr], [1,3,7,1], [sysDescr], [1,3,7,1]]),
- ?line expect(17, [{[sysDescr, 0], "Erlang SNMP agent"},
- {[1,3,7,1], endOfMibView},
- {[sysDescr, 0], "Erlang SNMP agent"},
- {[1,3,7,1], endOfMibView},
- {[sysObjectID, 0], [1,2,3]},
- {[1,3,7,1], endOfMibView}]),
+ ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"},
+ {[1,3,7,1], endOfMibView},
+ {[sysDescr, 0], "Erlang SNMP agent"},
+ {[1,3,7,1], endOfMibView},
+ {[sysObjectID, 0], [1,2,3]},
+ {[1,3,7,1], endOfMibView}]),
gb(1, 2, [[sysDescr], [sysDescr], [tTooBig]]),
- ?line expect(18, [{[sysDescr, 0], "Erlang SNMP agent"},
- {[sysDescr, 0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"},
+ {[sysDescr, 0], "Erlang SNMP agent"}]),
gb(1,12, [[tDescr2], [sysDescr]]), % next one after tDescr2 is tTooBig.
- ?line expect(19, []),
+ ?line ?expect1([]),
gb(2,2, [[sysDescr], [sysObjectID], [tGenErr1], [sysDescr]]),
- ?line expect(20, genErr, 3, [{[sysDescr], 'NULL'},
- {[sysObjectID], 'NULL'},
- {[tGenErr1], 'NULL'},
- {[sysDescr], 'NULL'}]),
+ ?line ?expect3(genErr, 3, [{[sysDescr], 'NULL'},
+ {[sysObjectID], 'NULL'},
+ {[tGenErr1], 'NULL'},
+ {[sysDescr], 'NULL'}]),
gb(0, 2, [[tCnt2, 1]]),
- ?line expect(21, [{[tCnt2,2], 100},
- {[tCnt2,2], endOfMibView}]).
+ ?line ?expect1([{[tCnt2,2], 100},
+ {[tCnt2,2], endOfMibView}]).
v2_set_p() ->
%% 4.2.5:1
?DBG("v2_set_p -> entry",[]),
s([{[1,3,7,0], i, 4}]),
- ?line expect(10, noAccess, 1, [{[1,3,7,0], 4}]),
+ ?line ?expect3(noAccess, 1, [{[1,3,7,0], 4}]),
s([{[tDescr,0], s, "outside mibview"}]),
- ?line expect(11, noAccess, 1, [{[tDescr,0], "outside mibview"}]),
+ ?line ?expect3(noAccess, 1, [{[tDescr,0], "outside mibview"}]),
%% 4.2.5:2
s([{[1,3,6,1,0], s, "noSuchObject"}]),
- ?line expect(20, notWritable, 1, [{[1,3,6,1,0], "noSuchObject"}]),
+ ?line ?expect3(notWritable, 1, [{[1,3,6,1,0], "noSuchObject"}]),
%% 4.2.5:3
s([{[tDescr2, 0], i, 4}]),
- ?line expect(30, wrongType, 1, [{[tDescr2, 0], 4}]),
+ ?line ?expect3(wrongType, 1, [{[tDescr2, 0], 4}]),
s([{[tDescr2, 0], s, "badValue"}]),
- ?line expect(31, badValue, 1, [{[tDescr2, 0], "badValue"}]),
+ ?line ?expect3(badValue, 1, [{[tDescr2, 0], "badValue"}]),
%% 4.2.5:4
s([{[tStr, 0], s, ""}]),
- ?line expect(40, wrongLength, 1, [{[tStr, 0], ""}]),
+ ?line ?expect3(wrongLength, 1, [{[tStr, 0], ""}]),
s([{[tStr, 0], s, "12345"}]),
- ?line expect(40, wrongLength, 1, [{[tStr, 0], "12345"}]),
+ ?line ?expect3(wrongLength, 1, [{[tStr, 0], "12345"}]),
%% 4.2.5:5 - N/A
%% 4.2.5:6
s([{[tInt1, 0], i, 0}]),
- ?line expect(60, wrongValue, 1, [{[tInt1, 0], 0}]),
+ ?line ?expect3(wrongValue, 1, [{[tInt1, 0], 0}]),
s([{[tInt1, 0], i, 5}]),
- ?line expect(61, wrongValue, 1, [{[tInt1, 0], 5}]),
+ ?line ?expect3(wrongValue, 1, [{[tInt1, 0], 5}]),
s([{[tInt2, 0], i, 0}]),
- ?line expect(62, wrongValue, 1, [{[tInt2, 0], 0}]),
+ ?line ?expect3(wrongValue, 1, [{[tInt2, 0], 0}]),
s([{[tInt2, 0], i, 5}]),
- ?line expect(63, wrongValue, 1, [{[tInt2, 0], 5}]),
+ ?line ?expect3(wrongValue, 1, [{[tInt2, 0], 5}]),
s([{[tInt3, 0], i, 5}]),
- ?line expect(64, wrongValue, 1, [{[tInt3, 0], 5}]),
+ ?line ?expect3(wrongValue, 1, [{[tInt3, 0], 5}]),
%% 4.2.5:7
s([{[tDescrX, 1, 1], s, "noCreation"}]),
- ?line expect(70, noCreation, 1, [{[tDescrX, 1, 1], "noCreation"}]),
+ ?line ?expect3(noCreation, 1, [{[tDescrX, 1, 1], "noCreation"}]),
%% 4.2.5:8
s([{[tDescrX, 1, 2], s, "inconsistentName"}]),
- ?line expect(80, inconsistentName, 1,
- [{[tDescrX, 1, 2], "inconsistentName"}]),
+ ?line ?expect3(inconsistentName, 1,
+ [{[tDescrX, 1, 2], "inconsistentName"}]),
%% 4.2.5:9
s([{[tCnt, 1, 2], i, 5}]),
- ?line expect(90, notWritable, 1, [{[tCnt, 1, 2], 5}]),
+ ?line ?expect3(notWritable, 1, [{[tCnt, 1, 2], 5}]),
s([{[tDescr3,0], s, "read-only"}]),
- ?line expect(90, notWritable, 1, [{[tDescr3,0], "read-only"}]),
+ ?line ?expect3(notWritable, 1, [{[tDescr3,0], "read-only"}]),
%% 4.2.5:10
s([{[tDescr2,0], s, "inconsistentValue"}]),
- ?line expect(100, inconsistentValue, 1,
- [{[tDescr2,0], "inconsistentValue"}]),
+ ?line ?expect3(inconsistentValue, 1,
+ [{[tDescr2,0], "inconsistentValue"}]),
%% 4.2.5:11
s([{[tDescr2,0], s, "resourceUnavailable"}]),
- ?line expect(110, resourceUnavailable, 1,
- [{[tDescr2,0],"resourceUnavailable"}]),
+ ?line ?expect3(resourceUnavailable, 1,
+ [{[tDescr2,0],"resourceUnavailable"}]),
%% 4.2.5:12
s([{[tDescr2, 0], s, "is_set_ok_fail"}]),
- ?line expect(120, genErr, 1, [{[tDescr2, 0], "is_set_ok_fail"}]).
+ ?line ?expect3(genErr, 1, [{[tDescr2, 0], "is_set_ok_fail"}]).
%% commitFailed and undoFailed is tested by the 'undo' case.
@@ -2817,108 +3444,107 @@ v2_set_p() ->
%% Req. OLD-SNMPEA-MIB
table_test() ->
io:format("Testing simple get, next and set on communityTable...~n"),
-%% {[147,214,36,45], "public", 2, readWrite}.
-%% {[147,214,36,45], "standard trap", 2, read}.
+
Key1c3 = [intCommunityViewIndex,get(mip),is("public")],
Key2c3 = [intCommunityViewIndex,get(mip),is("standard trap")],
Key1c4 = [intCommunityAccess,get(mip),is("public")],
EndKey = [intCommunityEntry,[9],get(mip),is("public")],
gn([[intCommunityEntry]]),
- ?line expect(7, [{Key1c3, 2}]),
+ ?line ?expect1([{Key1c3, 2}]),
gn([[intCommunityTable]]),
- ?line expect(71, [{Key1c3, 2}]),
+ ?line ?expect1([{Key1c3, 2}]),
gn([[community]]),
- ?line expect(72, [{Key1c3, 2}]),
+ ?line ?expect1([{Key1c3, 2}]),
gn([[otpSnmpeaMIB]]),
- ?line expect(73, [{Key1c3, 2}]),
+ ?line ?expect1([{Key1c3, 2}]),
gn([[ericsson]]),
- ?line expect(74, [{Key1c3, 2}]),
+ ?line ?expect1([{Key1c3, 2}]),
gn([Key1c3]),
- ?line expect(8, [{Key2c3, 2}]),
+ ?line ?expect1([{Key2c3, 2}]),
gn([Key2c3]),
- ?line expect(9, [{Key1c4, 2}]),
+ ?line ?expect1([{Key1c4, 2}]),
gn([EndKey]),
AgentIp = [intAgentIpAddress,0],
- ?line expect(10, [{AgentIp, any}]),
+ ?line ?expect1([{AgentIp, any}]),
g([Key1c3]),
- ?line expect(11, [{Key1c3, 2}]),
+ ?line ?expect1([{Key1c3, 2}]),
g([EndKey]),
- ?line ?v1_2(expect(12, noSuchName, 1, any),
- expect(12, [{EndKey, noSuchObject}])),
+ ?line ?v1_2(?expect3(noSuchName, 1, any),
+ ?expect1([{EndKey, noSuchObject}])),
io:format("Testing row creation/deletion on communityTable...~n"),
NewKeyc3 = [intCommunityViewIndex,get(mip),is("test")],
NewKeyc4 = [intCommunityAccess,get(mip),is("test")],
NewKeyc5 = [intCommunityStatus,get(mip),is("test")],
s([{NewKeyc5, ?createAndGo}]),
- ?line expect(14, ?v1_2(badValue, inconsistentValue), 1,any),
+ ?line ?expect3(?v1_2(badValue, inconsistentValue), 1, any),
s([{NewKeyc5, ?createAndGo}, {NewKeyc3, 2}, {NewKeyc4, 2}]),
- ?line expect(15, [{NewKeyc5, ?createAndGo},{NewKeyc3, 2}, {NewKeyc4, 2}]),
+ ?line ?expect1([{NewKeyc5, ?createAndGo},{NewKeyc3, 2}, {NewKeyc4, 2}]),
g([NewKeyc4]),
- ?line expect(16, [{NewKeyc4, 2}]),
+ ?line ?expect1([{NewKeyc4, 2}]),
s([{NewKeyc5, ?destroy}]),
- ?line expect(17, [{NewKeyc5, ?destroy}]),
+ ?line ?expect1([{NewKeyc5, ?destroy}]),
s([{NewKeyc4, 2}]),
- ?line expect(18, ?v1_2(noSuchName, inconsistentName), 1,[{NewKeyc4, 2}]),
+ ?line ?expect3(?v1_2(noSuchName, inconsistentName), 1, [{NewKeyc4, 2}]),
s([{NewKeyc5, ?createAndWait}]),
- ?line expect(19, [{NewKeyc5, ?createAndWait}]),
+ ?line ?expect1([{NewKeyc5, ?createAndWait}]),
g([NewKeyc5]),
- ?line expect(20, [{NewKeyc5, ?notReady}]),
+ ?line ?expect1([{NewKeyc5, ?notReady}]),
s([{NewKeyc4, 2}]),
- ?line expect(21, [{NewKeyc4, 2}]),
+ ?line ?expect1([{NewKeyc4, 2}]),
g([NewKeyc5]),
- ?line expect(22, [{NewKeyc5, ?notReady}]),
+ ?line ?expect1([{NewKeyc5, ?notReady}]),
s([{NewKeyc3, 2}]),
- ?line expect(23, [{NewKeyc3, 2}]),
+ ?line ?expect1([{NewKeyc3, 2}]),
g([NewKeyc5]),
- ?line expect(24, [{NewKeyc5, ?notInService}]),
+ ?line ?expect1([{NewKeyc5, ?notInService}]),
s([{NewKeyc5, ?active}]),
- ?line expect(25, [{NewKeyc5, ?active}]),
+ ?line ?expect1([{NewKeyc5, ?active}]),
s([{NewKeyc5, ?destroy}]),
- ?line expect(26, [{NewKeyc5, ?destroy}]),
+ ?line ?expect1([{NewKeyc5, ?destroy}]),
s([{NewKeyc3, 3}]),
- ?line expect(27, ?v1_2(noSuchName, inconsistentName), 1,[{NewKeyc3, 3}]),
- otp_1128().
+ ?line ?expect3(?v1_2(noSuchName, inconsistentName), 1, [{NewKeyc3, 3}]),
+ otp_1128_test().
%% Req. system group
simple_standard_test() ->
?DBG("simple_standard_test -> entry",[]),
gn([[1,1]]),
- ?line expect(1, [{[sysDescr,0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]),
gn([[1,3]]),
- ?line expect(11, [{[sysDescr,0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]),
gn([[1,3,6]]),
- ?line expect(12, [{[sysDescr,0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]),
gn([[1,3,6,1]]),
- ?line expect(13, [{[sysDescr,0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]),
gn([[1,3,6,1,2]]),
- ?line expect(14, [{[sysDescr,0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]),
gn([[1,3,6,1,2,1]]),
- ?line expect(15, [{[sysDescr,0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]),
gn([[1,3,6,1,2,1,1]]),
- ?line expect(16, [{[sysDescr,0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]),
gn([[sysDescr]]),
- ?line expect(17, [{[sysDescr,0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]),
g([[sysDescr,0]]),
- ?line expect(2, [{[sysDescr,0], "Erlang SNMP agent"}]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]),
g([[sysDescr]]),
- ?line ?v1_2(expect(3, noSuchName, 1, any),
- expect(3, [{[sysDescr], noSuchObject}])),
+ ?line ?v1_2(?expect3(noSuchName, 1, any),
+ ?expect1([{[sysDescr], noSuchObject}])),
g([[1,6,7,0]]),
- ?line ?v1_2(expect(41, noSuchName, 1, any),
- expect(3, [{[1,6,7,0], noSuchObject}])),
+ ?line ?v1_2(?expect3(noSuchName, 1, any),
+ ?expect1([{[1,6,7,0], noSuchObject}])),
gn([[1,13]]),
- ?line ?v1_2(expect(4, noSuchName,1, any),
- expect(4, [{[1,13], endOfMibView}])),
+ ?line ?v1_2(?expect3(noSuchName,1, any),
+ ?expect1([{[1,13], endOfMibView}])),
s([{[sysLocation, 0], "new_value"}]),
- ?line expect(5, [{[sysLocation, 0], "new_value"}]),
+ ?line ?expect1([{[sysLocation, 0], "new_value"}]),
g([[sysLocation, 0]]),
- ?line expect(6, [{[sysLocation, 0], "new_value"}]),
+ ?line ?expect1([{[sysLocation, 0], "new_value"}]),
io:format("Testing noSuchName and badValue...~n"),
s([{[sysServices,0], 3}]),
- ?line expect(61, ?v1_2(noSuchName, notWritable), 1, any),
+ ?line ?expect3(?v1_2(noSuchName, notWritable), 1, any),
s([{[sysLocation, 0], i, 3}]),
- ?line expect(62, ?v1_2(badValue, wrongType), 1, any),
+ ?line ?expect3(?v1_2(badValue, wrongType), 1, any),
?DBG("simple_standard_test -> done",[]),
ok.
@@ -2926,16 +3552,16 @@ simple_standard_test() ->
db_notify_client(suite) -> [];
db_notify_client(Config) when is_list(Config) ->
?P(db_notify_client),
- {SaNode, MgrNode, MibDir} = init_case(Config),
+ {_SaNode, _MgrNode, _MibDir} = init_case(Config),
?DBG("db_notify_client -> case initiated: "
"~n SaNode: ~p"
"~n MgrNode: ~p"
- "~n MibDir: ~p", [SaNode, MgrNode, MibDir]),
+ "~n MibDir: ~p", [_SaNode, _MgrNode, _MibDir]),
?DBG("db_notify_client -> maximize verbosity", []),
snmpa_local_db:verbosity(trace),
Self = self(),
?DBG("db_notify_client -> register self (~p) notify client", [Self]),
- snmpa_local_db:register_notify_client(self(),?MODULE),
+ snmpa_local_db:register_notify_client(Self, ?MODULE),
%% This call (to the manager) will issue to set operations, so
%% we expect to receive to notify(insert) calls.
@@ -2960,7 +3586,7 @@ db_notify_client(Config) when is_list(Config) ->
end,
?DBG("db_notify_client -> unregister self (~p) notify client", [Self]),
- snmpa_local_db:unregister_notify_client(self()),
+ snmpa_local_db:unregister_notify_client(Self),
?DBG("db_notify_client -> minimize verbosity", []),
snmpa_local_db:verbosity(silence),
@@ -2972,12 +3598,13 @@ db_notify_client(Config) when is_list(Config) ->
db_notify_client_test() ->
?DBG("set first new sysLocation",[]),
s([{[sysLocation, 0], "new_value"}]),
- ?line expect(5, [{[sysLocation, 0], "new_value"}]),
+ ?line ?expect1([{[sysLocation, 0], "new_value"}]),
?DBG("set second new sysLocation",[]),
s([{[sysLocation, 0], "new_value"}]),
- ?line expect(5, [{[sysLocation, 0], "new_value"}]).
+ ?line ?expect1([{[sysLocation, 0], "new_value"}]).
+%% Callback function
notify(Pid, What) ->
?DBG("notify(~p,~p) -> called",[Pid,What]),
Pid ! {db_notify_test_reply, What}.
@@ -2985,32 +3612,29 @@ notify(Pid, What) ->
%% Req: system group, OLD-SNMPEA-MIB, Klas1
big_test() ->
- %% put(sname, {?MODULE, big_test}),
- %% put(verbosity, trace),
?DBG("big_test -> testing simple next/get/set @ master agent...",[]),
simple_standard_test(),
?DBG("big_test -> testing simple next/get/set @ subagent...",[]),
gn([[klas1]]),
- ?line expect(1, [{[fname,0], ""}]),
+ ?line ?expect1([{[fname,0], ""}]),
g([[fname,0]]),
- ?line expect(2, [{[fname,0], ""}]),
+ ?line ?expect1([{[fname,0], ""}]),
s([{[fname,0], s, "test set"}]),
- ?line expect(3, [{[fname,0], "test set"}]),
+ ?line ?expect1([{[fname,0], "test set"}]),
g([[fname,0]]),
- ?line expect(4, [{[fname,0], "test set"}]),
+ ?line ?expect1([{[fname,0], "test set"}]),
?DBG("big_test -> "
"testing next from last instance in master to subagent...",[]),
gn([[?v1_2(sysServices, sysORLastChange),0]]),
- ?line expect(5, [{[fname,0], "test set"}]),
- gn([[1,1],
- [?v1_2(sysServices, sysORLastChange),0]]),
- ?line expect(51, [{[sysDescr,0], "Erlang SNMP agent"},
- {[fname,0], "test set"}]),
+ ?line ?expect1([{[fname,0], "test set"}]),
+ gn([[1,1], [?v1_2(sysServices, sysORLastChange),0]]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"},
+ {[fname,0], "test set"}]),
s([{[fname,0], s, ""}]),
- ?line expect(52, [{[fname,0], ""}]),
+ ?line ?expect1([{[fname,0], ""}]),
table_test(),
@@ -3018,43 +3642,43 @@ big_test() ->
_FTab = [friendsEntry],
s([{[friendsEntry, [2, 3]], s, "kompis3"},
{[friendsEntry, [3, 3]], i, ?createAndGo}]),
- ?line expect(6, [{[friendsEntry, [2, 3]], "kompis3"},
- {[friendsEntry, [3, 3]], ?createAndGo}]),
+ ?line ?expect1([{[friendsEntry, [2, 3]], "kompis3"},
+ {[friendsEntry, [3, 3]], ?createAndGo}]),
g([[friendsEntry, [2, 3]],
[friendsEntry, [3, 3]]]),
- ?line expect(7, [{[friendsEntry, [2, 3]], "kompis3"},
- {[friendsEntry, [3, 3]], ?active}]),
+ ?line ?expect1([{[friendsEntry, [2, 3]], "kompis3"},
+ {[friendsEntry, [3, 3]], ?active}]),
s([{[friendsEntry, [3, 3]], i, ?destroy}]),
- ?line expect(8, [{[friendsEntry, [3, 3]], ?destroy}]),
+ ?line ?expect1([{[friendsEntry, [3, 3]], ?destroy}]),
- otp_1131(),
+ otp_1131_test(),
?DBG("big_test -> adding two rows in subagent table with special INDEX",
[]),
s([{[kompissEntry, [1, 3]], s, "kompis3"},
{[kompissEntry, [2, 3]], i, ?createAndGo}]),
- ?line expect(9, [{[kompissEntry, [1, 3]], "kompis3"},
- {[kompissEntry, [2, 3]], ?createAndGo}]),
+ ?line ?expect1([{[kompissEntry, [1, 3]], "kompis3"},
+ {[kompissEntry, [2, 3]], ?createAndGo}]),
g([[kompissEntry, [1, 3]],
[kompissEntry, [2, 3]]]),
- ?line expect(10, [{[kompissEntry, [1, 3]], "kompis3"},
- {[kompissEntry, [2, 3]], ?active}]),
+ ?line ?expect1([{[kompissEntry, [1, 3]], "kompis3"},
+ {[kompissEntry, [2, 3]], ?active}]),
gn([[kompissEntry, [1]],
[kompissEntry, [2]]]),
- ?line expect(11, [{[kompissEntry, [1, 3]], "kompis3"},
- {[kompissEntry, [2, 3]], ?active}]),
+ ?line ?expect1([{[kompissEntry, [1, 3]], "kompis3"},
+ {[kompissEntry, [2, 3]], ?active}]),
s([{[kompissEntry, [1, 2]], s, "kompis3"},
{[kompissEntry, [2, 2]], i, ?createAndGo}]),
- ?line expect(12, [{[kompissEntry, [1, 2]], "kompis3"},
- {[kompissEntry, [2, 2]], ?createAndGo}]),
+ ?line ?expect1([{[kompissEntry, [1, 2]], "kompis3"},
+ {[kompissEntry, [2, 2]], ?createAndGo}]),
gn([[kompissEntry, [1, 1]],
[kompissEntry, [2, 1]]]),
- ?line expect(13, [{[kompissEntry, [1, 2]], "kompis3"},
- {[kompissEntry, [2, 2]], ?active}]),
+ ?line ?expect1([{[kompissEntry, [1, 2]], "kompis3"},
+ {[kompissEntry, [2, 2]], ?active}]),
s([{[kompissEntry, [2, 3]], i, ?destroy}]),
- ?line expect(14, [{[kompissEntry, [2, 3]], ?destroy}]),
+ ?line ?expect1([{[kompissEntry, [2, 3]], ?destroy}]),
s([{[kompissEntry, [2, 2]], i, ?destroy}]),
- ?line expect(15, [{[kompissEntry, [2, 2]], ?destroy}]),
+ ?line ?expect1([{[kompissEntry, [2, 2]], ?destroy}]),
?DBG("big_test -> done",[]),
ok.
@@ -3065,23 +3689,22 @@ big_test_2() ->
?P1("Testing simple next/get/set @ subagent (2)..."),
gn([[klas2]]),
- ?line expect(1, [{[fname2,0], ""}]),
+ ?line ?expect1([{[fname2,0], ""}]),
g([[fname2,0]]),
- ?line expect(2, [{[fname2,0], ""}]),
+ ?line ?expect1([{[fname2,0], ""}]),
s([{[fname2,0], s, "test set"}]),
- ?line expect(3, [{[fname2,0], "test set"}]),
+ ?line ?expect1([{[fname2,0], "test set"}]),
g([[fname2,0]]),
- ?line expect(4, [{[fname2,0], "test set"}]),
+ ?line ?expect1([{[fname2,0], "test set"}]),
- otp_1298(),
+ otp_1298_test(),
?P1("Testing next from last object in master to subagent (2)..."),
gn([[?v1_2(sysServices, sysORLastChange),0]]),
- ?line expect(5, [{[fname2,0], "test set"}]),
- gn([[1,1],
- [?v1_2(sysServices, sysORLastChange),0]]),
- ?line expect(51, [{[sysDescr,0], "Erlang SNMP agent"},
- {[fname2,0], "test set"}]),
+ ?line ?expect1([{[fname2,0], "test set"}]),
+ gn([[1,1], [?v1_2(sysServices, sysORLastChange),0]]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"},
+ {[fname2,0], "test set"}]),
table_test(),
@@ -3089,40 +3712,40 @@ big_test_2() ->
_FTab = [friendsEntry2],
s([{[friendsEntry2, [2, 3]], s, "kompis3"},
{[friendsEntry2, [3, 3]], i, ?createAndGo}]),
- ?line expect(6, [{[friendsEntry2, [2, 3]], "kompis3"},
- {[friendsEntry2, [3, 3]], ?createAndGo}]),
+ ?line ?expect1([{[friendsEntry2, [2, 3]], "kompis3"},
+ {[friendsEntry2, [3, 3]], ?createAndGo}]),
g([[friendsEntry2, [2, 3]],
[friendsEntry2, [3, 3]]]),
- ?line expect(7, [{[friendsEntry2, [2, 3]], "kompis3"},
- {[friendsEntry2, [3, 3]], ?active}]),
+ ?line ?expect1([{[friendsEntry2, [2, 3]], "kompis3"},
+ {[friendsEntry2, [3, 3]], ?active}]),
s([{[friendsEntry2, [3, 3]], i, ?destroy}]),
- ?line expect(8, [{[friendsEntry2, [3, 3]], ?destroy}]),
+ ?line ?expect1([{[friendsEntry2, [3, 3]], ?destroy}]),
?P1("Adding two rows in subagent table with special INDEX (2)"),
s([{[kompissEntry2, [1, 3]], s, "kompis3"},
{[kompissEntry2, [2, 3]], i, ?createAndGo}]),
- ?line expect(9, [{[kompissEntry2, [1, 3]], "kompis3"},
- {[kompissEntry2, [2, 3]], ?createAndGo}]),
+ ?line ?expect1([{[kompissEntry2, [1, 3]], "kompis3"},
+ {[kompissEntry2, [2, 3]], ?createAndGo}]),
g([[kompissEntry2, [1, 3]],
[kompissEntry2, [2, 3]]]),
- ?line expect(10, [{[kompissEntry2, [1, 3]], "kompis3"},
- {[kompissEntry2, [2, 3]], ?active}]),
+ ?line ?expect1([{[kompissEntry2, [1, 3]], "kompis3"},
+ {[kompissEntry2, [2, 3]], ?active}]),
gn([[kompissEntry2, [1]],
[kompissEntry2, [2]]]),
- ?line expect(11, [{[kompissEntry2, [1, 3]], "kompis3"},
- {[kompissEntry2, [2, 3]], ?active}]),
+ ?line ?expect1([{[kompissEntry2, [1, 3]], "kompis3"},
+ {[kompissEntry2, [2, 3]], ?active}]),
s([{[kompissEntry2, [1, 2]], s, "kompis3"},
{[kompissEntry2, [2, 2]], i, ?createAndGo}]),
- ?line expect(12, [{[kompissEntry2, [1, 2]], "kompis3"},
- {[kompissEntry2, [2, 2]], ?createAndGo}]),
+ ?line ?expect1([{[kompissEntry2, [1, 2]], "kompis3"},
+ {[kompissEntry2, [2, 2]], ?createAndGo}]),
gn([[kompissEntry2, [1, 1]],
[kompissEntry2, [2, 1]]]),
- ?line expect(13, [{[kompissEntry2, [1, 2]], "kompis3"},
- {[kompissEntry2, [2, 2]], ?active}]),
+ ?line ?expect1([{[kompissEntry2, [1, 2]], "kompis3"},
+ {[kompissEntry2, [2, 2]], ?active}]),
s([{[kompissEntry2, [2, 3]], i, ?destroy}]),
- ?line expect(14, [{[kompissEntry2, [2, 3]], ?destroy}]),
+ ?line ?expect1([{[kompissEntry2, [2, 3]], ?destroy}]),
s([{[kompissEntry2, [2, 2]], i, ?destroy}]),
- ?line expect(15, [{[kompissEntry2, [2, 2]], ?destroy}]),
+ ?line ?expect1([{[kompissEntry2, [2, 2]], ?destroy}]),
ok.
%% Req. Test1
@@ -3131,26 +3754,26 @@ multi_threaded_test() ->
g([[multiStr,0]]),
Pid = get_multi_pid(),
g([[sysUpTime,0]]),
- ?line expect(1, [{[sysUpTime,0], any}]),
+ ?line ?expect1([{[sysUpTime,0], any}]),
s([{[sysLocation, 0], s, "pelle"}]),
- ?line expect(2, [{[sysLocation, 0], "pelle"}]),
+ ?line ?expect1([{[sysLocation, 0], "pelle"}]),
Pid ! continue,
- ?line expect(3, [{[multiStr,0], "ok"}]),
+ ?line ?expect1([{[multiStr,0], "ok"}]),
s([{[multiStr, 0], s, "block"}]),
Pid2 = get_multi_pid(),
g([[sysUpTime,0]]),
- ?line expect(4, [{[sysUpTime,0], any}]),
+ ?line ?expect1([{[sysUpTime,0], any}]),
g([[multiStr,0]]),
Pid3 = get_multi_pid(),
g([[sysUpTime,0]]),
- ?line expect(5, [{[sysUpTime,0], any}]),
+ ?line ?expect1([{[sysUpTime,0], any}]),
s([{[sysLocation, 0], s, "kalle"}]),
Pid3 ! continue,
- ?line expect(6, [{[multiStr,0], "ok"}]),
+ ?line ?expect1([{[multiStr,0], "ok"}]),
Pid2 ! continue,
- ?line expect(7, [{[multiStr,0], "block"}]),
- ?line expect(8, [{[sysLocation,0], "kalle"}]).
+ ?line ?expect1([{[multiStr,0], "block"}]),
+ ?line ?expect1([{[sysLocation,0], "kalle"}]).
%% Req. Test1, TestTrapv2
mt_trap_test(MA) ->
@@ -3158,9 +3781,8 @@ mt_trap_test(MA) ->
?DBG("mt_trap_test(01) -> issue testTrapv22 (standard trap)", []),
snmpa:send_trap(MA, testTrapv22, "standard trap"),
?DBG("mt_trap_test(02) -> await v2trap", []),
- ?line expect(mt_trap_test_1, v2trap,
- [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?system ++ [0,1]}]),
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?system ++ [0,1]}]),
?DBG("mt_trap_test(03) -> issue mtTrap (standard trap)", []),
snmpa:send_trap(MA, mtTrap, "standard trap"),
@@ -3169,21 +3791,21 @@ mt_trap_test(MA) ->
g([[sysUpTime,0]]),
?DBG("mt_trap_test(06) -> await sysUpTime", []),
- ?line expect(mt_trap_test_2, [{[sysUpTime,0], any}]),
+ ?line ?expect1([{[sysUpTime,0], any}]),
?DBG("mt_trap_test(07) -> issue testTrapv22 (standard trap)", []),
snmpa:send_trap(MA, testTrapv22, "standard trap"),
?DBG("mt_trap_test(08) -> await v2trap", []),
- ?line expect(mt_trap_test_3, v2trap,
- [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?system ++ [0,1]}]),
+ ?line ?expect2(v2trap,
+ [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?system ++ [0,1]}]),
?DBG("mt_trap_test(09) -> send continue to multi-pid", []),
Pid ! continue,
?DBG("mt_trap_test(10) -> await v2trap", []),
- ?line expect(mt_trap_test_4, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?testTrap ++ [2]},
- {[multiStr,0], "ok"}]),
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?testTrap ++ [2]},
+ {[multiStr,0], "ok"}]),
?DBG("mt_trap_test(11) -> done", []),
ok.
@@ -3204,26 +3826,26 @@ types_v2_test() ->
?P1("Testing v2 types..."),
s([{[bits1,0], 2#10}]),
- ?line expect(1, [{[bits1,0], ?str(2#10)}]),
+ ?line ?expect1([{[bits1,0], ?str(2#10)}]),
g([[bits1,0]]),
- ?line expect(2, [{[bits1,0], ?str(2#101)}]),
+ ?line ?expect1([{[bits1,0], ?str(2#101)}]),
s([{[bits2,0], 2#11000000110}]),
- ?line expect(3, [{[bits2,0], ?str(2#11000000110)}]),
+ ?line ?expect1([{[bits2,0], ?str(2#11000000110)}]),
g([[bits2,0]]),
- ?line expect(4, [{[bits2,0], ?str(2#11000000110)}]),
+ ?line ?expect1([{[bits2,0], ?str(2#11000000110)}]),
g([[bits3,0]]),
- ?line expect(50, genErr, 1, any),
+ ?line ?expect3(genErr, 1, any),
g([[bits4,0]]),
- ?line expect(51, genErr, 1, any),
+ ?line ?expect3(genErr, 1, any),
s([{[bits1,0], s, [2#10]}]),
- ?line expect(6, ?v1_2(badValue, wrongValue), 1, any),
+ ?line ?expect3(?v1_2(badValue, wrongValue), 1, any),
s([{[bits2,0], 2#11001001101010011}]),
- ?line expect(7, ?v1_2(badValue, wrongValue), 1, any).
+ ?line ?expect3(?v1_2(badValue, wrongValue), 1, any).
%% Req. Test1
@@ -3231,64 +3853,63 @@ implied_test(MA) ->
?LOG("implied_test -> start",[]),
?P1("Testing IMPLIED..."),
- snmpa:verbosity(MA,trace),
- snmpa:verbosity(MA,trace),
+ snmpa:verbosity(MA, trace),
%% Create two rows, check that they are get-nexted in correct order.
Idx1 = "apa",
Idx2 = "qq",
?DBG("implied_test -> (send) create row 1 '~s' in table 1",[Idx1]),
s([{[testStatus, Idx1], i, ?createAndGo}, {[testDescr, Idx1],s,"row 1"}]),
- ?line expect(1, [{[testStatus, Idx1], ?createAndGo},
- {[testDescr, Idx1], "row 1"}]),
+ ?line ?expect1([{[testStatus, Idx1], ?createAndGo},
+ {[testDescr, Idx1], "row 1"}]),
?DBG("implied_test -> (send) create row 2 '~s' in table 1",[Idx2]),
s([{[testStatus, Idx2], i, ?createAndGo}, {[testDescr, Idx2],s,"row 2"}]),
- ?line expect(2, [{[testStatus, Idx2], ?createAndGo},
- {[testDescr, Idx2], "row 2"}]),
+ ?line ?expect1([{[testStatus, Idx2], ?createAndGo},
+ {[testDescr, Idx2], "row 2"}]),
?DBG("implied_test -> get-next(testDescr)",[]),
gn([[testDescr]]),
- ?line expect(3, [{[testDescr,Idx1], "row 1"}]),
+ ?line ?expect1([{[testDescr,Idx1], "row 1"}]),
?DBG("implied_test -> get-next(testDescr) of row 1",[]),
gn([[testDescr,Idx1]]),
- ?line expect(4, [{[testDescr,Idx2], "row 2"}]),
+ ?line ?expect1([{[testDescr,Idx2], "row 2"}]),
% Delete the rows
?DBG("implied_test -> (send) delete row 1 '~s' from table 1",[Idx1]),
s([{[testStatus, Idx1], i, ?destroy}]),
- ?line expect(5, [{[testStatus, Idx1], ?destroy}]),
+ ?line ?expect1([{[testStatus, Idx1], ?destroy}]),
?DBG("implied_test -> (send) delete row 2 '~s' from table 1",[Idx2]),
s([{[testStatus, Idx2], i, ?destroy}]),
- ?line expect(6, [{[testStatus, Idx2], ?destroy}]),
+ ?line ?expect1([{[testStatus, Idx2], ?destroy}]),
%% Try the same in other table
Idx3 = [1, "apa"],
Idx4 = [1, "qq"],
?DBG("implied_test -> (send) create row 1 '~s' in table 2",[Idx3]),
s([{[testStatus2, Idx3], i, ?createAndGo}, {[testDescr2,Idx3],s,"row 1"}]),
- ?line expect(1, [{[testStatus2, Idx3], ?createAndGo},
- {[testDescr2, Idx3], "row 1"}]),
+ ?line ?expect1([{[testStatus2, Idx3], ?createAndGo},
+ {[testDescr2, Idx3], "row 1"}]),
?DBG("implied_test -> (send) create row 2 '~s' in table 2",[Idx4]),
s([{[testStatus2, Idx4], i, ?createAndGo}, {[testDescr2,Idx4],s,"row 2"}]),
- ?line expect(2, [{[testStatus2, Idx4], ?createAndGo},
- {[testDescr2, Idx4], "row 2"}]),
+ ?line ?expect1([{[testStatus2, Idx4], ?createAndGo},
+ {[testDescr2, Idx4], "row 2"}]),
?DBG("implied_test -> get-next(testDescr2)",[]),
gn([[testDescr2]]),
- ?line expect(3, [{[testDescr2,Idx3], "row 1"}]),
+ ?line ?expect1([{[testDescr2,Idx3], "row 1"}]),
?DBG("implied_test -> get-next(testDescr2) of row 1",[]),
gn([[testDescr2,Idx3]]),
- ?line expect(4, [{[testDescr2,Idx4], "row 2"}]),
+ ?line ?expect1([{[testDescr2,Idx4], "row 2"}]),
% Delete the rows
?DBG("implied_test -> (send) delete row 1 '~s' from table 2",[Idx3]),
s([{[testStatus2, Idx3], i, ?destroy}]),
- ?line expect(5, [{[testStatus2, Idx3], ?destroy}]),
+ ?line ?expect1([{[testStatus2, Idx3], ?destroy}]),
?DBG("implied_test -> (send) delete row 2 '~s' from table 2",[Idx4]),
s([{[testStatus2, Idx4], i, ?destroy}]),
- ?line expect(6, [{[testStatus2, Idx4], ?destroy}]),
+ ?line ?expect1([{[testStatus2, Idx4], ?destroy}]),
- snmpa:verbosity(MA,log),
+ snmpa:verbosity(MA, log),
- ?LOG("implied_test -> done",[]).
+ ?LOG("implied_test -> done", []).
@@ -3301,25 +3922,25 @@ sparse_table_test() ->
Idx2 = 2,
s([{[sparseStatus, Idx1], i, ?createAndGo},
{[sparseDescr, Idx1], s, "row 1"}]),
- ?line expect(1, [{[sparseStatus, Idx1], ?createAndGo},
- {[sparseDescr, Idx1], "row 1"}]),
+ ?line ?expect1([{[sparseStatus, Idx1], ?createAndGo},
+ {[sparseDescr, Idx1], "row 1"}]),
s([{[sparseStatus, Idx2], i, ?createAndGo},
{[sparseDescr, Idx2], s, "row 2"}]),
- ?line expect(2, [{[sparseStatus, Idx2], ?createAndGo},
- {[sparseDescr, Idx2], "row 2"}]),
+ ?line ?expect1([{[sparseStatus, Idx2], ?createAndGo},
+ {[sparseDescr, Idx2], "row 2"}]),
?v1_2(gn([[sparseIndex], [sparseDescr,Idx1], [sparseDescr,Idx2],
[sparseStatus,Idx1], [sparseStatus,Idx2]]),
gb(0,5,[[sparseIndex]])),
- ?line expect(3, [{[sparseDescr,Idx1], "row 1"},
- {[sparseDescr,Idx2], "row 2"},
- {[sparseStatus,Idx1], ?active},
- {[sparseStatus,Idx2], ?active},
- {[sparseStr,0], "slut"}]),
- % Delete the rows
+ ?line ?expect1([{[sparseDescr,Idx1], "row 1"},
+ {[sparseDescr,Idx2], "row 2"},
+ {[sparseStatus,Idx1], ?active},
+ {[sparseStatus,Idx2], ?active},
+ {[sparseStr,0], "slut"}]),
+ %% Delete the rows
s([{[sparseStatus, Idx1], i, ?destroy}]),
- ?line expect(4, [{[sparseStatus, Idx1], ?destroy}]),
+ ?line ?expect1([{[sparseStatus, Idx1], ?destroy}]),
s([{[sparseStatus, Idx2], i, ?destroy}]),
- ?line expect(5, [{[sparseStatus, Idx2], ?destroy}]).
+ ?line ?expect1([{[sparseStatus, Idx2], ?destroy}]).
%% Req. Test1
@@ -3333,13 +3954,13 @@ cnt_64_test(MA) ->
?DBG("get cnt64",[]),
g([[cnt64,0]]),
?DBG("await response",[]),
- ?line ?v1_2(expect(1, noSuchName, 1, any),
- expect(1, [{[cnt64,0],18446744073709551615}])),
+ ?line ?v1_2(?expect3(noSuchName, 1, any),
+ ?expect1([{[cnt64,0],18446744073709551615}])),
?DBG("get-next cnt64",[]),
gn([[cnt64]]),
?DBG("await response",[]),
- ?line ?v1_2(expect(2, [{[cnt64Str,0], "after cnt64"}]),
- expect(2, [{[cnt64,0],18446744073709551615}])),
+ ?line ?v1_2(?expect1([{[cnt64Str,0], "after cnt64"}]),
+ ?expect1([{[cnt64,0],18446744073709551615}])),
?DBG("send cntTrap",[]),
snmpa:send_trap(MA,cntTrap,"standard trap",[
{sysContact, "pelle"},
@@ -3347,13 +3968,13 @@ cnt_64_test(MA) ->
{sysLocation, "here"}
]),
?DBG("await response",[]),
- ?line ?v1_2(expect(3, trap, [test], 6, 1, [{[sysContact,0], "pelle"},
- {[sysLocation,0], "here"}]),
- expect(3, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?testTrap ++ [1]},
- {[sysContact,0], "pelle"},
- {[cnt64,0], 10},
- {[sysLocation,0], "here"}])),
+ ?line ?v1_2(?expect5(trap, [test], 6, 1, [{[sysContact,0], "pelle"},
+ {[sysLocation,0], "here"}]),
+ ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?testTrap ++ [1]},
+ {[sysContact,0], "pelle"},
+ {[cnt64,0], 10},
+ {[sysLocation,0], "here"}])),
%% Create two rows, check that they are get-nexted in correct order.
Idx1 = 1,
@@ -3361,27 +3982,27 @@ cnt_64_test(MA) ->
?DBG("create row (cntStatus): ~p",[Idx1]),
s([{[cntStatus, Idx1], i, ?createAndGo}]),
?DBG("await response",[]),
- ?line expect(1, [{[cntStatus, Idx1], ?createAndGo}]),
+ ?line ?expect1([{[cntStatus, Idx1], ?createAndGo}]),
?DBG("create row (cntStatus): ~p",[Idx2]),
s([{[cntStatus, Idx2], i, ?createAndGo}]),
?DBG("await response",[]),
- ?line expect(2, [{[cntStatus, Idx2], ?createAndGo}]),
+ ?line ?expect1([{[cntStatus, Idx2], ?createAndGo}]),
?DBG("get-next (cntIndex)",[]),
gn([[cntIndex]]),
?DBG("await response",[]),
- ?line ?v1_2(expect(3, [{[cntStatus,Idx1], ?active}]),
- expect(3, [{[cntCnt,Idx1], 0}])),
+ ?line ?v1_2(?expect1([{[cntStatus,Idx1], ?active}]),
+ ?expect1([{[cntCnt,Idx1], 0}])),
% Delete the rows
?DBG("delete row (cntStatus): ~p",[Idx1]),
s([{[cntStatus, Idx1], i, ?destroy}]),
?DBG("await response",[]),
- ?line expect(4, [{[cntStatus, Idx1], ?destroy}]),
+ ?line ?expect1([{[cntStatus, Idx1], ?destroy}]),
?DBG("delete row (cntStatus): ~p",[Idx2]),
s([{[cntStatus, Idx2], i, ?destroy}]),
?DBG("await response",[]),
- ?line expect(5, [{[cntStatus, Idx2], ?destroy}]),
- catch snmpa:verbosity(MA,log),
+ ?line ?expect1([{[cntStatus, Idx2], ?destroy}]),
+ catch snmpa:verbosity(MA, log),
?DBG("done",[]),
ok.
@@ -3389,7 +4010,7 @@ cnt_64_test(MA) ->
opaque_test() ->
?P1("Testing Opaque datatype..."),
g([[opaqueObj,0]]),
- ?line expect(1, [{[opaqueObj,0], "opaque-data"}]).
+ ?line ?expect1([{[opaqueObj,0], "opaque-data"}]).
%% Req. OLD-SNMPEA-MIB
api_test(MaNode) ->
@@ -3430,70 +4051,69 @@ api_test(MaNode) ->
%% Req. Klas3
api_test2() ->
g([[fname3,0]]),
- ?line expect(1, [{[fname3,0], "ok"}]),
+ ?line ?expect1([{[fname3,0], "ok"}]),
g([[fname4,0]]),
- ?line expect(2, [{[fname4,0], 1}]).
+ ?line ?expect1([{[fname4,0], 1}]).
api_test3() ->
g([[fname3,0]]),
- ?line expect(1, [{[fname3,0], "ok"}]).
+ ?line ?expect1([{[fname3,0], "ok"}]).
unreg_test() ->
gn([[?v1_2(sysServices, sysORLastChange),0]]),
- ?line expect(1, [{[snmpInPkts, 0], any}]).
+ ?line ?expect1([{[snmpInPkts, 0], any}]).
load_test() ->
gn([[?v1_2(sysServices, sysORLastChange),0]]),
- ?line expect(1, [{[fname,0], ""}]).
+ ?line ?expect1([{[fname,0], ""}]).
%% Req. Klas1
load_test_sa() ->
gn([[?v1_2(sysServices,sysORLastChange), 0]]),
- ?line expect(1, [{[fname,0], any}]).
+ ?line ?expect1([{[fname,0], any}]).
%% Req. system group, Klas1, OLD-SNMPEA-MIB
do_mul_get() ->
Key1c3 = [intCommunityEntry,[3],get(mip),is("public")],
Key1c4 = [intCommunityEntry,[4],get(mip),is("public")],
s([{[fname,0], s, "test set"}]),
- ?line expect(3, [{[fname,0], "test set"}]),
- g([[sysDescr,0], Key1c4, [fname,0],Key1c3,
- [sysName,0]]),
- ?line expect(1, [{[sysDescr,0], "Erlang SNMP agent"},
- {Key1c4, 2},
- {[fname,0], "test set"},
- {Key1c3, 2},
- {[sysName,0], "test"}]),
+ ?line ?expect1([{[fname,0], "test set"}]),
+ g([[sysDescr,0], Key1c4, [fname,0],Key1c3,[sysName,0]]),
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"},
+ {Key1c4, 2},
+ {[fname,0], "test set"},
+ {Key1c3, 2},
+ {[sysName,0], "test"}]),
g([[1,3,7,1], Key1c4, [sysDescr,0], [1,3,7,2], Key1c3, [sysDescr,0]]),
- ?line ?v1_2(expect(2, noSuchName, [1,4], any),
- expect(2, [{[1,3,7,1], noSuchObject},
- {Key1c4, 2},
- {[sysDescr,0], "Erlang SNMP agent"},
- {[1,3,7,2], noSuchObject},
- {Key1c3, 2},
- {[sysDescr,0], "Erlang SNMP agent"}])).
+ ?line ?v1_2(?expect3(noSuchName, [1,4], any),
+ ?expect1([{[1,3,7,1], noSuchObject},
+ {Key1c4, 2},
+ {[sysDescr,0], "Erlang SNMP agent"},
+ {[1,3,7,2], noSuchObject},
+ {Key1c3, 2},
+ {[sysDescr,0], "Erlang SNMP agent"}])).
%% Req. v1, system group, Klas1, OLD-SNMPEA-MIB, *ej* Klas3.
do_mul_get_err() ->
Key1c3 = [intCommunityEntry,[3],get(mip),is("public")],
Key1c4 = [intCommunityEntry,[4],get(mip),is("public")],
s([{[fname,0], s, "test set"}]),
- ?line expect(3, [{[fname,0], "test set"}]),
+ ?line ?expect1([{[fname,0], "test set"}]),
g([[sysDescr,0],Key1c4,[fname,0], Key1c3, [sysName,2]]),
- ?line ?v1_2(expect(1, noSuchName, 5, any),
- expect(1, [{[sysDescr,0], "Erlang SNMP agent"},
- {Key1c4, 2},
- {[fname,0], "test set"},
- {Key1c3, 2},
- {[sysName,2], noSuchInstance}])),
+ ?line ?v1_2(?expect3(noSuchName, 5, any),
+ ?expect1([{[sysDescr,0], "Erlang SNMP agent"},
+ {Key1c4, 2},
+ {[fname,0], "test set"},
+ {Key1c3, 2},
+ {[sysName,2], noSuchInstance}])),
g([[sysDescr,0],Key1c4,[fname3,0], Key1c3, [sysName,1]]),
- ?line ?v1_2(expect(1, noSuchName, [3,5], any),
- expect(1, [{[sysDescr,0], "Erlang SNMP agent"},
- {Key1c4, 2},
- {[fname3,0], noSuchObject},
- {Key1c3, 2},
- {[sysName,1], noSuchInstance}])).
+ ?line ?v1_2(?expect3(noSuchName, [3,5], any),
+ ?expect1([{[sysDescr,0], "Erlang SNMP agent"},
+ {Key1c4, 2},
+ {[fname3,0], noSuchObject},
+ {Key1c3, 2},
+ {[sysName,1], noSuchInstance}])).
%% Req. system group, Klas1, OLD-SNMPEA-MIB
@@ -3503,11 +4123,11 @@ do_mul_next() ->
Key1c3 = [intCommunityEntry,[3],get(mip),is("public")],
Key1c4 = [intCommunityEntry,[4],get(mip),is("public")],
s([{[fname,0], s, "test set"}]),
- ?line expect(3, [{[fname,0], "test set"}]),
+ ?line ?expect1([{[fname,0], "test set"}]),
gn([[sysDescr], Key1c4s, [fname],Key1c3s,[sysName]]),
- ?line expect(1, [{[sysDescr,0], "Erlang SNMP agent"},
- {Key1c4, 2}, {[fname,0], "test set"},
- {Key1c3, 2}, {[sysName,0], "test"}]).
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"},
+ {Key1c4, 2}, {[fname,0], "test set"},
+ {Key1c3, 2}, {[sysName,0], "test"}]).
%% Req. system group, Klas1, OLD-SNMPEA-MIB
do_mul_next_err() ->
@@ -3516,17 +4136,17 @@ do_mul_next_err() ->
Key1c3 = [intCommunityEntry,[3],get(mip),is("public")],
Key1c4 = [intCommunityEntry,[4],get(mip),is("public")],
s([{[fname,0], s, "test set"}]),
- ?line expect(3, [{[fname,0], "test set"}]),
+ ?line ?expect1([{[fname,0], "test set"}]),
gn([[sysDescr], Key1c4s, [1,3,6,999], [fname],[1,3,90], Key1c3s,[sysName]]),
- ?line ?v1_2(expect(1, noSuchName, [3,5], any),
- expect(1, [{[sysDescr,0], "Erlang SNMP agent"},
- {Key1c4, 2},
- {[1,3,6,999], endOfMibView},
- {[fname,0], "test set"},
- {[1,3,90], endOfMibView},
- {Key1c3, 2},
- {[sysName,0], "test"}])).
-
+ ?line ?v1_2(?expect3(noSuchName, [3,5], any),
+ ?expect1([{[sysDescr,0], "Erlang SNMP agent"},
+ {Key1c4, 2},
+ {[1,3,6,999], endOfMibView},
+ {[fname,0], "test set"},
+ {[1,3,90], endOfMibView},
+ {Key1c3, 2},
+ {[sysName,0], "test"}])).
+
%% Req. system group, Klas1, OLD-SNMPEA-MIB
do_mul_set() ->
@@ -3540,24 +4160,24 @@ do_mul_set() ->
{NewKeyc5, ?createAndGo},
{NewKeyc4, 2},
{[friendsEntry, [3, 3]], ?createAndGo}]),
- ?line expect(1, [{[friendsEntry, [2, 3]], "kompis3"},
- {NewKeyc3, 2},
- {[sysLocation,0], "new_value"},
- {NewKeyc5, ?createAndGo},
- {NewKeyc4, 2},
- {[friendsEntry, [3, 3]], ?createAndGo}]),
+ ?line ?expect1([{[friendsEntry, [2, 3]], "kompis3"},
+ {NewKeyc3, 2},
+ {[sysLocation,0], "new_value"},
+ {NewKeyc5, ?createAndGo},
+ {NewKeyc4, 2},
+ {[friendsEntry, [3, 3]], ?createAndGo}]),
g([[friendsEntry, [2, 3]],
- [sysLocation,0],
- [friendsEntry, [3, 3]]]),
- ?line expect(2, [{[friendsEntry, [2, 3]], "kompis3"},
- {[sysLocation,0], "new_value"},
- {[friendsEntry, [3, 3]], ?active}]),
+ [sysLocation,0],
+ [friendsEntry, [3, 3]]]),
+ ?line ?expect1([{[friendsEntry, [2, 3]], "kompis3"},
+ {[sysLocation,0], "new_value"},
+ {[friendsEntry, [3, 3]], ?active}]),
g([NewKeyc4]),
- ?line expect(3, [{NewKeyc4, 2}]),
+ ?line ?expect1([{NewKeyc4, 2}]),
s([{[friendsEntry, [3, 3]], ?destroy},
{NewKeyc5, ?destroy}]),
- ?line expect(4, [{[friendsEntry, [3, 3]], ?destroy},
- {NewKeyc5, ?destroy}]).
+ ?line ?expect1([{[friendsEntry, [3, 3]], ?destroy},
+ {NewKeyc5, ?destroy}]).
%% Req. system group, Klas1, OLD-SNMPEA-MIB
do_mul_set_err() ->
@@ -3571,53 +4191,48 @@ do_mul_set_err() ->
{NewKeyc5, ?createAndGo},
{NewKeyc4, 2},
{[friendsEntry, [3, 3]], ?createAndGo}]),
- ?line expect(1, ?v1_2(noSuchName, notWritable), 3, any),
+ ?line ?expect3(?v1_2(noSuchName, notWritable), 3, any),
g([[friendsEntry, [2, 3]]]),
- ?line ?v1_2(expect(2, noSuchName, 1, any),
- expect(2, [{[friendsEntry, [2,3]], noSuchInstance}])),
+ ?line ?v1_2(?expect3(noSuchName, 1, any),
+ ?expect1([{[friendsEntry, [2,3]], noSuchInstance}])),
g([NewKeyc4]),
- ?line ?v1_2(expect(3, noSuchName, 1, any),
- expect(3, [{NewKeyc4, noSuchInstance}])).
+ ?line ?v1_2(?expect3(noSuchName, 1, any),
+ ?expect1([{NewKeyc4, noSuchInstance}])).
%% Req. SA-MIB
sa_mib() ->
g([[sa, [2,0]]]),
- ?line expect(sa_mib_1, [{[sa, [2,0]], 3}]),
+ ?line ?expect1([{[sa, [2,0]], 3}]),
s([{[sa, [1,0]], s, "sa_test"}]),
- ?line expect(sa_mib_2, [{[sa, [1,0]], "sa_test"}]),
+ ?line ?expect1([{[sa, [1,0]], "sa_test"}]),
ok.
ma_trap1(MA) ->
ok = snmpa:send_trap(MA, testTrap2, "standard trap"),
- ?line expect(ma_trap1_1,
- trap, [system], 6, 1, [{[system, [4,0]],
- "{mbj,eklas}@erlang.ericsson.se"}]),
+ ?line ?expect5(trap, [system], 6, 1, [{[system, [4,0]],
+ "{mbj,eklas}@erlang.ericsson.se"}]),
ok = snmpa:send_trap(MA, testTrap1, "standard trap"),
- ?line expect(ma_trap1_2,
- trap, [1,2,3] , 1, 0, [{[system, [4,0]],
- "{mbj,eklas}@erlang.ericsson.se"}]),
+ ?line ?expect5(trap, [1,2,3] , 1, 0, [{[system, [4,0]],
+ "{mbj,eklas}@erlang.ericsson.se"}]),
ok.
ma_trap2(MA) ->
snmpa:send_trap(MA,testTrap2,"standard trap",[{sysContact,"pelle"}]),
- ?line expect(ma_trap2_3,
- trap, [system], 6, 1, [{[system, [4,0]], "pelle"}]),
+ ?line ?expect5(trap, [system], 6, 1, [{[system, [4,0]], "pelle"}]),
ok.
ma_v2_2_v1_trap(MA) ->
snmpa:send_trap(MA,testTrapv22,"standard trap",[{sysContact,"pelle"}]),
- ?line expect(ma_v2_2_v1_trap_3,
- trap, [system], 6, 1, [{[system, [4,0]], "pelle"}]),
+ ?line ?expect5(trap, [system], 6, 1, [{[system, [4,0]], "pelle"}]),
ok.
ma_v2_2_v1_trap2(MA) ->
snmpa:send_trap(MA,linkUp,"standard trap",[{ifIndex, [1], 1},
{ifAdminStatus, [1], 1},
{ifOperStatus, [1], 2}]),
- ?line expect(ma_v2_2_v1_trap2_3,
- trap, [1,2,3], 3, 0, [{[ifIndex, 1], 1},
- {[ifAdminStatus, 1], 1},
- {[ifOperStatus, 1], 2}]),
+ ?line ?expect5(trap, [1,2,3], 3, 0, [{[ifIndex, 1], 1},
+ {[ifAdminStatus, 1], 1},
+ {[ifOperStatus, 1], 2}]),
ok.
sa_trap1(SA) ->
@@ -3635,47 +4250,44 @@ sa_trap1(SA) ->
%% io:format("sa_trap1 -> SA trap send: "
%% "~n TSRes: ~p"
%% "~n", [TSRes]),
- ?line expect(sa_trap1_4,
- trap, [ericsson], 6, 1, [{[system, [4,0]],
- "{mbj,eklas}@erlang.ericsson.se"},
- {[sa, [1,0]], "sa_test"}]),
+ ?line ?expect5(trap, [ericsson], 6, 1, [{[system, [4,0]],
+ "{mbj,eklas}@erlang.ericsson.se"},
+ {[sa, [1,0]], "sa_test"}]),
snmpa:verbosity(SA, {subagents, silence}),
ok.
sa_trap2(SA) ->
snmpa:send_trap(SA, saTrap, "standard trap",[{sysContact,"pelle"}]),
- ?line expect(sa_trap2_5,
- trap, [ericsson], 6, 1, [{[system, [4,0]], "pelle"},
- {[sa, [1,0]], "sa_test"}]),
+ ?line ?expect5(trap, [ericsson], 6, 1, [{[system, [4,0]], "pelle"},
+ {[sa, [1,0]], "sa_test"}]),
ok.
sa_trap3(SA) ->
snmpa:send_trap(SA, saTrap2, "standard trap",
[{intViewSubtree, [4], [1,2,3,4]}]),
- ?line expect(sa_trap3_6,
- trap, [ericsson], 6, 2, [{[system, [4,0]],
- "{mbj,eklas}@erlang.ericsson.se"},
- {[sa, [1,0]], "sa_test"},
- {[intViewSubtree,4],[1,2,3,4]}]),
+ ?line ?expect5(trap, [ericsson], 6, 2, [{[system, [4,0]],
+ "{mbj,eklas}@erlang.ericsson.se"},
+ {[sa, [1,0]], "sa_test"},
+ {[intViewSubtree,4],[1,2,3,4]}]),
ok.
ma_v2_trap1(MA) ->
?DBG("ma_v2_traps -> entry with MA = ~p => "
"send standard trap: testTrapv22",[MA]),
snmpa:send_trap(MA, testTrapv22, "standard trap"),
- ?line expect(1, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?system ++ [0,1]}]),
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?system ++ [0,1]}]),
?DBG("ma_v2_traps -> send standard trap: testTrapv21",[]),
snmpa:send_trap(MA, testTrapv21, "standard trap"),
- ?line expect(2, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?snmp ++ [1]}]),
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?snmp ++ [1]}]),
ok.
ma_v2_trap2(MA) ->
snmpa:send_trap(MA,testTrapv22,"standard trap",[{sysContact,"pelle"}]),
- ?line expect(3, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?system ++ [0,1]},
- {[system, [4,0]], "pelle"}]).
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?system ++ [0,1]},
+ {[system, [4,0]], "pelle"}]).
%% Note: This test case takes a while... actually a couple of minutes.
ma_v2_inform1(MA) ->
@@ -3684,18 +4296,17 @@ ma_v2_inform1(MA) ->
"~n send notification: testTrapv22", [MA]),
CmdExpectInform =
- fun(No, Response) ->
- expect(No,
- {inform, Response},
- [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?system ++ [0,1]}])
+ fun(_No, Response) ->
+ ?expect2({inform, Response},
+ [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?system ++ [0,1]}])
end,
CmdExp =
fun(ok) ->
ok;
- ({ok, Val}) ->
- ?DBG("ma_v2_inform -> [cmd2] Val: ~p", [Val]),
+ ({ok, _Val}) ->
+ ?DBG("ma_v2_inform -> [cmd2] Val: ~p", [_Val]),
ok;
({error, Id, Extra}) ->
{error, {unexpected, Id, Extra}};
@@ -3730,10 +4341,10 @@ ma_v2_inform1(MA) ->
CmdSnmpTargets =
fun(T) ->
receive
- {snmp_targets, T, [Addr]} ->
+ {snmp_targets, T, [_Addr]} ->
?DBG("ma_v2_inform1 -> "
"received expected snmp_targets "
- "~n with receiver: ~p",[Addr]),
+ "~n with receiver: ~p", [_Addr]),
ok;
{snmp_targets, T, Addrs} ->
?ERR("ma_v2_inform1 -> "
@@ -3751,16 +4362,16 @@ ma_v2_inform1(MA) ->
Cmd06 =
fun() ->
receive
- {snmp_notification, Tag03, {got_response, Addr}} ->
+ {snmp_notification, Tag03, {got_response, _Addr}} ->
?DBG("ma_v2_inform1 -> "
"received expected snmp_notification "
- "[with manager response] from: ~n ~p",[Addr]),
+ "[with manager response] from: ~n ~p", [_Addr]),
ok;
- {snmp_notification, Tag03, {no_response, Addr}} ->
+ {snmp_notification, Tag03, {no_response, _Addr}} ->
?ERR("ma_v2_inform1 -> "
"received unexpected snmp_notification "
"[without manager response] from: ~n ~p",
- [Addr]),
+ [_Addr]),
{error, no_response}
after
20000 ->
@@ -3790,16 +4401,16 @@ ma_v2_inform1(MA) ->
Cmd10 =
fun() ->
receive
- {snmp_notification, Tag07, {got_response, Addr}} ->
+ {snmp_notification, Tag07, {got_response, _Addr}} ->
?ERR("ma_v2_inform1 -> "
"received unexpected snmp_notification "
- "[with manager response] from: ~n ~p", [Addr]),
+ "[with manager response] from: ~n ~p", [_Addr]),
{error, got_response};
- {snmp_notification, Tag07, {no_response, Addr}} ->
+ {snmp_notification, Tag07, {no_response, _Addr}} ->
?DBG("ma_v2_inform1 -> "
"received expected snmp_notification "
"[without manager response] from: ~n ~p",
- [Addr]),
+ [_Addr]),
ok
after
240000 ->
@@ -3834,18 +4445,17 @@ ma_v2_inform2(MA) ->
"~n send notification: testTrapv22", [MA]),
CmdExpectInform =
- fun(No, Response) ->
- expect(No,
- {inform, Response},
- [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?system ++ [0,1]}])
+ fun(_No, Response) ->
+ ?expect2({inform, Response},
+ [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?system ++ [0,1]}])
end,
CmdExp =
fun(ok) ->
ok;
- ({ok, Val}) ->
- ?DBG("ma_v2_inform -> [cmd2] Val: ~p", [Val]),
+ ({ok, _Val}) ->
+ ?DBG("ma_v2_inform -> [cmd2] Val: ~p", [_Val]),
ok;
({error, Id, Extra}) ->
{error, {unexpected, Id, Extra}};
@@ -3925,18 +4535,18 @@ ma_v2_inform3(MA) ->
"~n send notification: testTrapv22", [MA]),
CmdExpectInform =
- fun(No, Response) ->
- expect(No,
- {inform, Response},
- [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?system ++ [0,1]}])
+ fun(_No, Response) ->
+ ?DBG("CmdExpectInform -> ~p: ~n~p", [_No, Response]),
+ ?expect2({inform, Response},
+ [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?system ++ [0,1]}])
end,
CmdExp =
fun(ok) ->
ok;
- ({ok, Val}) ->
- ?DBG("ma_v2_inform3 -> [cmd2] Val: ~p", [Val]),
+ ({ok, _Val}) ->
+ ?DBG("CmdExp -> Val: ~p", [_Val]),
ok;
({error, Id, Extra}) ->
{error, {unexpected, Id, Extra}};
@@ -4000,15 +4610,16 @@ ma_v2_inform3(MA) ->
Commands =
[
- {15, "Send notification [tag31]", Cmd15},
- {16, "Expect notification message [tag31]", Cmd16},
- {17, "Expect targets message [tag31]", Cmd17},
- {18, "Expect notification (no) response message [tag31]", Cmd18}
+ {15, "Send notification [" ++ atom_to_list(Tag15) ++ "]", Cmd15},
+ {16, "Expect notification message [" ++ atom_to_list(Tag15) ++ "]", Cmd16},
+ {17, "Expect targets message [" ++ atom_to_list(Tag15) ++ "]", Cmd17},
+ {18, "Expect notification (no) response message [" ++ atom_to_list(Tag15) ++ "]", Cmd18}
],
command_handler(Commands).
-
+
+%% snmpa_notification_delivery_info_receiver callback function
delivery_targets(Tag, Addresses, Extra) ->
io:format("~w:delivery_targets -> entry with"
"~n Tag: ~p"
@@ -4025,6 +4636,7 @@ delivery_targets(Tag, Addresses, Extra) ->
end,
ok.
+%% snmpa_notification_delivery_info_receiver callback function
delivery_info(Tag, Address, DeliveryResult, Extra) ->
io:format("~w:delivery_info -> entry with"
"~n Tag: ~p"
@@ -4045,57 +4657,57 @@ delivery_info(Tag, Address, DeliveryResult, Extra) ->
command_handler([]) ->
ok;
-command_handler([{No, Desc, Cmd}|Rest]) ->
- ?LOG("command_handler -> command ~w: ~n ~s", [No, Desc]),
+command_handler([{_No, _Desc, Cmd}|Rest]) ->
+ ?LOG("command_handler -> command ~w: ~n ~s", [_No, _Desc]),
case (catch Cmd()) of
ok ->
- ?LOG("command_handler -> ~w: ok",[No]),
+ ?LOG("command_handler -> ~w: ok", [_No]),
command_handler(Rest);
{error, Reason} ->
- ?ERR("command_handler -> ~w error: ~n~p",[No, Reason]),
+ ?ERR("command_handler -> ~w error: ~n~p", [_No, Reason]),
?line ?FAIL(Reason);
Error ->
- ?ERR("command_handler -> ~w unexpected: ~n~p",[No, Error]),
+ ?ERR("command_handler -> ~w unexpected: ~n~p", [_No, Error]),
?line ?FAIL({unexpected_command_result, Error})
end.
ma_v1_2_v2_trap(MA) ->
snmpa:send_trap(MA,linkDown,"standard trap",[{ifIndex, [1], 1}]),
- ?line expect(2, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?snmpTraps ++ [3]},
- {[ifIndex, 1], 1},
- {[snmpTrapEnterprise, 0], [1,2,3]}]).
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?snmpTraps ++ [3]},
+ {[ifIndex, 1], 1},
+ {[snmpTrapEnterprise, 0], [1,2,3]}]).
ma_v1_2_v2_trap2(MA) ->
snmpa:send_trap(MA,testTrap2,"standard trap",[{sysContact,"pelle"}]),
- ?line expect(3, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?system ++ [0,1]},
- {[system, [4,0]], "pelle"},
- {[snmpTrapEnterprise, 0], ?system}]).
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?system ++ [0,1]},
+ {[system, [4,0]], "pelle"},
+ {[snmpTrapEnterprise, 0], ?system}]).
sa_v1_2_v2_trap1(SA) ->
snmpa:verbosity(SA, {subagents, trace}),
snmpa:send_trap(SA, saTrap, "standard trap"),
- ?line expect(trap1_4, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?ericsson ++ [0, 1]},
- {[system, [4,0]],
- "{mbj,eklas}@erlang.ericsson.se"},
- {[sa, [1,0]], "sa_test"},
- {[snmpTrapEnterprise, 0], ?ericsson}]),
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?ericsson ++ [0, 1]},
+ {[system, [4,0]],
+ "{mbj,eklas}@erlang.ericsson.se"},
+ {[sa, [1,0]], "sa_test"},
+ {[snmpTrapEnterprise, 0], ?ericsson}]),
snmpa:verbosity(SA, {subagents, silence}),
ok.
sa_v1_2_v2_trap2(SA) ->
snmpa:verbosity(SA, {subagents, trace}),
snmpa:send_trap(SA, saTrap, "standard trap",[{sysContact,"pelle"}]),
- ?line expect(trap2_4, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?ericsson ++ [0, 1]},
- {[system, [4,0]], "pelle"},
- {[sa, [1,0]], "sa_test"},
- {[snmpTrapEnterprise, 0], ?ericsson}]),
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?ericsson ++ [0, 1]},
+ {[system, [4,0]], "pelle"},
+ {[sa, [1,0]], "sa_test"},
+ {[snmpTrapEnterprise, 0], ?ericsson}]),
snmpa:verbosity(SA, {subagents, silence}),
ok.
@@ -4104,13 +4716,13 @@ sa_v1_2_v2_trap3(SA) ->
snmpa:verbosity(SA, {subagents, trace}),
snmpa:send_trap(SA, saTrap2, "standard trap",
[{intViewSubtree, [4], [1,2,3,4]}]),
- ?line expect(trap3_4, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], ?ericsson ++ [0, 2]},
- {[system, [4,0]],
- "{mbj,eklas}@erlang.ericsson.se"},
- {[sa, [1,0]], "sa_test"},
- {[intViewSubtree,4],[1,2,3,4]},
- {[snmpTrapEnterprise, 0], ?ericsson}]),
+ ?line ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], ?ericsson ++ [0, 2]},
+ {[system, [4,0]],
+ "{mbj,eklas}@erlang.ericsson.se"},
+ {[sa, [1,0]], "sa_test"},
+ {[intViewSubtree,4],[1,2,3,4]},
+ {[snmpTrapEnterprise, 0], ?ericsson}]),
snmpa:verbosity(SA, {subagents, silence}),
ok.
@@ -4124,15 +4736,15 @@ sa_errs_bad_value() ->
{[sa, [2,0]], 5}, % badValue (i is_set_ok)
{NewKeyc5, ?createAndGo},
{NewKeyc4, 2}]),
- ?line expect(1, badValue, 2, any),
+ ?line ?expect3(badValue, 2, any),
s([{NewKeyc3, 2},
{[sa, [2,0]], 6}, % wrongValue (i is_set_ok)
{NewKeyc5, ?createAndGo},
{NewKeyc4, 2}]),
- ?line expect(1, ?v1_2(badValue, wrongValue), 2, any),
+ ?line ?expect3(?v1_2(badValue, wrongValue), 2, any),
g([NewKeyc4]),
- ?line ?v1_2(expect(2, noSuchName, 1, any),
- expect(2, [{NewKeyc4, noSuchInstance}])).
+ ?line ?v1_2(?expect3(noSuchName, 1, any),
+ ?expect1([{NewKeyc4, noSuchInstance}])).
%% Req. SA-MIB, OLD-SNMPEA-MIB
sa_errs_gen_err() ->
@@ -4141,23 +4753,23 @@ sa_errs_gen_err() ->
NewKeyc5 = [intCommunityEntry,[5],get(mip),is("test")],
s([{NewKeyc3, 2},{NewKeyc4, 2},
{NewKeyc5, ?createAndGo}, {[sa, [3,0]], 5}]),
- ?line expect(1, genErr, 4, any),
+ ?line ?expect3(genErr, 4, any),
% The row might have been added; we don't know.
% (as a matter of fact we do - it is added, because the agent
% first sets its own vars, and then th SAs. Lets destroy it.
s([{NewKeyc5, ?destroy}]),
- ?line expect(2, [{NewKeyc5, ?destroy}]).
+ ?line ?expect1([{NewKeyc5, ?destroy}]).
%% Req. SA-MIB, OLD-SNMPEA-MIB
sa_too_big() ->
g([[sa, [4,0]]]),
- ?line expect(1, tooBig).
+ ?line ?expect1(tooBig).
%% Req. Klas1, system group, snmp group (v1/v2)
-next_across_sa() ->
+next_across_sa_test() ->
gn([[sysDescr],[klas1,5]]),
- ?line expect(1, [{[sysDescr,0], "Erlang SNMP agent"},
- {[snmpInPkts, 0], any}]).
+ ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"},
+ {[snmpInPkts, 0], any}]).
%% snmp_test_mgr:s([{[fStatus3, 1], 4}, {[fname3,0], "ok"}]). -> noError
%% snmp_test_mgr:s([{[fStatus3, 1], 4}, {[fname3,0], "hoj"}]). -> {badValue, 2}
@@ -4168,40 +4780,40 @@ next_across_sa() ->
%% Req. Klas3, Klas4
undo_test() ->
s([{[fStatus3, 1], 4}, {[fname3,0], "ok"}]),
- ?line expect(1, [{[fStatus3, 1], 4}, {[fname3,0], "ok"}]),
+ ?line ?expect1([{[fStatus3, 1], 4}, {[fname3,0], "ok"}]),
s([{[fStatus3, 1], 4}, {[fname3,0], "hoj"}]),
- ?line expect(2, ?v1_2(badValue, inconsistentValue), 2, any),
+ ?line ?expect3(?v1_2(badValue, inconsistentValue), 2, any),
s([{[fStatus3, 3], 4}, {[fname3,0], "hoj"}]),
- ?line expect(3, ?v1_2(genErr, undoFailed), 1, any),
+ ?line ?expect3(?v1_2(genErr, undoFailed), 1, any),
s([{[fStatus3, 4], 4}, {[fname3,0], "ok"}]),
- ?line expect(4, ?v1_2(genErr, commitFailed), 1, any),
+ ?line ?expect3(?v1_2(genErr, commitFailed), 1, any),
% unfortunatly we don't know if we'll get undoFailed or commitFailed.
% it depends on which order the agent traverses the varbind list.
% s([{[fStatus3, 4], 4}, {[fname3,0], "ufail"}]),
% ?line expect(5, ?v1_2(genErr, undoFailed), 1, any),
s([{[fStatus3, 1], 4}, {[fname3,0], "xfail"}]),
- ?line expect(6, genErr, 2, any).
+ ?line ?expect3(genErr, 2, any).
%% Req. Klas3, Klas4
bad_return() ->
g([[fStatus4,4],
[fName4,4]]),
- ?line expect(4, genErr, 2, any),
+ ?line ?expect3(genErr, 2, any),
g([[fStatus4,5],
[fName4,5]]),
- ?line expect(5, genErr, 1, any),
+ ?line ?expect3(genErr, 1, any),
g([[fStatus4,6],
[fName4,6]]),
- ?line expect(6, genErr, 2, any),
+ ?line ?expect3(genErr, 2, any),
gn([[fStatus4,7],
[fName4,7]]),
- ?line expect(7, genErr, 2, any),
+ ?line ?expect3(genErr, 2, any),
gn([[fStatus4,8],
[fName4,8]]),
- ?line expect(8, genErr, 1, any),
+ ?line ?expect3(genErr, 1, any),
gn([[fStatus4,9],
[fName4,9]]),
- ?line expect(9, genErr, 2, any).
+ ?line ?expect3(genErr, 2, any).
%%%-----------------------------------------------------------------
@@ -4212,7 +4824,25 @@ bad_return() ->
%%% already tested by the normal tests.
%%%-----------------------------------------------------------------
-
+standard_mibs_cases() ->
+ [
+ snmp_standard_mib,
+ snmp_community_mib,
+ snmp_framework_mib,
+ snmp_target_mib,
+ snmp_notification_mib,
+ snmp_view_based_acm_mib
+ ].
+
+standard_mibs_cases_ipv6() ->
+ [
+ %% snmp_standard_mib, % Sending v1 traps does not work over IPv6
+ snmp_community_mib,
+ snmp_framework_mib,
+ snmp_target_mib,
+ snmp_notification_mib,
+ snmp_view_based_acm_mib
+ ].
%%-----------------------------------------------------------------
%% For this test, the agent is configured for v1.
@@ -4264,27 +4894,27 @@ std_mib_init() ->
%% disable authentication failure traps. (otherwise w'd get many of
%% them - this is also a test to see that it works).
s([{[snmpEnableAuthenTraps,0], 2}]),
- ?line expect(std_mib_init_1, [{[snmpEnableAuthenTraps, 0], 2}]).
+ ?line ?expect1([{[snmpEnableAuthenTraps, 0], 2}]).
%% Req. SNMP-STANDARD-MIB | SNMPv2-MIB
std_mib_finish() ->
%% enable again
s([{[snmpEnableAuthenTraps,0], 1}]),
- ?line expect(std_mib_finish_1, [{[snmpEnableAuthenTraps, 0], 1}]).
+ ?line ?expect1([{[snmpEnableAuthenTraps, 0], 1}]).
%% Req. SNMP-STANDARD-MIB
standard_mib_test_finish() ->
%% force a authenticationFailure (should result in a trap)
std_mib_write(),
%% check that we got a trap
- ?line expect(standard_mib_test_finish_2, trap, [1,2,3], 4, 0, []).
+ ?line ?expect5(trap, [1,2,3], 4, 0, []).
%% Req. SNMP-STANDARD-MIB | SNMPv2-MIB
std_mib_read() ->
?DBG("std_mib_read -> entry", []),
g([[sysUpTime,0]]), % try a bad <something>; msg dropped, no reply
?DBG("std_mib_read -> await timeout (i.e. no reply)", []),
- ?line expect(std_mib_read_1, timeout). % make sure we don't get a trap!
+ ?line ?expect1(timeout). % make sure we don't get a trap!
%% Req. SNMP-STANDARD-MIB | SNMPv2-MIB
@@ -4296,6 +4926,18 @@ std_mib_write() ->
std_mib_asn_err() ->
snmp_test_mgr:send_bytes([48,99,67,12,0,0,0,0,0,0,5]).
+
+standard_mibs2_cases() ->
+ [
+ snmpv2_mib_2,
+ snmp_community_mib_2,
+ snmp_framework_mib_2,
+ snmp_target_mib_2,
+ snmp_notification_mib_2,
+ snmp_view_based_acm_mib_2
+ ].
+
+
%%-----------------------------------------------------------------
%% For this test, the agent is configured for v2 and v3.
%% o Test the counters and control objects in SNMPv2-MIB
@@ -4344,6 +4986,19 @@ snmpv2_mib_2(Config) when is_list(Config) ->
?LOG("snmpv2_mib_2 -> done",[]).
+
+standard_mibs3_cases() ->
+ [
+ snmpv2_mib_3,
+ snmp_framework_mib_3,
+ snmp_mpd_mib_3,
+ snmp_target_mib_3,
+ snmp_notification_mib_3,
+ snmp_view_based_acm_mib_3,
+ snmp_user_based_sm_mib_3
+ ].
+
+
%% Req. SNMPv2-MIB
snmpv2_mib_3(suite) -> [];
snmpv2_mib_3(Config) when is_list(Config) ->
@@ -4375,13 +5030,13 @@ snmpv2_mib_test_finish() ->
%% check that we got a trap
?DBG("ma_v2_inform -> await trap",[]),
- ?line expect(2, v2trap, [{[sysUpTime,0], any},
- {[snmpTrapOID,0], ?authenticationFailure}]),
+ ?line ?expect2(v2trap, [{[sysUpTime,0], any},
+ {[snmpTrapOID,0], ?authenticationFailure}]),
%% and the the inform
?DBG("ma_v2_inform -> await inform",[]),
- ?line expect(2, {inform,true}, [{[sysUpTime,0], any},
- {[snmpTrapOID,0],?authenticationFailure}]).
+ ?line ?expect2({inform,true}, [{[sysUpTime,0], any},
+ {[snmpTrapOID,0],?authenticationFailure}]).
%% Req. SNMP-STANDARD-MIB | SNMPv2-MIB
std_mib_a() ->
@@ -4419,12 +5074,12 @@ std_mib_c({InBadCommunityNames, InBadCommunityUses, InASNErrs}) ->
snmpv2_mib_a() ->
?line [SetSerial] = get_req(2, [[snmpSetSerialNo,0]]),
s([{[snmpSetSerialNo,0], SetSerial}, {[sysLocation, 0], "val2"}]),
- ?line expect(snmpv2_mib_a_3, [{[snmpSetSerialNo,0], SetSerial},
- {[sysLocation, 0], "val2"}]),
+ ?line ?expect1([{[snmpSetSerialNo,0], SetSerial},
+ {[sysLocation, 0], "val2"}]),
s([{[sysLocation, 0], "val3"}, {[snmpSetSerialNo,0], SetSerial}]),
- ?line expect(snmpv2_mib_a_4, inconsistentValue, 2,
- [{[sysLocation, 0], "val3"},
- {[snmpSetSerialNo,0], SetSerial}]),
+ ?line ?expect3(inconsistentValue, 2,
+ [{[sysLocation, 0], "val3"},
+ {[snmpSetSerialNo,0], SetSerial}]),
?line ["val2"] = get_req(5, [[sysLocation,0]]).
@@ -4438,13 +5093,13 @@ snmp_community_mib(Config) when is_list(Config) ->
?P(snmp_community_mib),
init_case(Config),
?line load_master_std("SNMP-COMMUNITY-MIB"),
- try_test(snmp_community_mib),
+ try_test(snmp_community_mib_test),
?line unload_master("SNMP-COMMUNITY-MIB").
snmp_community_mib_2(X) -> ?P(snmp_community_mib_2), snmp_community_mib(X).
%% Req. SNMP-COMMUNITY-MIB
-snmp_community_mib() ->
+snmp_community_mib_test() ->
?INF("NOT YET IMPLEMENTED", []),
nyi.
@@ -4456,7 +5111,7 @@ snmp_framework_mib(Config) when is_list(Config) ->
?P(snmp_framework_mib),
init_case(Config),
?line load_master_std("SNMP-FRAMEWORK-MIB"),
- try_test(snmp_framework_mib),
+ try_test(snmp_framework_mib_test),
?line unload_master("SNMP-FRAMEWORK-MIB").
snmp_framework_mib_2(X) -> ?P(snmp_framework_mib_2), snmp_framework_mib(X).
@@ -4465,11 +5120,11 @@ snmp_framework_mib_3(suite) -> [];
snmp_framework_mib_3(Config) when is_list(Config) ->
?P(snmp_framework_mib_3),
init_case(Config),
- try_test(snmp_framework_mib).
+ try_test(snmp_framework_mib_test).
%% Req. SNMP-FRAMEWORK-MIB
-snmp_framework_mib() ->
+snmp_framework_mib_test() ->
?line ["agentEngine"] = get_req(1, [[snmpEngineID,0]]),
?line [EngineTime] = get_req(2, [[snmpEngineTime,0]]),
?SLEEP(5000),
@@ -4555,7 +5210,7 @@ snmp_mpd_mib_a() ->
-define(snmpUnknownPDUHandlers_instance, [1,3,6,1,6,3,11,2,1,3,0]).
snmp_mpd_mib_b() ->
g([[sysUpTime,0]]),
- ?line expect(1, report, [{?snmpUnknownPDUHandlers_instance, any}]).
+ ?line ?expect2(report, [{?snmpUnknownPDUHandlers_instance, any}]).
snmp_mpd_mib_c(UnknownPDUHs) ->
@@ -4568,14 +5223,14 @@ snmp_target_mib(Config) when is_list(Config) ->
?P(snmp_target_mib),
init_case(Config),
?line load_master_std("SNMP-TARGET-MIB"),
- try_test(snmp_target_mib),
+ try_test(snmp_target_mib_test),
?line unload_master("SNMP-TARGET-MIB").
snmp_target_mib_2(X) -> ?P(snmp_target_mib_2), snmp_target_mib(X).
snmp_target_mib_3(X) -> ?P(snmp_target_mib_3), snmp_target_mib(X).
-snmp_target_mib() ->
+snmp_target_mib_test() ->
?INF("NOT YET IMPLEMENTED", []),
nyi.
@@ -4584,7 +5239,7 @@ snmp_notification_mib(Config) when is_list(Config) ->
?P(snmp_notification_mib),
init_case(Config),
?line load_master_std("SNMP-NOTIFICATION-MIB"),
- try_test(snmp_notification_mib),
+ try_test(snmp_notification_mib_test),
?line unload_master("SNMP-NOTIFICATION-MIB").
snmp_notification_mib_2(X) -> ?P(snmp_notification_mib_2),
@@ -4593,7 +5248,7 @@ snmp_notification_mib_2(X) -> ?P(snmp_notification_mib_2),
snmp_notification_mib_3(X) -> ?P(snmp_notification_mib_3),
snmp_notification_mib(X).
-snmp_notification_mib() ->
+snmp_notification_mib_test() ->
?INF("NOT YET IMPLEMENTED", []),
nyi.
@@ -4745,50 +5400,51 @@ snmp_view_based_acm_mib() ->
do_set(Row) ->
s(Row),
- expect(do_set_1, Row).
+ ?expect1(Row).
add_row(RowStatus) ->
s([{RowStatus, ?createAndGo}]),
- expect(add_row_1, [{RowStatus, ?createAndGo}]).
+ ?expect1([{RowStatus, ?createAndGo}]).
del_row(RowStatus) ->
s([{RowStatus, ?destroy}]),
- expect(del_row_1, [{RowStatus, ?destroy}]).
+ ?expect1([{RowStatus, ?destroy}]).
use_no_rights() ->
g([[xDescr,0]]),
- ?v1_2_3(expect(use_no_rights_11, noSuchName, 1, any),
- expect(use_no_rights_12, [{[xDescr,0], noSuchObject}]),
- expect(use_no_rights_13, authorizationError, 1, any)),
+ ?v1_2_3(?expect3(noSuchName, 1, any),
+ ?expect1([{[xDescr,0], noSuchObject}]),
+ ?expect3(authorizationError, 1, any)),
g([[xDescr2,0]]),
- ?v1_2_3(expect(use_no_rights_21, noSuchName, 1, any),
- expect(use_no_rights_22, [{[xDescr2,0], noSuchObject}]),
- expect(use_no_rights_23, authorizationError, 1, any)),
+ ?v1_2_3(?expect3(noSuchName, 1, any),
+ ?expect1([{[xDescr2,0], noSuchObject}]),
+ ?expect3(authorizationError, 1, any)),
gn([[xDescr]]),
- ?v1_2_3(expect(use_no_rights_31, noSuchName, 1, any),
- expect(use_no_rights_32, [{[xDescr], endOfMibView}]),
- expect(use_no_rights_33, authorizationError, 1, any)),
+ ?v1_2_3(?expect3(noSuchName, 1, any),
+ ?expect1([{[xDescr], endOfMibView}]),
+ ?expect3(authorizationError, 1, any)),
s([{[xDescr,0], "tryit"}]),
- ?v1_2_3(expect(use_no_rights_41, noSuchName, 1, any),
- expect(use_no_rights_42, noAccess, 1, any),
- expect(use_no_rights_43, authorizationError, 1, any)).
+ ?v1_2_3(?expect3(noSuchName, 1, any),
+ ?expect3(noAccess, 1, any),
+ ?expect3(authorizationError, 1, any)).
use_rights() ->
g([[xDescr,0]]),
- expect(use_rights_1, [{[xDescr,0], any}]),
+ ?expect1([{[xDescr,0], any}]),
g([[xDescr2,0]]),
- expect(use_rights_2, [{[xDescr2,0], any}]),
+ ?expect1([{[xDescr2,0], any}]),
s([{[xDescr,0], "tryit"}]),
- expect(use_rights_3, noError, 0, any),
+ ?expect3(noError, 0, any),
g([[xDescr,0]]),
- expect(use_rights_4, [{[xDescr,0], "tryit"}]).
+ ?expect1([{[xDescr,0], "tryit"}]).
mk_ln(X) ->
[length(X) | X].
+
%%-----------------------------------------------------------------
%% o add/delete users and try them
%% o test all secLevels
@@ -4868,15 +5524,15 @@ snmp_user_based_sm_mib_3(Config) when is_list(Config) ->
%% Try some read requests
?line try_test(v3_sync, [[{usm_read, []}]],
- [{sec_level, authPriv}, {user, "privDES"}]),
+ [{sec_level, authPriv}, {user, "privDES"}]),
%% Delete the new user
?line try_test(v3_sync, [[{usm_del_user, []}]],
- [{sec_level, authPriv}, {user, "privDES"}]),
+ [{sec_level, authPriv}, {user, "privDES"}]),
%% Try some bad requests
?line try_test(v3_sync, [[{usm_bad, []}]],
- [{sec_level, authPriv}, {user, "privDES"}]),
+ [{sec_level, authPriv}, {user, "privDES"}]),
?line unload_master("SNMP-USER-BASED-SM-MIB").
@@ -4888,7 +5544,7 @@ usm_add_user1() ->
Vbs1 = [{[usmUserCloneFrom, NewRowIndex], RowPointer},
{[usmUserStatus, NewRowIndex], ?createAndGo}],
?line s(Vbs1),
- ?line expect(1, Vbs1),
+ ?line ?expect1(Vbs1),
ok.
usm_use_user() ->
@@ -4907,7 +5563,7 @@ usm_key_change1(ShaKey, DesKey) ->
Vbs1 = [{[usmUserAuthKeyChange, NewRowIndex], ShaKeyChange},
{[usmUserPrivKeyChange, NewRowIndex], DesKeyChange}],
s(Vbs1),
- ?line expect(1, Vbs1).
+ ?line ?expect1(Vbs1).
%% Change own private keys
usm_key_change2(OldShaKey, OldDesKey, ShaKey, DesKey) ->
@@ -4921,7 +5577,7 @@ usm_key_change2(OldShaKey, OldDesKey, ShaKey, DesKey) ->
Vbs1 = [{[usmUserOwnAuthKeyChange, NewRowIndex], ShaKeyChange},
{[usmUserOwnPrivKeyChange, NewRowIndex], DesKeyChange}],
s(Vbs1),
- ?line expect(1, Vbs1).
+ ?line ?expect1(Vbs1).
%% Change other's public keys
usm_key_change3(OldShaKey, OldDesKey, ShaKey, DesKey) ->
@@ -4934,16 +5590,16 @@ usm_key_change3(OldShaKey, OldDesKey, ShaKey, DesKey) ->
DesKey),
Vbs1 = [{[usmUserOwnAuthKeyChange, NewRowIndex], ShaKeyChange}],
s(Vbs1),
- ?line expect(1, noAccess, 1, any),
+ ?line ?expect3(noAccess, 1, any),
Vbs2 = [{[usmUserOwnPrivKeyChange, NewRowIndex], DesKeyChange}],
s(Vbs2),
- ?line expect(2, noAccess, 1, any),
+ ?line ?expect3(noAccess, 1, any),
Vbs3 = [{[usmUserAuthKeyChange, NewRowIndex], ShaKeyChange},
{[usmUserPrivKeyChange, NewRowIndex], DesKeyChange}],
s(Vbs3),
- ?line expect(1, Vbs3).
+ ?line ?expect1(Vbs3).
usm_read() ->
NewRowIndex = [11,"agentEngine", 7, "newUser"],
@@ -4953,13 +5609,12 @@ usm_read() ->
[usmUserOwnAuthKeyChange, NewRowIndex],
[usmUserPrivKeyChange, NewRowIndex],
[usmUserOwnPrivKeyChange, NewRowIndex]]),
- ?line expect(1,
- [{[usmUserSecurityName, NewRowIndex], "newUser"},
- {[usmUserCloneFrom, NewRowIndex], [0,0]},
- {[usmUserAuthKeyChange, NewRowIndex], ""},
- {[usmUserOwnAuthKeyChange, NewRowIndex], ""},
- {[usmUserPrivKeyChange, NewRowIndex], ""},
- {[usmUserOwnPrivKeyChange, NewRowIndex], ""}]),
+ ?line ?expect1([{[usmUserSecurityName, NewRowIndex], "newUser"},
+ {[usmUserCloneFrom, NewRowIndex], [0,0]},
+ {[usmUserAuthKeyChange, NewRowIndex], ""},
+ {[usmUserOwnAuthKeyChange, NewRowIndex], ""},
+ {[usmUserPrivKeyChange, NewRowIndex], ""},
+ {[usmUserOwnPrivKeyChange, NewRowIndex], ""}]),
ok.
@@ -4968,7 +5623,7 @@ usm_del_user() ->
NewRowIndex = [11,"agentEngine", 7, "newUser"],
Vbs1 = [{[usmUserStatus, NewRowIndex], ?destroy}],
?line s(Vbs1),
- ?line expect(1, Vbs1),
+ ?line ?expect1(Vbs1),
ok.
-define(usmUserCloneFrom, [1,3,6,1,6,3,15,1,2,2,1,4]).
@@ -4989,32 +5644,31 @@ usm_bad() ->
Vbs1 = [{[usmUserCloneFrom, NewRowIndex], RowPointer1},
{[usmUserStatus, NewRowIndex], ?createAndGo}],
?line s(Vbs1),
- ?line expect(1, inconsistentName, 1, any),
+ ?line ?expect3(inconsistentName, 1, any),
RowPointer2 = ?usmUserCloneFrom ++ [11|"agentEngine"] ++ [7|"privDES"],
Vbs2 = [{[usmUserCloneFrom, NewRowIndex], RowPointer2},
{[usmUserStatus, NewRowIndex], ?createAndGo}],
?line s(Vbs2),
- ?line expect(2, wrongValue, 1, any),
+ ?line ?expect3(wrongValue, 1, any),
RowPointer3 = ?usmUserSecurityName ++ [11|"agentEngine"] ++ [7|"privDES"],
Vbs3 = [{[usmUserCloneFrom, NewRowIndex], RowPointer3},
{[usmUserStatus, NewRowIndex], ?createAndGo}],
?line s(Vbs3),
- ?line expect(3, Vbs3),
+ ?line ?expect1(Vbs3),
?line s([{[usmUserAuthProtocol, NewRowIndex], ?usmNoAuthProtocol}]),
- ?line expect(4, inconsistentValue, 1, any),
+ ?line ?expect3(inconsistentValue, 1, any),
?line s([{[usmUserAuthProtocol, NewRowIndex], ?usmHMACMD5AuthProtocol}]),
- ?line expect(5, inconsistentValue, 1, any),
+ ?line ?expect3(inconsistentValue, 1, any),
?line s([{[usmUserAuthProtocol, NewRowIndex], ?usmDESPrivProtocol}]),
- ?line expect(6, wrongValue, 1, any),
+ ?line ?expect3(wrongValue, 1, any),
?line s([{[usmUserPrivProtocol, NewRowIndex], ?usmHMACSHAAuthProtocol}]),
- ?line expect(7, wrongValue, 1, any),
+ ?line ?expect3(wrongValue, 1, any),
Vbs4 = [{[usmUserStatus, NewRowIndex], ?destroy}],
?line s(Vbs4),
- ?line expect(1, Vbs4),
-
+ ?line ?expect1(Vbs4),
ok.
@@ -5023,57 +5677,58 @@ usm_bad() ->
%% works.
%% Load all std mibs that are not loaded by default.
%%-----------------------------------------------------------------
-loop_mib(suite) -> [];
-loop_mib(Config) when is_list(Config) ->
- ?P(loop_mib),
- ?LOG("loop_mib -> initiate case",[]),
- %% snmpa:verbosity(master_agent,debug),
- %% snmpa:verbosity(mib_server,info),
- {SaNode, MgrNode, MibDir} = init_case(Config),
- ?DBG("loop_mib -> ~n"
+loop_mib_1(suite) -> [];
+loop_mib_1(Config) when is_list(Config) ->
+ ?P(loop_mib_1),
+ ?LOG("loop_mib_1 -> initiate case",[]),
+
+ {_SaNode, _MgrNode, _MibDir} = init_case(Config),
+ ?DBG("loop_mib_1 -> ~n"
"\tSaNode: ~p~n"
"\tMgrNode: ~p~n"
- "\tMibDir: ~p",[SaNode, MgrNode, MibDir]),
- ?DBG("loop_mib -> load mib SNMP-COMMUNITY-MIB",[]),
+ "\tMibDir: ~p",[_SaNode, _MgrNode, _MibDir]),
+ ?DBG("loop_mib_1 -> load mib SNMP-COMMUNITY-MIB",[]),
?line load_master_std("SNMP-COMMUNITY-MIB"),
- ?DBG("loop_mib -> load mib SNMP-MPD-MIB",[]),
+ ?DBG("loop_mib_1 -> load mib SNMP-MPD-MIB",[]),
?line load_master_std("SNMP-MPD-MIB"),
- ?DBG("loop_mib -> load mib SNMP-TARGET-MIB",[]),
+ ?DBG("loop_mib_1 -> load mib SNMP-TARGET-MIB",[]),
?line load_master_std("SNMP-TARGET-MIB"),
- ?DBG("loop_mib -> load mib SNMP-NOTIFICATION-MIB",[]),
+ ?DBG("loop_mib_1 -> load mib SNMP-NOTIFICATION-MIB",[]),
?line load_master_std("SNMP-NOTIFICATION-MIB"),
- ?DBG("loop_mib -> load mib SNMP-FRAMEWORK-MIB",[]),
+ ?DBG("loop_mib_1 -> load mib SNMP-FRAMEWORK-MIB",[]),
?line load_master_std("SNMP-FRAMEWORK-MIB"),
- ?DBG("loop_mib -> load mib SNMP-VIEW-BASED-ACM-MIB",[]),
+ ?DBG("loop_mib_1 -> load mib SNMP-VIEW-BASED-ACM-MIB",[]),
?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"),
- ?DBG("loop_mib -> try",[]),
- try_test(loop_mib_1),
- ?DBG("loop_mib -> unload mib SNMP-COMMUNITY-MIB",[]),
+ ?DBG("loop_mib_1 -> try",[]),
+
+ try_test(loop_mib_1_test),
+
+ ?DBG("loop_mib_1 -> unload mib SNMP-COMMUNITY-MIB",[]),
?line unload_master("SNMP-COMMUNITY-MIB"),
- ?DBG("loop_mib -> unload mib SNMP-MPD-MIB",[]),
+ ?DBG("loop_mib_1 -> unload mib SNMP-MPD-MIB",[]),
?line unload_master("SNMP-MPD-MIB"),
- ?DBG("loop_mib -> unload mib SNMP-TARGET-MIB",[]),
+ ?DBG("loop_mib_1 -> unload mib SNMP-TARGET-MIB",[]),
?line unload_master("SNMP-TARGET-MIB"),
- ?DBG("loop_mib -> unload mib SNMP-NOTIFICATION-MIB",[]),
+ ?DBG("loop_mib_1 -> unload mib SNMP-NOTIFICATION-MIB",[]),
?line unload_master("SNMP-NOTIFICATION-MIB"),
- ?DBG("loop_mib -> unload mib SNMP-FRAMEWORK-MIB",[]),
+ ?DBG("loop_mib_1 -> unload mib SNMP-FRAMEWORK-MIB",[]),
?line unload_master("SNMP-FRAMEWORK-MIB"),
- ?DBG("loop_mib -> unload mib SNMP-VIEW-BASED-ACM-MIB",[]),
+ ?DBG("loop_mib_1 -> unload mib SNMP-VIEW-BASED-ACM-MIB",[]),
?line unload_master("SNMP-VIEW-BASED-ACM-MIB"),
%% snmpa:verbosity(master_agent,log),
%% snmpa:verbosity(mib_server,silence),
- ?LOG("loop_mib -> done",[]).
+ ?LOG("loop_mib_1 -> done",[]).
loop_mib_2(suite) -> [];
loop_mib_2(Config) when is_list(Config) ->
?P(loop_mib_2),
?LOG("loop_mib_2 -> initiate case",[]),
- {SaNode, MgrNode, MibDir} = init_case(Config),
- ?DBG("loop_mib_2 -> ~n"
+ {_SaNode, _MgrNode, _MibDir} = init_case(Config),
+ ?DBG("do_loop_mib_2 -> ~n"
"\tSaNode: ~p~n"
"\tMgrNode: ~p~n"
- "\tMibDir: ~p",[SaNode, MgrNode, MibDir]),
+ "\tMibDir: ~p", [_SaNode, _MgrNode, _MibDir]),
?DBG("loop_mib_2 -> load mibs",[]),
?line load_master_std("SNMP-COMMUNITY-MIB"),
?line load_master_std("SNMP-MPD-MIB"),
@@ -5081,7 +5736,9 @@ loop_mib_2(Config) when is_list(Config) ->
?line load_master_std("SNMP-NOTIFICATION-MIB"),
?line load_master_std("SNMP-FRAMEWORK-MIB"),
?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"),
- try_test(loop_mib_2),
+
+ try_test(loop_mib_2_test),
+
?DBG("loop_mib_2 -> unload mibs",[]),
?line unload_master("SNMP-COMMUNITY-MIB"),
?line unload_master("SNMP-MPD-MIB"),
@@ -5096,18 +5753,18 @@ loop_mib_3(suite) -> [];
loop_mib_3(Config) when is_list(Config) ->
?P(loop_mib_3),
?LOG("loop_mib_3 -> initiate case",[]),
- {SaNode, MgrNode, MibDir} = init_case(Config),
+ {_SaNode, _MgrNode, _MibDir} = init_case(Config),
?DBG("loop_mib_3 -> ~n"
"\tSaNode: ~p~n"
"\tMgrNode: ~p~n"
- "\tMibDir: ~p",[SaNode, MgrNode, MibDir]),
+ "\tMibDir: ~p", [_SaNode, _MgrNode, _MibDir]),
?DBG("loop_mib_3 -> load mibs",[]),
?line load_master_std("SNMP-TARGET-MIB"),
?line load_master_std("SNMP-NOTIFICATION-MIB"),
?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"),
?line load_master_std("SNMP-USER-BASED-SM-MIB"),
- try_test(loop_mib_2),
+ try_test(loop_mib_3_test),
?DBG("loop_mib_3 -> unload mibs",[]),
?line unload_master("SNMP-TARGET-MIB"),
@@ -5118,17 +5775,16 @@ loop_mib_3(Config) when is_list(Config) ->
%% Req. As many mibs all possible
-loop_mib_1() ->
- ?DBG("loop_mib_1 -> entry",[]),
+loop_mib_1_test() ->
+ ?DBG("loop_mib_1_test -> entry",[]),
N = loop_it_1([1,1], 0),
io:format(user, "found ~w varibles\n", [N]),
?line N = if N < 100 -> 100;
true -> N
end.
-
loop_it_1(Oid, N) ->
- ?DBG("loop_it_1 -> entry with~n"
+ ?DBG("loop_it_1_test -> entry with~n"
"\tOid: ~p~n"
"\tN: ~p",[Oid,N]),
case get_next_req([Oid]) of
@@ -5136,13 +5792,13 @@ loop_it_1(Oid, N) ->
error_status = noError,
error_index = 0,
varbinds = [#varbind{oid = NOid,
- value = Value}]} when NOid > Oid ->
- ?DBG("loop_it_1 -> "
+ value = _Value}]} when NOid > Oid ->
+ ?DBG("loop_it_1_test -> "
"~n NOid: ~p"
- "~n Value: ~p",[NOid, Value]),
- ?line [Value2] = get_req(1, [NOid]), % must not be same
- ?DBG("loop_it_1 -> "
- "~n Value2: ~p",[Value2]),
+ "~n Value: ~p", [NOid, _Value]),
+ ?line [_Value2] = get_req(1, [NOid]), % must not be same
+ ?DBG("loop_it_1_test -> "
+ "~n Value2: ~p", [_Value2]),
loop_it_1(NOid, N+1);
#pdu{type = 'get-response',
@@ -5155,7 +5811,7 @@ loop_it_1(Oid, N) ->
error_status = noSuchName,
error_index = 1,
varbinds = [_]} ->
- ?DBG("loop_it_1 -> done: ~p",[N]),
+ ?DBG("loop_it_1_test -> done: ~p",[N]),
N;
#pdu{type = 'get-response',
@@ -5176,14 +5832,13 @@ loop_it_1(Oid, N) ->
%% Req. As many mibs all possible
-loop_mib_2() ->
- ?DBG("loop_mib_1 -> entry",[]),
+loop_mib_2_test() ->
+ ?DBG("loop_mib_2_test -> entry",[]),
N = loop_it_2([1,1], 0),
io:format(user, "found ~w varibles\n", [N]),
?line N = if N < 100 -> 100;
true -> N
end.
-
loop_it_2(Oid, N) ->
?DBG("loop_it_2 -> entry with"
@@ -5193,22 +5848,22 @@ loop_it_2(Oid, N) ->
#pdu{type = 'get-response',
error_status = noError,
error_index = 0,
- varbinds = [#varbind{oid = NOid, value = endOfMibView}]} ->
+ varbinds = [#varbind{oid = _NOid, value = endOfMibView}]} ->
?DBG("loop_it_2 -> "
- "~n NOid: ~p",[NOid]),
+ "~n NOid: ~p", [_NOid]),
N;
#pdu{type = 'get-response',
error_status = noError,
error_index = 0,
varbinds = [#varbind{oid = NOid,
- value = Value}]} when NOid > Oid ->
+ value = _Value}]} when NOid > Oid ->
?DBG("loop_it_2 -> "
"~n NOid: ~p"
- "~n Value: ~p",[NOid, Value]),
- ?line [Value2] = get_req(1, [NOid]), % must not be same
+ "~n Value: ~p", [NOid, _Value]),
+ ?line [_Value2] = get_req(1, [NOid]), % must not be same
?DBG("loop_it_2 -> "
- "~n Value2: ~p",[Value2]),
+ "~n Value2: ~p", [_Value2]),
loop_it_2(NOid, N+1);
#pdu{type = 'get-response',
@@ -5251,12 +5906,69 @@ loop_it_2(Oid, N) ->
end.
+loop_mib_3_test() ->
+ ?DBG("loop_mib_3_test -> entry",[]),
+ loop_mib_2_test().
+
%%%-----------------------------------------------------------------
%%% Testing of reported bugs and other tickets.
%%%-----------------------------------------------------------------
+reported_bugs_cases() ->
+ [
+ otp_1128,
+ otp_1129,
+ otp_1131,
+ otp_1162,
+ otp_1222,
+ otp_1298,
+ otp_1331,
+ otp_1338,
+ otp_1342,
+ otp_1366,
+ otp_2776,
+ otp_2979,
+ otp_3187,
+ otp_3725
+ ].
+reported_bugs2_cases() ->
+ [
+ otp_1128_2,
+ otp_1129_2,
+ otp_1131_2,
+ otp_1162_2,
+ otp_1222_2,
+ otp_1298_2,
+ otp_1331_2,
+ otp_1338_2,
+ otp_1342_2,
+ otp_1366_2,
+ otp_2776_2,
+ otp_2979_2,
+ otp_3187_2
+ ].
+
+reported_bugs3_cases() ->
+ [
+ otp_1128_3,
+ otp_1129_3,
+ otp_1131_3,
+ otp_1162_3,
+ otp_1222_3,
+ otp_1298_3,
+ otp_1331_3,
+ otp_1338_3,
+ otp_1342_3,
+ otp_1366_3,
+ otp_2776_3,
+ otp_2979_3,
+ otp_3187_3,
+ otp_3542
+ ].
+
+
%%-----------------------------------------------------------------
%% Ticket: OTP-1128
%% Slogan: Bug in handling of createAndWait set-requests.
@@ -5268,14 +5980,14 @@ otp_1128(Config) when is_list(Config) ->
?line load_master("OLD-SNMPEA-MIB"),
?line init_old(),
- try_test(otp_1128),
+ try_test(otp_1128_test),
?line unload_master("OLD-SNMPEA-MIB").
otp_1128_2(X) -> ?P(otp_1128_2), otp_1128(X).
otp_1128_3(X) -> ?P(otp_1128_3), otp_1128(X).
-otp_1128() ->
+otp_1128_test() ->
io:format("Testing bug reported in ticket OTP-1128...~n"),
NewKeyc3 = [intCommunityViewIndex,get(mip),is("test")],
@@ -5283,15 +5995,16 @@ otp_1128() ->
NewKeyc5 = [intCommunityStatus,get(mip),is("test")],
s([{NewKeyc5, ?createAndWait}, {NewKeyc4, 2}]),
- ?line expect(28, [{NewKeyc5, ?createAndWait}, {NewKeyc4, 2}]),
+ ?line ?expect1([{NewKeyc5, ?createAndWait}, {NewKeyc4, 2}]),
g([NewKeyc5]),
- ?line expect(29, [{NewKeyc5, ?notReady}]),
+ ?line ?expect1([{NewKeyc5, ?notReady}]),
s([{NewKeyc5, ?active}, {NewKeyc3, 2}]),
- ?line expect(30, [{NewKeyc5, ?active}, {NewKeyc3, 2}]),
+ ?line ?expect1([{NewKeyc5, ?active}, {NewKeyc3, 2}]),
g([NewKeyc5]),
- ?line expect(31, [{NewKeyc5, ?active}]),
+ ?line ?expect1([{NewKeyc5, ?active}]),
s([{NewKeyc5, ?destroy}]),
- ?line expect(32, [{NewKeyc5, ?destroy}]).
+ ?line ?expect1([{NewKeyc5, ?destroy}]).
+
%%-----------------------------------------------------------------
%% Ticket: OTP-1129, OTP-1169
@@ -5314,6 +6027,7 @@ otp_1129_i(MaNode) ->
false = rpc:call(MaNode, snmp, int_to_enum, [iso, 1]),
false = rpc:call(MaNode, snmp, int_to_enum, [isox, 1]).
+
%%-----------------------------------------------------------------
%% Ticket: OTP-1131
%% Slogan: Agent crashes / erlang node halts if RowIndex in a
@@ -5326,7 +6040,7 @@ otp_1131(Config) when is_list(Config) ->
init_case(Config),
?line load_master("Klas1"),
- try_test(otp_1131),
+ try_test(otp_1131_test),
?line unload_master("Klas1").
otp_1131_2(X) -> ?P(otp_1131_2), otp_1131(X).
@@ -5369,11 +6083,11 @@ otp_1131_3(X) ->
?P(otp_1131_3),
otp_1131(X).
-otp_1131() ->
+otp_1131_test() ->
io:format("Testing bug reported in ticket OTP-1131...~n"),
s([{[friendsEntry, [2, 3, 1]], s, "kompis3"},
{[friendsEntry, [3, 3, 1]], i, ?createAndGo}]),
- ?line expect(1, ?v1_2(noSuchName, noCreation), 2, any).
+ ?line ?expect3(?v1_2(noSuchName, noCreation), 2, any).
%%-----------------------------------------------------------------
@@ -5385,16 +6099,16 @@ otp_1162(Config) when is_list(Config) ->
?P(otp_1162),
{SaNode, _MgrNode, _MibDir} = init_case(Config),
?line {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"),
- try_test(otp_1162),
+ try_test(otp_1162_test),
stop_subagent(SA).
otp_1162_2(X) -> ?P(otp_1162_2), otp_1162(X).
otp_1162_3(X) -> ?P(otp_1162_3), otp_1162(X).
-otp_1162() ->
+otp_1162_test() ->
s([{[sa, [2,0]], 6}]), % wrongValue (i is_set_ok)
- ?line expect(1, ?v1_2(badValue, wrongValue), 1, any).
+ ?line ?expect3(?v1_2(badValue, wrongValue), 1, any).
%%-----------------------------------------------------------------
@@ -5407,7 +6121,7 @@ otp_1222(Config) when is_list(Config) ->
init_case(Config),
?line load_master("Klas3"),
?line load_master("Klas4"),
- try_test(otp_1222),
+ try_test(otp_1222_test),
?line unload_master("Klas3"),
?line unload_master("Klas4").
@@ -5415,12 +6129,13 @@ otp_1222_2(X) -> ?P(otp_1222_2), otp_1222(X).
otp_1222_3(X) -> ?P(otp_1222_3), otp_1222(X).
-otp_1222() ->
+otp_1222_test() ->
io:format("Testing bug reported in ticket OTP-1222...~n"),
s([{[fStatus4,1], 4}, {[fName4,1], 1}]),
- ?line expect(1, genErr, 0, any),
+ ?line ?expect3(genErr, 0, any),
s([{[fStatus4,2], 4}, {[fName4,2], 1}]),
- ?line expect(2, genErr, 0, any).
+ ?line ?expect3(genErr, 0, any).
+
%%-----------------------------------------------------------------
%% Ticket: OTP-1298
@@ -5432,17 +6147,17 @@ otp_1298(Config) when is_list(Config) ->
init_case(Config),
?line load_master("Klas2"),
- try_test(otp_1298),
+ try_test(otp_1298_test),
?line unload_master("Klas2").
otp_1298_2(X) -> ?P(otp_1298_2), otp_1298(X).
otp_1298_3(X) -> ?P(otp_1298_3), otp_1298(X).
-otp_1298() ->
+otp_1298_test() ->
io:format("Testing bug reported in ticket OTP-1298...~n"),
s([{[fint,0], -1}]),
- ?line expect(1298, [{[fint,0], -1}]).
+ ?line ?expect1([{[fint,0], -1}]).
%%-----------------------------------------------------------------
@@ -5455,17 +6170,17 @@ otp_1331(Config) when is_list(Config) ->
init_case(Config),
?line load_master("OLD-SNMPEA-MIB"),
?line init_old(),
- try_test(otp_1331),
+ try_test(otp_1331_test),
?line unload_master("OLD-SNMPEA-MIB").
otp_1331_2(X) -> ?P(otp_1331_2), otp_1331(X).
otp_1331_3(X) -> ?P(otp_1331_3), otp_1331(X).
-otp_1331() ->
+otp_1331_test() ->
NewKeyc5 = [intCommunityStatus,[127,32,0,0],is("test")],
s([{NewKeyc5, ?destroy}]),
- ?line expect(1, [{NewKeyc5, ?destroy}]).
+ ?line ?expect1([{NewKeyc5, ?destroy}]).
%%-----------------------------------------------------------------
@@ -5478,18 +6193,19 @@ otp_1338(Config) when is_list(Config) ->
init_case(Config),
?line load_master("Klas2"),
- try_test(otp_1338),
+ try_test(otp_1338_test),
?line unload_master("Klas2").
otp_1338_2(X) -> ?P(otp_1338_2), otp_1338(X).
otp_1338_3(X) -> ?P(otp_1338_3), otp_1338(X).
-otp_1338() ->
+otp_1338_test() ->
s([{[kStatus2, 7], i, ?createAndGo}]),
- ?line expect(1, [{[kStatus2, 7], ?createAndGo}]),
+ ?line ?expect1([{[kStatus2, 7], ?createAndGo}]),
g([[kName2, 7]]),
- ?line expect(2, [{[kName2, 7], "JJJ"}]).
+ ?line ?expect1([{[kName2, 7], "JJJ"}]).
+
%%-----------------------------------------------------------------
%% Ticket: OTP-1342
@@ -5501,18 +6217,18 @@ otp_1342(Config) when is_list(Config) ->
?P(otp_1342),
init_case(Config),
?line load_master("Klas4"),
- try_test(otp_1342),
+ try_test(otp_1342_test),
?line unload_master("Klas4").
otp_1342_2(X) -> ?P(otp_1342_2), otp_1342(X).
otp_1342_3(X) -> ?P(otp_1342_3), otp_1342(X).
-otp_1342() ->
+otp_1342_test() ->
s([{[fIndex5, 1], i, 1},
{[fName5, 1], i, 3},
{[fStatus5, 1], i, ?createAndGo}]),
- ?line expect(1, ?v1_2(noSuchName, noCreation), 3, any).
+ ?line ?expect3(?v1_2(noSuchName, noCreation), 3, any).
%%-----------------------------------------------------------------
@@ -5527,17 +6243,18 @@ otp_1366(Config) when is_list(Config) ->
init_case(Config),
?line load_master("OLD-SNMPEA-MIB"),
?line init_old(),
- try_test(otp_1366),
+ try_test(otp_1366_test),
?line unload_master("OLD-SNMPEA-MIB").
otp_1366_2(X) -> ?P(otp_1366_2), otp_1366(X).
otp_1366_3(X) -> ?P(otp_1366_3), otp_1366(X).
-otp_1366() ->
+otp_1366_test() ->
?INF("NOT YET IMPLEMENTED", []),
'NYI'.
+
%%-----------------------------------------------------------------
%% Ticket: OTP-2776
%% Slogan: snmp:validate_date_and_time() fails when time is 00:00
@@ -5546,13 +6263,13 @@ otp_2776(suite) -> [];
otp_2776(Config) when is_list(Config) ->
?P(otp_2776),
init_case(Config),
- try_test(otp_2776).
+ try_test(otp_2776_test).
otp_2776_2(X) -> ?P(otp_2776_2), otp_2776(X).
otp_2776_3(X) -> ?P(otp_2776_3), otp_2776(X).
-otp_2776() ->
+otp_2776_test() ->
io:format("Testing bug reported in ticket OTP-2776...~n"),
Dt01_valid = [19,98,9,1,1,0,23,0,43,0,0],
@@ -5615,17 +6332,18 @@ otp_2979(Config) when is_list(Config) ->
init_case(Config),
?line load_master("Test1"),
?line init_old(),
- try_test(otp_2979),
+ try_test(otp_2979_test),
?line unload_master("Test1").
otp_2979_2(X) -> ?P(otp_2979_2), otp_2979(X).
otp_2979_3(X) -> ?P(otp_2979_3), otp_2979(X).
-otp_2979() ->
+otp_2979_test() ->
gn([[sparseDescr], [sparseStatus]]),
- ?line expect(1, [{[sparseStr,0], "slut"},
- {[sparseStr,0], "slut"}]).
+ ?line ?expect1([{[sparseStr,0], "slut"},
+ {[sparseStr,0], "slut"}]).
+
%%-----------------------------------------------------------------
%% Ticket: OTP-3187
@@ -5637,14 +6355,14 @@ otp_3187(Config) when is_list(Config) ->
?P(otp_3187),
init_case(Config),
?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"),
- otp_3187(),
+ otp_3187_test(),
?line unload_master("SNMP-VIEW-BASED-ACM-MIB").
otp_3187_2(X) -> ?P(otp_3187_2), otp_3187(X).
otp_3187_3(X) -> ?P(otp_3187_3), otp_3187(X).
-otp_3187() ->
+otp_3187_test() ->
?line Elements =
snmp_view_based_acm_mib:vacmAccessTable(get_next,[],[4,5,6]),
lists:foreach(fun(E) ->
@@ -5662,9 +6380,9 @@ otp_3542(suite) -> [];
otp_3542(Config) when is_list(Config) ->
?P(otp_3542),
init_case(Config),
- try_test(otp_3542).
+ try_test(otp_3542_test).
-otp_3542() ->
+otp_3542_test() ->
io:format("SNMP v3 discovery...~n"),
?line Res = snmp_test_mgr:d(),
io:format("SNMP v3 discovery result: ~p~n",[Res]).
@@ -5733,10 +6451,15 @@ otp_3725_test(MaNode) ->
%% Slogan: Target mib tag list check invalid
%%-----------------------------------------------------------------
+tickets1_cases() ->
+ [
+ {group, otp4394},
+ {group, otp7157}
+ ].
+
-
-init_otp_4394(Config) when is_list(Config) ->
- ?DBG("init_otp_4394 -> entry with"
+otp_4394_init(Config) when is_list(Config) ->
+ ?DBG("otp_4394_init -> entry with"
"~n Config: ~p", [Config]),
?line AgentConfDir = ?config(agent_conf_dir, Config),
?line MgrDir = ?config(mgr_dir, Config),
@@ -5759,8 +6482,8 @@ otp_4394_config(AgentConfDir, MgrDir, Ip0) ->
"OTP-4394 test"),
?line case update_usm(Vsn, AgentConfDir) of
true ->
- ?line copy_file(filename:join(AgentConfDir, "usm.conf"),
- filename:join(MgrDir, "usm.conf")),
+ ?line copy_file(join(AgentConfDir, "usm.conf"),
+ join(MgrDir, "usm.conf")),
?line update_usm_mgr(Vsn, MgrDir);
false ->
?line ok
@@ -5770,14 +6493,14 @@ otp_4394_config(AgentConfDir, MgrDir, Ip0) ->
?line write_community_conf(AgentConfDir, [C1, C2]),
?line update_vacm(Vsn, AgentConfDir),
Ta1 = {"shelob v1",
- [134,138,177,177], 5000, 1500, 3, %% Anv�nd Ip och modda
+ [134,138,177,177], 5000, 1500, 3, %% Use Ip and modify
"pc1",
"target_v1", "",
%% [255,255,255,255,0,0],
[],
2048},
Ta2 = {"bifur v1",
- [134,138,177,75], 5000, 1500, 3, %% Anv�nd Ip
+ [134,138,177,75], 5000, 1500, 3, %% Use Ip
"pc2",
"target_v1", "",
%% [255,255,255,255,0,0],
@@ -5787,37 +6510,35 @@ otp_4394_config(AgentConfDir, MgrDir, Ip0) ->
?line write_notify_conf(AgentConfDir),
ok.
-
-
-finish_otp_4394(Config) when is_list(Config) ->
+otp_4394_finish(Config) when is_list(Config) ->
?DBG("finish_otp_4394 -> entry", []),
C1 = stop_agent(Config),
delete_files(C1),
erase(mgr_node),
lists:keydelete(vsn, 1, C1).
-otp_4394_test(suite) -> [];
-otp_4394_test(Config) ->
- ?P(otp_4394_test),
- ?DBG("otp_4394_test -> entry", []),
+otp_4394(suite) -> [];
+otp_4394(Config) ->
+ ?P(otp_4394),
+ ?DBG("otp_4394 -> entry", []),
init_case(Config),
- try_test(otp_4394_test1),
- ?DBG("otp_4394_test -> done", []),
+ try_test(otp_4394_test),
+ ?DBG("otp_4394 -> done", []),
ok.
-otp_4394_test1() ->
- ?DBG("otp_4394_test1 -> entry", []),
+otp_4394_test() ->
+ ?DBG("otp_4394_test -> entry", []),
gn([[1,1]]),
Res =
case snmp_test_mgr:expect(1, [{[sysDescr,0], "Erlang SNMP agent"}]) of
%% {error, 1, {"?",[]}, {"~w",[timeout]}}
{error, 1, _, {_, [timeout]}} ->
- ?DBG("otp_4394_test1 -> expected result: timeout", []),
+ ?DBG("otp_4394_test -> expected result: timeout", []),
ok;
Else ->
Else
end,
- ?DBG("otp_4394_test1 -> done with: ~p", [Res]),
+ ?DBG("otp_4394_test -> done with: ~p", [Res]),
Res.
@@ -5828,7 +6549,7 @@ otp_4394_test1() ->
-init_otp_7157(Config) when is_list(Config) ->
+otp_7157_init(Config) when is_list(Config) ->
%% <CONDITIONAL-SKIP>
Skippable = [win32],
Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
@@ -5848,30 +6569,30 @@ init_otp_7157(Config) when is_list(Config) ->
[{vsn, v2} | start_v2_agent(Config, Opts)].
-finish_otp_7157(Config) when is_list(Config) ->
+otp_7157_finish(Config) when is_list(Config) ->
?DBG("finish_otp_7157 -> entry", []),
C1 = stop_agent(Config),
delete_files(C1),
erase(mgr_node),
lists:keydelete(vsn, 1, C1).
-otp_7157_test(suite) -> [];
-otp_7157_test(Config) ->
- ?P(otp_7157_test),
- ?DBG("otp_7157_test -> entry", []),
+otp_7157(suite) -> [];
+otp_7157(Config) ->
+ ?P(otp_7157),
+ ?DBG("otp_7157 -> entry", []),
init_case(Config),
MA = whereis(snmp_master_agent),
?line load_master("Test1"),
- try_test(otp_7157_test1, [MA]),
+ try_test(otp_7157_test, [MA]),
?line unload_master("Test1"),
- ?DBG("otp_7157_test -> done", []),
+ ?DBG("otp_7157 -> done", []),
ok.
%% ts:run(snmp, snmp_agent_test, [batch]).
-otp_7157_test1(MA) ->
- ?LOG("start otp_7157_test1 test (~p)",[MA]),
+otp_7157_test(MA) ->
+ ?LOG("start otp_7157_test test (~p)",[MA]),
snmpa:verbosity(MA, trace),
- ?LOG("start otp_7157_test1 test",[]),
+ ?LOG("start otp_7157_test test",[]),
?P1("Testing that varbinds in traps/notifications are not reordered"),
?DBG("send cntTrap",[]),
@@ -5879,11 +6600,11 @@ otp_7157_test1(MA) ->
?DBG("await response",[]),
%% We don't really care about the values, just the vb order.
- ?line ok = expect(1, v2trap, [{[sysUpTime, 0], any},
- {[snmpTrapOID, 0], any},
- {[sysContact, 0], any},
- {[cnt64, 0], any},
- {[sysLocation, 0], any}]),
+ ?line ok = ?expect2(v2trap, [{[sysUpTime, 0], any},
+ {[snmpTrapOID, 0], any},
+ {[sysContact, 0], any},
+ {[cnt64, 0], any},
+ {[sysLocation, 0], any}]),
?DBG("done", []),
ok.
@@ -5895,6 +6616,13 @@ otp_7157_test1(MA) ->
%% These cases are started in the new way
%%-----------------------------------------------------------------
+tickets2_cases() ->
+ [
+ otp8395,
+ otp9884
+ ].
+
+
otp8395({init, Config}) when is_list(Config) ->
?DBG("otp8395(init) -> entry with"
"~n Config: ~p", [Config]),
@@ -5904,7 +6632,6 @@ otp8395({init, Config}) when is_list(Config) ->
%%
{ok, AgentNode} = start_node(agent),
- %% {ok, SubAgentNode} = start_node(sub_agent),
{ok, ManagerNode} = start_node(manager),
%% --
@@ -5912,19 +6639,12 @@ otp8395({init, Config}) when is_list(Config) ->
%%
AgentDbDir = ?config(agent_db_dir, Config),
- AgentMnesiaDir = filename:join([AgentDbDir, "mnesia"]),
+ AgentMnesiaDir = join([AgentDbDir, "mnesia"]),
mnesia_init(AgentNode, AgentMnesiaDir),
- %% SubAgentDir = ?config(sub_agent_dir, Config),
- %% SubAgentMnesiaDir = filename:join([SubAgentDir, "mnesia"]),
- %% mnesia_init(SubAgentNode, SubAgentMnesiaDir),
-
- %% ok = mnesia_create_schema(AgentNode, [AgentNode, SubAgentNode]),
- %% ok = mnesia:create_schema([AgentNode, SubAgentNode]),
mnesia_create_schema(AgentNode, [AgentNode]),
mnesia_start(AgentNode),
- %% mnesia_start(SubAgentNode),
%% --
%% Host & IP
@@ -5934,6 +6654,7 @@ otp8395({init, Config}) when is_list(Config) ->
%% SubAgentHost = ?HPSTNAME(SubAgentNode),
ManagerHost = ?HOSTNAME(ManagerNode),
+ IpFamily = inet,
Host = snmp_test_lib:hostname(),
Ip = ?LOCALHOST(),
{ok, AgentIP0} = snmp_misc:ip(AgentHost),
@@ -5951,9 +6672,7 @@ otp8395({init, Config}) when is_list(Config) ->
Vsns = [v1],
AgentConfDir = ?config(agent_conf_dir, Config),
ManagerConfDir = ?config(manager_top_dir, Config),
- snmp_agent_test_lib:config(Vsns,
- ManagerConfDir, AgentConfDir,
- ManagerIP, AgentIP),
+ config(Vsns, ManagerConfDir, AgentConfDir, ManagerIP, AgentIP, IpFamily),
%% --
@@ -5962,6 +6681,7 @@ otp8395({init, Config}) when is_list(Config) ->
Config2 = start_agent([{host, Host},
{ip, Ip},
+ {ipfamily, IpFamily},
{agent_node, AgentNode},
{agent_host, AgentHost},
{agent_ip, AgentIP},
@@ -6010,11 +6730,6 @@ otp8395({fin, Config}) when is_list(Config) ->
?DBG("otp8395(fin) -> stop agent node", []),
stop_node(AgentNode),
-
- %% SubAgentNode = ?config(sub_agent_node, Config),
- %% stop_node(SubAgentNode),
-
-
%% -
%% Stop the manager node
%%
@@ -6041,22 +6756,23 @@ otp8395(Config) when is_list(Config) ->
put(mib_dir, ?config(mib_dir, Config)),
put(vsn, v1),
put(master_host, ?config(agent_host, Config)),
+ put(ipfamily, ?config(ipfamily, Config)),
try_test(simple_standard_test),
?SLEEP(1000),
AgentNode = ?config(agent_node, Config),
AgentLogDir = ?config(agent_log_dir, Config),
- OutFile = filename:join([AgentLogDir, "otp8395.txt"]),
- {ok, LogInfo} = rpc:call(AgentNode, snmpa, log_info, []),
- ?DBG("otp8395 -> LogInfo: ~p", [LogInfo]),
+ OutFile = join([AgentLogDir, "otp8395.txt"]),
+ {ok, _LogInfo} = rpc:call(AgentNode, snmpa, log_info, []),
+ ?DBG("otp8395 -> LogInfo: ~p", [_LogInfo]),
%% SyncRes = rpc:call(AgentNode, snmp, log_sync, [?audit_trail_log_name]),
%% ?DBG("otp8395 -> SyncRes: ~p", [SyncRes]),
ok = agent_log_validation(AgentNode),
- LTTRes =
+ _LTTRes =
rpc:call(AgentNode, snmpa, log_to_txt, [AgentLogDir, [], OutFile]),
- ?DBG("otp8395 -> LTTRes: ~p", [LTTRes]),
+ ?DBG("otp8395 -> LTTRes: ~p", [_LTTRes]),
?SLEEP(1000),
?DBG("otp8395 -> done", []),
@@ -6068,126 +6784,12 @@ otp8395(Config) when is_list(Config) ->
otp9884({init, Config}) when is_list(Config) ->
?DBG("otp9884(init) -> entry with"
"~n Config: ~p", [Config]),
-
- %% --
- %% Start nodes
- %%
-
- {ok, AgentNode} = start_node(agent),
-
- %% We don't use a manager in this test but the (common) config
- %% function takes an argument that is derived from this
- {ok, ManagerNode} = start_node(manager),
-
- %% --
- %% Mnesia init
- %%
-
- AgentDbDir = ?config(agent_db_dir, Config),
- AgentMnesiaDir = filename:join([AgentDbDir, "mnesia"]),
- mnesia_init(AgentNode, AgentMnesiaDir),
-
- mnesia_create_schema(AgentNode, [AgentNode]),
-
- mnesia_start(AgentNode),
-
- %% --
- %% Host & IP
- %%
-
- AgentHost = ?HOSTNAME(AgentNode),
- ManagerHost = ?HOSTNAME(ManagerNode),
-
- Host = snmp_test_lib:hostname(),
- Ip = ?LOCALHOST(),
- {ok, AgentIP0} = snmp_misc:ip(AgentHost),
- AgentIP = tuple_to_list(AgentIP0),
- {ok, ManagerIP0} = snmp_misc:ip(ManagerHost),
- ManagerIP = tuple_to_list(ManagerIP0),
-
-
- %% --
- %% Write agent config
- %%
-
- Vsns = [v1],
- ManagerConfDir = ?config(manager_top_dir, Config),
- AgentConfDir = ?config(agent_conf_dir, Config),
- AgentTopDir = ?config(agent_top_dir, Config),
- AgentBkpDir1 = filename:join([AgentTopDir, backup1]),
- AgentBkpDir2 = filename:join([AgentTopDir, backup2]),
- ok = file:make_dir(AgentBkpDir1),
- ok = file:make_dir(AgentBkpDir2),
- AgentBkpDirs = [AgentBkpDir1, AgentBkpDir2],
- snmp_agent_test_lib:config(Vsns,
- ManagerConfDir, AgentConfDir,
- ManagerIP, AgentIP),
-
-
- %% --
- %% Start the agent
- %%
-
- Config2 = start_agent([{host, Host},
- {ip, Ip},
- {agent_node, AgentNode},
- {agent_host, AgentHost},
- {agent_ip, AgentIP},
- {agent_backup_dirs, AgentBkpDirs}|Config]),
-
- %% --
- %% Create watchdog
- %%
-
- Dog = ?WD_START(?MINS(1)),
-
- [{watchdog, Dog} | Config2];
+ init_v1_agent([{ipfamily, inet} | Config]);
otp9884({fin, Config}) when is_list(Config) ->
?DBG("otp9884(fin) -> entry with"
"~n Config: ~p", [Config]),
-
- AgentNode = ?config(agent_node, Config),
- ManagerNode = ?config(manager_node, Config),
-
- %% -
- %% Stop agent (this is the nice way to do it,
- %% so logs and files can be closed in the proper way).
- %%
-
- AgentSup = ?config(agent_sup, Config),
- ?DBG("otp9884(fin) -> stop (stand-alone) agent: ~p", [AgentSup]),
- stop_stdalone_agent(AgentSup),
-
- %% -
- %% Stop mnesia
- %%
- ?DBG("otp9884(fin) -> stop mnesia", []),
- mnesia_stop(AgentNode),
-
-
- %% -
- %% Stop the agent node
- %%
-
- ?DBG("otp9884(fin) -> stop agent node", []),
- stop_node(AgentNode),
-
-
- %% SubAgentNode = ?config(sub_agent_node, Config),
- %% stop_node(SubAgentNode),
-
-
- %% -
- %% Stop the manager node
- %%
-
- ?DBG("otp9884(fin) -> stop manager node", []),
- stop_node(ManagerNode),
-
- Dog = ?config(watchdog, Config),
- ?WD_STOP(Dog),
- lists:keydelete(watchdog, 1, Config);
+ fin_v1_agent(Config);
otp9884(doc) ->
"OTP-9884 - Simlutaneous backup call should not work. ";
@@ -6247,8 +6849,6 @@ otp9884_await_backup_completion(First, Second)
end;
otp9884_await_backup_completion(First, Second) ->
throw({error, {bad_completion, First, Second}}).
-
-
%%-----------------------------------------------------------------
agent_log_validation(Node) ->
@@ -6346,20 +6946,6 @@ process_options(Defaults, _Opts) ->
%% process_options(Defaults, Opts, []).
Defaults.
-%% process_options([], _Opts, Acc) ->
-%% lists:reverse(Acc);
-%% process_options([{Key, DefaultValue}|Defaults], Opts, Acc) ->
-%% case lists:keysearch(Key, 1, Opts) of
-%% {value, {Key, Value}} when is_list->
-
-
-snmp_app_env_init(Node, Entity, Conf) ->
- rpc:call(Node, snmp_app_env_init, [Entity, Conf]).
-
-snmp_app_env_init(Entity, Conf) ->
- application:unload(snmp),
- application:load(snmp),
- application:set_env(snmp, Entity, Conf).
start_stdalone_agent(Node, Config) ->
rpc:call(Node, ?MODULE, start_stdalone_agent, [Config]).
@@ -6377,10 +6963,10 @@ stop_stdalone_agent(Pid) when (node(Pid) =/= node()) ->
MRef = erlang:monitor(process, Pid),
rpc:call(node(Pid), ?MODULE, stop_stdalone_agent, [Pid]),
receive
- {'DOWN', MRef, process, Pid, Info} ->
+ {'DOWN', MRef, process, Pid, _Info} ->
?DBG("received expected DOWN message "
"regarding snmp agent supervisor: "
- "~n Info: ~p", [Info]),
+ "~n Info: ~p", [_Info]),
ok
after 5000 ->
?DBG("no DOWN message "
@@ -6420,10 +7006,10 @@ info_test(Config) when is_list(Config) ->
?line load_master("OLD-SNMPEA-MIB"),
?line init_old(),
- try_test(info_test1, [node()]),
+ try_test(do_info, [node()]),
?line unload_master("OLD-SNMPEA-MIB").
-info_test1(MaNode) ->
+do_info(MaNode) ->
?line Info = rpc:call(MaNode, snmpa, info, []),
?DBG("info_test1 -> Info: ~n~p", [Info]),
Keys = [vsns,
@@ -6439,9 +7025,6 @@ info_test1(MaNode) ->
tree_size_bytes,
db_memory]}],
verify_info(Info, Keys),
- OldInfo = snmpa:old_info_format(Info),
- ?DBG("info_test1 -> OldInfo: ~n~p", [OldInfo]),
- verify_old_info(OldInfo),
ok.
verify_info([], []) ->
@@ -6483,23 +7066,8 @@ verify_subinfo(Info0, [Key|Keys]) ->
Info ->
verify_subinfo(Info, Keys)
end.
-
-verify_old_info(Info) ->
- Keys = [vsns, subagents, loaded_mibs,
- tree_size_bytes, process_memory, db_memory],
- verify_old_info(Keys, Info).
-
-verify_old_info([], _) ->
- ok;
-verify_old_info([Key|Keys], Info) ->
- case lists:keymember(Key, 1, Info) of
- true ->
- verify_old_info(Keys, Info);
- false ->
- ?FAIL({missing_old_info, Key})
- end.
-%% string used in index
+%% Index String - string used in index
is(S) -> [length(S) | S].
try_test(Func) ->
@@ -6517,16 +7085,11 @@ try_test(Func, A, Opts) ->
%% Test manager wrapperfunctions:
g(Oids) -> snmp_test_mgr:g(Oids).
-gn() -> snmp_test_mgr:gn().
+%%gn() -> snmp_test_mgr:gn().
gn(OidsOrN) -> snmp_test_mgr:gn(OidsOrN).
gb(NR, MR, Oids) -> snmp_test_mgr:gb(NR, MR, Oids).
s(VAV) -> snmp_test_mgr:s(VAV).
-expect(A, B) -> snmp_agent_test_lib:expect(A, B).
-expect(A, B, C) -> snmp_agent_test_lib:expect(A, B, C).
-expect(A, B, C, D) -> snmp_agent_test_lib:expect(A, B, C, D).
-expect(A, B, C, D, E, F) -> snmp_agent_test_lib:expect(A, B, C, D, E, F).
-
get_req(Id, Vars) ->
snmp_agent_test_lib:get_req(Id, Vars).
@@ -6550,6 +7113,9 @@ delete_files(Config) ->
config(Vsns, MgrDir, AgentDir, MIp, AIp) ->
snmp_agent_test_lib:config(Vsns, MgrDir, AgentDir, MIp, AIp).
+config(Vsns, MgrDir, AgentDir, MIp, AIp, IpFamily) ->
+ snmp_agent_test_lib:config(Vsns, MgrDir, AgentDir, MIp, AIp, IpFamily).
+
update_usm(Vsns, Dir) ->
snmp_agent_test_lib:update_usm(Vsns, Dir).
@@ -6562,8 +7128,6 @@ rewrite_usm_mgr(Dir, ShaKey, DesKey) ->
reset_usm_mgr(Dir) ->
snmp_agent_test_lib:reset_usm_mgr(Dir).
-update_community(Vsns, DIr) ->
- snmp_agent_test_lib:update_community(Vsns, DIr).
update_vacm(Vsn, Dir) ->
snmp_agent_test_lib:update_vacm(Vsn, Dir).
@@ -6574,8 +7138,6 @@ write_community_conf(Dir, Conf) ->
write_target_addr_conf(Dir, Conf) ->
snmp_agent_test_lib:write_target_addr_conf(Dir, Conf).
-%% write_target_addr_conf(Dir, ManagerIp, UDP, Vsns) ->
-%% snmp_agent_test_lib:write_target_addr_conf(Dir, ManagerIp, UDP, Vsns).
rewrite_target_addr_conf(Dir, NewPort) ->
snmp_agent_test_lib:rewrite_target_addr_conf(Dir, NewPort).
@@ -6596,10 +7158,6 @@ reset_target_params_conf(Dir) ->
write_notify_conf(Dir) ->
snmp_agent_test_lib:write_notify_conf(Dir).
-write_view_conf(Dir) ->
- snmp_agent_test_lib:write_view_conf(Dir).
-
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
copy_file(From, To) ->
@@ -6615,7 +7173,7 @@ display_log(Config) ->
{value, {_, Node}} ->
LogDir = Dir,
Mibs = [],
- OutFile = filename:join(LogDir, "snmpa_log.txt"),
+ OutFile = join(LogDir, "snmpa_log.txt"),
p("~n"
"========================="
" < Audit Trail Log > "
@@ -6759,8 +7317,13 @@ lists_key1search(Key, List) when is_atom(Key) ->
end.
-regs() ->
- lists:sort(registered()).
+%% ------
+
+join(Parts) ->
+ filename:join(Parts).
+
+join(Dir, File) ->
+ filename:join(Dir, File).
%% ------
@@ -6786,3 +7349,124 @@ p(F, A) ->
formated_timestamp() ->
snmp_test_lib:formated_timestamp().
+
+init_v1_agent(Config) ->
+ %% --
+ %% Start nodes
+ %%
+
+ {ok, AgentNode} = start_node(agent),
+
+ %% We don't use a manager in this test but the (common) config
+ %% function takes an argument that is derived from this
+ {ok, ManagerNode} = start_node(manager),
+
+ %% --
+ %% Mnesia init
+ %%
+
+ AgentDbDir = ?config(agent_db_dir, Config),
+ AgentMnesiaDir = join([AgentDbDir, "mnesia"]),
+ mnesia_init(AgentNode, AgentMnesiaDir),
+
+ mnesia_create_schema(AgentNode, [AgentNode]),
+
+ mnesia_start(AgentNode),
+
+ %% --
+ %% Host & IP
+ %%
+
+ AgentHost = ?HOSTNAME(AgentNode),
+ ManagerHost = ?HOSTNAME(ManagerNode),
+
+ Host = snmp_test_lib:hostname(),
+ IpFamily = config_ipfamily(Config),
+ Ip = ?LOCALHOST(IpFamily),
+ {ok, AgentIP0} = snmp_misc:ip(AgentHost, IpFamily),
+ AgentIP = tuple_to_list(AgentIP0),
+ {ok, ManagerIP0} = snmp_misc:ip(ManagerHost, IpFamily),
+ ManagerIP = tuple_to_list(ManagerIP0),
+
+
+ %% --
+ %% Write agent config
+ %%
+
+ Vsns = [v1],
+ ManagerConfDir = ?config(manager_top_dir, Config),
+ AgentConfDir = ?config(agent_conf_dir, Config),
+ AgentTopDir = ?config(agent_top_dir, Config),
+ AgentBkpDir1 = join([AgentTopDir, backup1]),
+ AgentBkpDir2 = join([AgentTopDir, backup2]),
+ ok = file:make_dir(AgentBkpDir1),
+ ok = file:make_dir(AgentBkpDir2),
+ AgentBkpDirs = [AgentBkpDir1, AgentBkpDir2],
+ config(Vsns, ManagerConfDir, AgentConfDir, ManagerIP, AgentIP, IpFamily),
+
+
+ %% --
+ %% Start the agent
+ %%
+
+ Config2 = start_agent([{host, Host},
+ {ip, Ip},
+ {agent_node, AgentNode},
+ {agent_host, AgentHost},
+ {agent_ip, AgentIP},
+ {agent_backup_dirs, AgentBkpDirs}|Config]),
+
+ %% --
+ %% Create watchdog
+ %%
+
+ Dog = ?WD_START(?MINS(1)),
+
+ [{watchdog, Dog} | Config2].
+
+fin_v1_agent(Config) ->
+ AgentNode = ?config(agent_node, Config),
+ ManagerNode = ?config(manager_node, Config),
+
+ %% -
+ %% Stop agent (this is the nice way to do it,
+ %% so logs and files can be closed in the proper way).
+ %%
+
+ AgentSup = ?config(agent_sup, Config),
+ stop_stdalone_agent(AgentSup),
+
+ %% -
+ %% Stop mnesia
+ %%
+ mnesia_stop(AgentNode),
+
+
+ %% -
+ %% Stop the agent node
+ %%
+ stop_node(AgentNode),
+
+
+ %% SubAgentNode = ?config(sub_agent_node, Config),
+ %% stop_node(SubAgentNode),
+
+
+ %% -
+ %% Stop the manager node
+ %%
+ stop_node(ManagerNode),
+
+ Dog = ?config(watchdog, Config),
+ ?WD_STOP(Dog),
+ lists:keydelete(watchdog, 1, Config).
+
+
+
+config_ipfamily(Config) ->
+ case ?config(ipfamily, Config) of
+ undefined ->
+ inet;
+ Value ->
+ Value
+ end.
diff --git a/lib/snmp/test/snmp_agent_test_lib.erl b/lib/snmp/test/snmp_agent_test_lib.erl
index 238832b7c1..66211d7105 100644
--- a/lib/snmp/test/snmp_agent_test_lib.erl
+++ b/lib/snmp/test/snmp_agent_test_lib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -28,7 +29,7 @@
start_mt_agent/1, start_mt_agent/2,
stop_agent/1,
- start_sup/0, stop_sup/2,
+ %% start_sup/0, stop_sup/2,
start_subagent/3, stop_subagent/1,
start_sub_sup/1, start_sub_sup/2,
@@ -39,7 +40,7 @@
get_req/2, get_next_req/1,
- config/5,
+ config/5, config/6,
delete_files/1,
copy_file/2,
update_usm/2,
@@ -58,7 +59,7 @@
init_all/1, finish_all/1,
init_case/1,
try_test/2, try_test/3, try_test/4,
- expect/2, expect/3, expect/4, expect/6,
+ expect/3, expect/4, expect/5, expect/7,
regs/0,
rpc/3
@@ -68,7 +69,7 @@
-export([wait/5, run/4]).
-include_lib("kernel/include/file.hrl").
--include("test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-define(SNMP_USE_V3, true).
-include_lib("snmp/include/snmp_types.hrl").
@@ -139,31 +140,31 @@ init_all(Config) when is_list(Config) ->
SuiteTopDir = ?config(snmp_suite_top_dir, Config),
?DBG("init_all -> SuiteTopDir ~p", [SuiteTopDir]),
- AgentDir = filename:join(SuiteTopDir, "agent/"),
+ AgentDir = join(SuiteTopDir, "agent/"),
?line ok = file:make_dir(AgentDir),
?DBG("init_all -> AgentDir ~p", [AgentDir]),
- AgentDbDir = filename:join(AgentDir, "db/"),
+ AgentDbDir = join(AgentDir, "db/"),
?line ok = file:make_dir(AgentDbDir),
?DBG("init_all -> AgentDbDir ~p", [AgentDbDir]),
- AgentLogDir = filename:join(AgentDir, "log/"),
+ AgentLogDir = join(AgentDir, "log/"),
?line ok = file:make_dir(AgentLogDir),
?DBG("init_all -> AgentLogDir ~p", [AgentLogDir]),
- AgentConfDir = filename:join(AgentDir, "conf/"),
+ AgentConfDir = join(AgentDir, "conf/"),
?line ok = file:make_dir(AgentConfDir),
?DBG("init_all -> AgentConfDir ~p", [AgentConfDir]),
- MgrDir = filename:join(SuiteTopDir, "mgr/"),
+ MgrDir = join(SuiteTopDir, "mgr/"),
?line ok = file:make_dir(MgrDir),
?DBG("init_all -> MgrDir ~p", [MgrDir]),
- SaDir = filename:join(SuiteTopDir, "sa/"),
+ SaDir = join(SuiteTopDir, "sa/"),
?line ok = file:make_dir(SaDir),
?DBG("init_all -> SaDir ~p", [SaDir]),
- SaDbDir = filename:join(SaDir, "db/"),
+ SaDbDir = join(SaDir, "db/"),
?line ok = file:make_dir(SaDbDir),
?DBG("init_all -> SaDbDir ~p", [SaDbDir]),
@@ -183,11 +184,11 @@ init_all(Config) when is_list(Config) ->
?DBG("init_all -> application mnesia: set_env dir",[]),
?line application_controller:set_env(mnesia, dir,
- filename:join(AgentDbDir, "Mnesia1")),
+ join(AgentDbDir, "Mnesia1")),
?DBG("init_all -> application mnesia: set_env dir on node ~p",[SaNode]),
?line rpc:call(SaNode, application_controller, set_env,
- [mnesia, dir, filename:join(SaDir, "Mnesia2")]),
+ [mnesia, dir, join(SaDir, "Mnesia2")]),
?DBG("init_all -> create mnesia schema",[]),
?line ok = mnesia:create_schema([SaNode, node()]),
@@ -232,13 +233,14 @@ init_case(Config) when is_list(Config) ->
MgrNode = ?config(snmp_mgr, Config),
MasterNode = ?config(snmp_master, Config),
%% MasterNode = node(),
-
+ IpFamily = proplists:get_value(ipfamily, Config, inet),
+
SaHost = ?HOSTNAME(SaNode),
MgrHost = ?HOSTNAME(MgrNode),
MasterHost = ?HOSTNAME(MasterNode),
- {ok, MasterIP} = snmp_misc:ip(MasterHost),
- {ok, MIP} = snmp_misc:ip(MgrHost),
- {ok, SIP} = snmp_misc:ip(SaHost),
+ {ok, MasterIP} = snmp_misc:ip(MasterHost, IpFamily),
+ {ok, MIP} = snmp_misc:ip(MgrHost, IpFamily),
+ {ok, SIP} = snmp_misc:ip(SaHost, IpFamily),
put(mgr_node, MgrNode),
@@ -250,10 +252,11 @@ init_case(Config) when is_list(Config) ->
put(mip, tuple_to_list(MIP)),
put(masterip, tuple_to_list(MasterIP)),
put(sip, tuple_to_list(SIP)),
+ put(ipfamily, IpFamily),
MibDir = ?config(mib_dir, Config),
put(mib_dir, MibDir),
- StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
+ StdM = join(code:priv_dir(snmp), "mibs") ++ "/",
put(std_mib_dir, StdM),
MgrDir = ?config(mgr_dir, Config),
@@ -299,10 +302,10 @@ call(N,M,F,A) ->
"~n Loc: ~p", [Rn, Loc]),
put(test_server_loc, Loc),
exit(Rn);
- {done, Ret, Zed} ->
+ {done, Ret, _Zed} ->
?DBG("call -> done:"
"~n Ret: ~p"
- "~n Zed: ~p", [Ret, Zed]),
+ "~n Zed: ~p", [Ret, _Zed]),
case Ret of
{error, Reason} ->
exit(Reason);
@@ -338,15 +341,10 @@ run(Mod, Func, Args, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
- ?DBG("run -> Crypto: ~p", [Crypto]),
+ _CryptoRes = ?CRYPTO_START(),
+ ?DBG("run -> Crypto: ~p", [_CryptoRes]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
- StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
+ StdM = join(code:priv_dir(snmp), "mibs") ++ "/",
Vsn = get(vsn),
?DBG("run -> config:"
"~n M: ~p"
@@ -363,6 +361,7 @@ run(Mod, Func, Args, Opts) ->
{packet_server_debug,true},
{debug,true},
{agent, get(master_host)},
+ {ipfamily, get(ipfamily)},
{agent_udp, 4000},
{trap_udp, 5000},
{recbuf,65535},
@@ -423,10 +422,10 @@ start_bilingual_agent(Config, Opts)
start_agent(Config, [v1,v2], Opts).
start_mt_agent(Config) when is_list(Config) ->
- start_agent(Config, [v2], [{snmp_multi_threaded, true}]).
+ start_agent(Config, [v2], [{multi_threaded, true}]).
start_mt_agent(Config, Opts) when is_list(Config) andalso is_list(Opts) ->
- start_agent(Config, [v2], [{snmp_multi_threaded, true}|Opts]).
+ start_agent(Config, [v2], [{multi_threaded, true}|Opts]).
start_agent(Config, Vsns) ->
start_agent(Config, Vsns, []).
@@ -442,79 +441,231 @@ start_agent(Config, Vsns, Opts) ->
?line AgentDbDir = ?config(agent_db_dir, Config),
?line SaNode = ?config(snmp_sa, Config),
- app_env_init(vsn_init(Vsns) ++
- [{audit_trail_log, read_write_log},
- {audit_trail_log_dir, AgentLogDir},
- {audit_trail_log_size, {10240, 10}},
- {force_config_reload, false},
- {snmp_agent_type, master},
- {snmp_config_dir, AgentConfDir},
- {snmp_db_dir, AgentDbDir},
- {snmp_local_db_auto_repair, true},
- {snmp_local_db_verbosity, log},
- {snmp_master_agent_verbosity, trace},
- {snmp_supervisor_verbosity, trace},
- {snmp_mibserver_verbosity, log},
- {snmp_symbolic_store_verbosity, log},
- {snmp_note_store_verbosity, log},
- {snmp_net_if_verbosity, trace}],
- Opts),
-
+ Env = app_agent_env_init(
+ [{versions, Vsns},
+ {agent_type, master},
+ {agent_verbosity, trace},
+ {db_dir, AgentDbDir},
+ {audit_trail_log, [{type, read_write},
+ {dir, AgentLogDir},
+ {size, {10240, 10}}]},
+ {config, [{dir, AgentConfDir},
+ {force_load, false},
+ {verbosity, trace}]},
+ {local_db, [{repair, true},
+ {verbosity, log}]},
+ {mib_server, [{verbosity, log}]},
+ {symbolic_store, [{verbosity, log}]},
+ {note_store, [{verbosity, log}]},
+ {net_if, [{verbosity, trace}]}],
+ Opts),
+
process_flag(trap_exit,true),
{ok, AppSup} = snmp_app_sup:start_link(),
unlink(AppSup),
- ?DBG("start_agent -> snmp app supervisor: ~p",[AppSup]),
+ ?DBG("start_agent -> snmp app supervisor: ~p", [AppSup]),
- ?DBG("start_agent -> start master agent (old style)",[]),
- ?line Sup = start_sup(),
+ ?DBG("start_agent -> start master agent",[]),
+ ?line Sup = start_sup(Env),
- ?DBG("start_agent -> unlink from supervisor",[]),
+ ?DBG("start_agent -> unlink from supervisor", []),
?line unlink(Sup),
?line SaDir = ?config(sa_dir, Config),
- ?DBG("start_agent -> (rpc) start sub on ~p",[SaNode]),
+ ?DBG("start_agent -> (rpc) start sub on ~p", [SaNode]),
?line {ok, Sub} = start_sub_sup(SaNode, SaDir),
?DBG("start_agent -> done",[]),
?line [{snmp_sup, {Sup, self()}}, {snmp_sub, Sub} | Config].
-vsn_init(Vsn) ->
- vsn_init([v1,v2,v3], Vsn, []).
+app_agent_env_init(Env0, Opts) ->
+ ?DBG("app_agent_env_init -> unload snmp",[]),
+ ?line application:unload(snmp),
+
+ ?DBG("app_agent_env_init -> load snmp",[]),
+ ?line application:load(snmp),
-vsn_init([], _Vsn, Acc) ->
- Acc;
-vsn_init([V|Vsns], Vsn, Acc) ->
- case lists:member(V, Vsn) of
- true ->
- vsn_init(Vsns, Vsn, [{V, true}|Acc]);
- false ->
- vsn_init(Vsns, Vsn, [{V, false}|Acc])
+ ?DBG("app_agent_env_init -> "
+ "merge or maybe replace (snmp agent) app env",[]),
+ Env = add_or_maybe_merge_agent_env(Opts, Env0),
+ ?DBG("app_agent_env_init -> merged env: "
+ "~n ~p", [Env]),
+
+ %% We put it into the app environment just as
+ %% a precaution, since when starting normally,
+ %% this is where the environment is extracted from.
+ app_agent_set_env(Env),
+ Env.
+
+app_agent_set_env(Value) ->
+ application_controller:set_env(snmp, agent, Value).
+
+add_or_maybe_merge_agent_env([], Env) ->
+ ?DBG("merging agent env -> merged", []),
+ lists:keysort(1, Env);
+add_or_maybe_merge_agent_env([{Key, Value1}|Opts], Env) ->
+ ?DBG("merging agent env -> add, replace or merge ~p", [Key]),
+ case lists:keysearch(Key, 1, Env) of
+ {value, {Key, Value1}} ->
+ %% Identical, move on
+ ?DBG("merging agent env -> "
+ "no need to merge ~p - identical - keep: "
+ "~n ~p", [Key, Value1]),
+ add_or_maybe_merge_agent_env(Opts, Env);
+ {value, {Key, Value2}} ->
+ %% Another value, merge or replace
+ NewValue = merge_or_replace_agent_env(Key, Value1, Value2),
+ Env2 = lists:keyreplace(Key, 1, Env, {Key, NewValue}),
+ add_or_maybe_merge_agent_env(Opts, Env2);
+ false ->
+ ?DBG("merging agent env -> no old ~p to merge with - add: "
+ "~n ~p", [Key, Value1]),
+ add_or_maybe_merge_agent_env(Opts, [{Key, Value1}|Env])
end.
-app_env_init(Env0, Opts) ->
- ?DBG("app_env_init -> unload snmp",[]),
- ?line application:unload(snmp),
- ?DBG("app_env_init -> load snmp",[]),
- ?line application:load(snmp),
- ?DBG("app_env_init -> initiate (snmp) application env",[]),
- F1 = fun({Key, Val} = New, Acc0) ->
- ?DBG("app_env_init -> "
- "updating setting ~p to ~p", [Key, Val]),
- case lists:keyreplace(Key, 1, Acc0, New) of
- Acc0 ->
- [New|Acc0];
- Acc ->
- Acc
- end
- end,
- Env = lists:foldr(F1, Env0, Opts),
- ?DBG("app_env_init -> Env: ~p",[Env]),
- F2 = fun({Key,Val}) ->
- ?DBG("app_env_init -> setting ~p to ~p",[Key, Val]),
- application_controller:set_env(snmp, Key, Val)
- end,
- lists:foreach(F2, Env).
+merge_or_replace_agent_env(versions, NewVersions, _OldVersions) ->
+ ?DBG("merging agent env -> versions replaced: ~p -> ~p",
+ [NewVersions, _OldVersions]),
+ NewVersions;
+merge_or_replace_agent_env(agent_type, NewType, _OldType) ->
+ ?DBG("merging agent env -> agent type replaced: ~p -> ~p",
+ [NewType, _OldType]),
+ NewType;
+merge_or_replace_agent_env(agent_verbosity, NewVerbosity, _OldVerbosity) ->
+ ?DBG("merging agent env -> agent verbosity replaced: ~p -> ~p",
+ [NewVerbosity, _OldVerbosity]),
+ NewVerbosity;
+merge_or_replace_agent_env(db_dir, NewDbDir, _OldDbDir) ->
+ ?DBG("merging agent env -> db-dir replaced: ~p -> ~p",
+ [NewDbDir, _OldDbDir]),
+ NewDbDir;
+merge_or_replace_agent_env(audit_trail_log, NewATL, OldATL) ->
+ merge_or_replace_agent_env_atl(NewATL, OldATL);
+merge_or_replace_agent_env(config, NewConfig, OldConfig) ->
+ merge_or_replace_agent_env_config(NewConfig, OldConfig);
+merge_or_replace_agent_env(local_db, NewLdb, OldLdb) ->
+ merge_or_replace_agent_env_ldb(NewLdb, OldLdb);
+merge_or_replace_agent_env(mib_storage, NewMst, OldMst) ->
+ merge_or_replace_agent_env_mib_storage(NewMst, OldMst);
+merge_or_replace_agent_env(mib_server, NewMibs, OldMibs) ->
+ merge_or_replace_agent_env_mib_server(NewMibs, OldMibs);
+merge_or_replace_agent_env(symbolic_store, NewSymStore, OldSymStore) ->
+ merge_or_replace_agent_env_symbolic_store(NewSymStore, OldSymStore);
+merge_or_replace_agent_env(note_store, NewNoteStore, OldNoteStore) ->
+ merge_or_replace_agent_env_note_store(NewNoteStore, OldNoteStore);
+merge_or_replace_agent_env(net_if, NewNetIf, OldNetIf) ->
+ merge_or_replace_agent_env_net_if(NewNetIf, OldNetIf);
+merge_or_replace_agent_env(Key, NewValue, OldValue) ->
+ ?FAIL({not_implemented_merge_or_replace,
+ Key, NewValue, OldValue}).
+
+merge_or_replace_agent_env_atl(New, Old) ->
+ ATL = merge_agent_options(New, Old),
+ ?DBG("merging agent env -> audit-trail-log merged: "
+ "~n ~p | ~p -> ~p", [New, Old, ATL]),
+ ATL.
+
+merge_or_replace_agent_env_config(New, Old) ->
+ Config = merge_agent_options(New, Old),
+ case lists:keymember(dir, 1, Config) of
+ true ->
+ ?DBG("merging agent env -> config merged: "
+ "~n ~p | ~p -> ~p", [New, Old, Config]),
+ Config;
+ false ->
+ ?FAIL({missing_mandatory_option, {config, dir}})
+ end.
+
+merge_or_replace_agent_env_ldb(New, Old) ->
+ LDB = merge_agent_options(New, Old),
+ ?DBG("merging agent env -> local-db merged: "
+ "~n ~p | ~p -> ~p", [New, Old, LDB]),
+ LDB.
+
+merge_or_replace_agent_env_mib_storage(NewMibStorage, OldMibStorage) ->
+ %% Shall we merge or replace?
+ %% module is mandatory. We will only merge if NewModule is
+ %% equal to OldModule.
+ NewModule =
+ case lists:keysearch(module, 1, NewMibStorage) of
+ {value, {module, M}} ->
+ M;
+ false ->
+ ?FAIL({missing_mandatory_option, {mib_storage, module}})
+ end,
+ case lists:keysearch(module, 1, OldMibStorage) of
+ {value, {module, NewModule}} ->
+ %% Same module => merge
+ %% Non-ex new options => remove
+ %% Ex new options and non-ex old options => replace
+ %% Otherwise merge
+ case lists:keysearch(options, 1, NewMibStorage) of
+ false ->
+ ?DBG("merging agent env -> "
+ "no mib-storage ~p merge needed - "
+ "no new options (= remove old options)", [NewModule]),
+ NewMibStorage;
+ {value, {options, NewOptions}} ->
+ case lists:keysearch(options, 1, OldMibStorage) of
+ false ->
+ ?DBG("merging agent env -> "
+ "no mib-storage ~p merge needed - "
+ "no old options", [NewModule]),
+ NewMibStorage;
+ {value, {options, OldOptions}} ->
+ MergedOptions =
+ merge_agent_options(NewOptions, OldOptions),
+ ?DBG("merging agent env -> mib-storage ~p merged: "
+ "~n Options: ~p | ~p -> ~p",
+ [NewModule,
+ NewOptions, OldOptions, MergedOptions]),
+ [{module, NewModule},
+ {options, MergedOptions}]
+ end
+ end;
+ _ ->
+ %% Diff module => replace
+ ?DBG("merging agent env -> "
+ "no mib-storage ~p merge needed - "
+ "new module", [NewModule]),
+ NewMibStorage
+ end.
+
+merge_or_replace_agent_env_mib_server(New, Old) ->
+ MibServer = merge_agent_options(New, Old),
+ ?DBG("merging agent env -> mib-server merged: "
+ "~n ~p | ~p -> ~p", [New, Old, MibServer]),
+ MibServer.
+
+merge_or_replace_agent_env_symbolic_store(New, Old) ->
+ SymbolicStore = merge_agent_options(New, Old),
+ ?DBG("merging agent env -> symbolic-store merged: "
+ "~n ~p | ~p -> ~p", [New, Old, SymbolicStore]),
+ SymbolicStore.
+
+merge_or_replace_agent_env_note_store(New, Old) ->
+ NoteStore = merge_agent_options(New, Old),
+ ?DBG("merging agent env -> note-store merged: "
+ "~n ~p | ~p -> ~p", [New, Old, NoteStore]),
+ NoteStore.
+
+merge_or_replace_agent_env_net_if(New, Old) ->
+ NetIf = merge_agent_options(New, Old),
+ ?DBG("merging agent env -> net-if merged: "
+ "~n ~p | ~p -> ~p", [New, Old, NetIf]),
+ NetIf.
+
+merge_agent_options([], Options) ->
+ lists:keysort(1, Options);
+merge_agent_options([{Key, _Value} = Opt|Opts], Options) ->
+ case lists:keysearch(Key, 1, Options) of
+ {value, _} ->
+ NewOptions = lists:keyreplace(Key, 1, Options, Opt),
+ merge_agent_options(Opts, NewOptions);
+ false ->
+ merge_agent_options(Opts, [Opt|Options])
+ end.
stop_agent(Config) when is_list(Config) ->
@@ -529,9 +680,9 @@ stop_agent(Config) when is_list(Config) ->
(catch process_info(Sup)),
(catch process_info(Par))]),
- Info = agent_info(Sup),
+ _Info = agent_info(Sup),
?DBG("stop_agent -> Agent info: "
- "~n ~p", [Info]),
+ "~n ~p", [_Info]),
stop_sup(Sup, Par),
@@ -549,8 +700,8 @@ stop_agent(Config) when is_list(Config) ->
lists:keydelete(snmp_sub, 1, C1).
-start_sup() ->
- case (catch snmpa_app:start(normal)) of
+start_sup(Env) ->
+ case (catch snmp_app_sup:start_agent(normal, Env)) of
{ok, S} ->
?DBG("start_agent -> started, Sup: ~p",[S]),
S;
@@ -558,7 +709,7 @@ start_sup() ->
Else ->
?DBG("start_agent -> unknown result: ~n~p",[Else]),
%% Get info about the apps we depend on
- ?FAIL({start_failed,Else, ?IS_MNESIA_RUNNING()})
+ ?FAIL({start_failed, Else, ?IS_MNESIA_RUNNING()})
end.
stop_sup(Pid, _) when (node(Pid) =:= node()) ->
@@ -599,7 +750,7 @@ start_sub_sup(Node, Dir) ->
start_sub_sup(Dir) ->
?DBG("start_sub -> entry",[]),
- Opts = [{db_dir, Dir},
+ Opts = [{db_dir, Dir},
{supervisor, [{verbosity, trace}]}],
{ok, P} = snmpa_supervisor:start_sub_sup(Opts),
unlink(P),
@@ -616,7 +767,7 @@ start_subagent(SaNode, RegTree, Mib) ->
MA = whereis(snmp_master_agent),
?DBG("start_subagent -> MA: ~p", [MA]),
MibDir = get(mib_dir),
- Mib1 = join(MibDir,Mib),
+ Mib1 = join(MibDir, Mib),
Mod = snmpa_supervisor,
Func = start_sub_agent,
Args = [MA, RegTree, [Mib1]],
@@ -653,28 +804,25 @@ mibs(StdMibDir,MibDir) ->
join(MibDir, "Test2.bin"),
join(MibDir, "TestTrapv2.bin")].
-join(D,F) ->
- filename:join(D,F).
-
%% --- various mib load/unload functions ---
load_master(Mib) ->
?DBG("load_master -> entry with"
"~n Mib: ~p", [Mib]),
- snmpa:unload_mibs(snmp_master_agent, [Mib]), % Unload for safety
- ok = snmpa:load_mibs(snmp_master_agent, [get(mib_dir) ++ Mib]).
+ snmpa:unload_mib(snmp_master_agent, Mib), % Unload for safety
+ ok = snmpa:load_mib(snmp_master_agent, join(get(mib_dir), Mib)).
load_master_std(Mib) ->
?DBG("load_master_std -> entry with"
"~n Mib: ~p", [Mib]),
- snmpa:unload_mibs(snmp_master_agent, [Mib]), % Unload for safety
- ok = snmpa:load_mibs(snmp_master_agent, [get(std_mib_dir) ++ Mib]).
+ snmpa:unload_mib(snmp_master_agent, Mib), % Unload for safety
+ ok = snmpa:load_mibs(snmp_master_agent, join(get(std_mib_dir), Mib)).
unload_master(Mib) ->
?DBG("unload_master -> entry with"
"~n Mib: ~p", [Mib]),
- ok = snmpa:unload_mibs(snmp_master_agent, [Mib]).
+ ok = snmpa:unload_mib(snmp_master_agent, Mib).
loaded_mibs() ->
?DBG("loaded_mibs -> entry",[]),
@@ -695,31 +843,33 @@ agent_info(Sup) ->
%% ---
+%% The first two arguments are simple to be able to find where in the
+%% (test) code this call is made.
-expect(Id, A) ->
- Fun = fun() -> do_expect(A) end,
- expect2(Id, Fun).
+expect(Mod, Line, What) ->
+ Fun = fun() -> do_expect(What) end,
+ expect2(Mod, Line, Fun).
-expect(Id, A, B) ->
- Fun = fun() -> do_expect(A, B) end,
- expect2(Id, Fun).
+expect(Mod, Line, What, ExpVBs) ->
+ Fun = fun() -> do_expect(What, ExpVBs) end,
+ expect2(Mod, Line, Fun).
-expect(Id, A, B, C) ->
- Fun = fun() -> do_expect(A, B, C) end,
- expect2(Id, Fun).
+expect(Mod, Line, Error, Index, ExpVBS) ->
+ Fun = fun() -> do_expect(Error, Index, ExpVBS) end,
+ expect2(Mod, Line, Fun).
-expect(Id, A, B, C, D, E) ->
- Fun = fun() -> do_expect(A, B, C, D, E) end,
- expect2(Id, Fun).
+expect(Mod, Line, Type, Enterp, Generic, Specific, ExpVBs) ->
+ Fun = fun() -> do_expect(Type, Enterp, Generic, Specific, ExpVBs) end,
+ expect2(Mod, Line, Fun).
-expect2(Id, F) ->
- io:format("EXPECT for ~w~n", [Id]),
+expect2(Mod, Line, F) ->
+ io:format("EXPECT for ~w:~w~n", [Mod, Line]),
case F() of
{error, Reason} ->
- io:format("EXPECT failed for ~w: ~n~p~n", [Id, Reason]),
- throw({error, {expect, Id, Reason}});
+ io:format("EXPECT failed at ~w:~w => ~n~p~n", [Mod, Line, Reason]),
+ throw({error, {expect, Mod, Line, Reason}});
Else ->
- io:format("EXPECT result for ~w: ~n~p~n", [Id, Else]),
+ io:format("EXPECT result for ~w:~w => ~n~p~n", [Mod, Line, Else]),
Else
end.
@@ -729,7 +879,6 @@ expect2(Id, F) ->
get_timeout() ->
get_timeout(os:type()).
-get_timeout(vxworks) -> 7000;
get_timeout(_) -> 3500.
receive_pdu(To) ->
@@ -772,7 +921,8 @@ do_expect({timeout, To}) ->
end;
do_expect({Err, To})
- when is_atom(Err) andalso (is_integer(To) orelse (To =:= infinity)) ->
+ when (is_atom(Err) andalso
+ ((is_integer(To) andalso To > 0) orelse (To =:= infinity))) ->
io:format("EXPECT error ~w within ~w~n", [Err, To]),
do_expect({{error, Err}, To});
@@ -1157,10 +1307,10 @@ get_req(Id, Vars) ->
{ok, Val} ->
?DBG("get_req -> response: ~p",[Val]),
Val;
- {error, _, {ExpFmt, ExpArg}, {ActFmt, ActArg}} ->
+ {error, _, {_ExpFmt, ExpArg}, {_ActFmt, ActArg}} ->
?DBG("get_req -> error for ~p: "
- "~n " ++ ExpFmt ++
- "~n " ++ ActFmt,
+ "~n " ++ _ExpFmt ++
+ "~n " ++ _ActFmt,
[Id] ++ ExpArg ++ ActArg),
exit({unexpected_response, ExpArg, ActArg});
Error ->
@@ -1222,27 +1372,46 @@ stop_node(Node) ->
%%%-----------------------------------------------------------------
config(Vsns, MgrDir, AgentConfDir, MIp, AIp) ->
+ config(Vsns, MgrDir, AgentConfDir, MIp, AIp, inet).
+
+config(Vsns, MgrDir, AgentConfDir, MIp, AIp, IpFamily) ->
?LOG("config -> entry with"
- "~n Vsns: ~p"
- "~n MgrDir: ~p"
- "~n AgentConfDir: ~p"
- "~n MIp: ~p"
- "~n AIp: ~p",
- [Vsns, MgrDir, AgentConfDir, MIp, AIp]),
- ?line snmp_config:write_agent_snmp_files(AgentConfDir, Vsns,
- MIp, ?TRAP_UDP, AIp, 4000,
- "test"),
+ "~n Vsns: ~p"
+ "~n MgrDir: ~p"
+ "~n AgentConfDir: ~p"
+ "~n MIp: ~p"
+ "~n AIp: ~p"
+ "~n IpFamily: ~p",
+ [Vsns, MgrDir, AgentConfDir, MIp, AIp, IpFamily]),
+ ?line {Domain, ManagerAddr} =
+ case IpFamily of
+ inet6 ->
+ Ipv6Domain = transportDomainUdpIpv6,
+ AgentIpv6Addr = {AIp, 4000},
+ ManagerIpv6Addr = {MIp, ?TRAP_UDP},
+ ?line ok =
+ snmp_config:write_agent_snmp_files(
+ AgentConfDir, Vsns,
+ Ipv6Domain, ManagerIpv6Addr, AgentIpv6Addr, "test"),
+ {Ipv6Domain, ManagerIpv6Addr};
+ _ ->
+ ?line ok =
+ snmp_config:write_agent_snmp_files(
+ AgentConfDir, Vsns, MIp, ?TRAP_UDP, AIp, 4000, "test"),
+ {snmpUDPDomain, {MIp, ?TRAP_UDP}}
+ end,
+
?line case update_usm(Vsns, AgentConfDir) of
true ->
- ?line copy_file(filename:join(AgentConfDir, "usm.conf"),
- filename:join(MgrDir, "usm.conf")),
+ ?line copy_file(join(AgentConfDir, "usm.conf"),
+ join(MgrDir, "usm.conf")),
?line update_usm_mgr(Vsns, MgrDir);
false ->
?line ok
end,
?line update_community(Vsns, AgentConfDir),
?line update_vacm(Vsns, AgentConfDir),
- ?line write_target_addr_conf(AgentConfDir, MIp, ?TRAP_UDP, Vsns),
+ ?line write_target_addr_conf(AgentConfDir, Domain, ManagerAddr, Vsns),
?line write_target_params_conf(AgentConfDir, Vsns),
?line write_notify_conf(AgentConfDir),
ok.
@@ -1254,9 +1423,9 @@ delete_files(Config) ->
delete_files(_AgentFiles, []) ->
ok;
delete_files(AgentDir, [DirName|DirNames]) ->
- Dir = filename:join(AgentDir, DirName),
+ Dir = join(AgentDir, DirName),
{ok, Files} = file:list_dir(Dir),
- lists:foreach(fun(FName) -> file:delete(filename:join(Dir, FName)) end,
+ lists:foreach(fun(FName) -> file:delete(join(Dir, FName)) end,
Files),
delete_files(AgentDir, DirNames).
@@ -1332,19 +1501,19 @@ update_usm_mgr(Vsns, Dir) ->
end.
rewrite_usm_mgr(Dir, ShaKey, DesKey) ->
- ?line ok = file:rename(filename:join(Dir,"usm.conf"),
- filename:join(Dir,"usm.old")),
+ ?line ok = file:rename(join(Dir,"usm.conf"),
+ join(Dir,"usm.old")),
Conf = [{"agentEngine", "newUser", "newUser", zeroDotZero,
usmHMACSHAAuthProtocol, "", "",
usmDESPrivProtocol, "", "", "", ShaKey, DesKey},
{"mgrEngine", "newUser", "newUser", zeroDotZero,
usmHMACSHAAuthProtocol, "", "",
usmDESPrivProtocol, "", "", "", ShaKey, DesKey}],
- ok = snmp_config:write_agent_usm_config(Dir, "", Conf).
+ ?line ok = snmp_config:write_agent_usm_config(Dir, "", Conf).
reset_usm_mgr(Dir) ->
- ?line ok = file:rename(filename:join(Dir,"usm.old"),
- filename:join(Dir,"usm.conf")).
+ ?line ok = file:rename(join(Dir,"usm.old"),
+ join(Dir,"usm.conf")).
update_community([v3], _Dir) ->
@@ -1366,30 +1535,31 @@ update_vacm(_Vsn, Dir) ->
write_community_conf(Dir, Conf) ->
- snmp_config:write_agent_community_config(Dir, "", Conf).
+ ?line ok = snmp_config:write_agent_community_config(Dir, "", Conf).
write_target_addr_conf(Dir, Conf) ->
- snmp_config:write_agent_target_addr_config(Dir, "", Conf).
+ ?line ok = snmp_config:write_agent_target_addr_config(Dir, "", Conf).
-write_target_addr_conf(Dir, ManagerIp, UDP, Vsns) ->
- snmp_config:write_agent_snmp_target_addr_conf(Dir, ManagerIp, UDP, Vsns).
+write_target_addr_conf(Dir, Ip_or_Domain, Port_or_Addr, Vsns) ->
+ ?line ok =
+ snmp_config:write_agent_snmp_target_addr_conf(
+ Dir, Ip_or_Domain, Port_or_Addr, Vsns).
rewrite_target_addr_conf(Dir, NewPort) ->
?DBG("rewrite_target_addr_conf -> entry with"
"~n NewPort: ~p", [NewPort]),
- TAFile = filename:join(Dir, "target_addr.conf"),
+ TAFile = join(Dir, "target_addr.conf"),
case file:read_file_info(TAFile) of
{ok, _} ->
ok;
- {error, R} ->
+ {error, _R} ->
?ERR("failure reading file info of "
- "target address config file: ~p",[R]),
+ "target address config file: ~p", [_R]),
ok
end,
?line [TrapAddr|Addrs] =
- snmp_conf:read(TAFile,
- fun(R) -> rewrite_target_addr_conf_check(R) end),
+ snmp_conf:read(TAFile, fun rewrite_target_addr_conf_check/1),
?DBG("rewrite_target_addr_conf -> TrapAddr: ~p",[TrapAddr]),
@@ -1397,8 +1567,8 @@ rewrite_target_addr_conf(Dir, NewPort) ->
?DBG("rewrite_target_addr_conf -> NewAddrs: ~p",[NewAddrs]),
- ?line ok = file:rename(filename:join(Dir,"target_addr.conf"),
- filename:join(Dir,"target_addr.old")),
+ ?line ok = file:rename(join(Dir,"target_addr.conf"),
+ join(Dir,"target_addr.old")),
?line ok = snmp_config:write_agent_target_addr_config(Dir, "", NewAddrs).
@@ -1416,8 +1586,8 @@ rewrite_target_addr_conf2(_NewPort,O) ->
O.
reset_target_addr_conf(Dir) ->
- ?line ok = file:rename(filename:join(Dir, "target_addr.old"),
- filename:join(Dir, "target_addr.conf")).
+ ?line ok = file:rename(join(Dir, "target_addr.old"),
+ join(Dir, "target_addr.conf")).
write_target_params_conf(Dir, Vsns) ->
F = fun(v1) -> {"target_v1", v1, v1, "all-rights", noAuthNoPriv};
@@ -1425,28 +1595,28 @@ write_target_params_conf(Dir, Vsns) ->
(v3) -> {"target_v3", v3, usm, "all-rights", noAuthNoPriv}
end,
Conf = [F(Vsn) || Vsn <- Vsns],
- snmp_config:write_agent_target_params_config(Dir, "", Conf).
+ ?line ok = snmp_config:write_agent_target_params_config(Dir, "", Conf).
rewrite_target_params_conf(Dir, SecName, SecLevel)
when is_list(SecName) andalso is_atom(SecLevel) ->
- ?line ok = file:rename(filename:join(Dir,"target_params.conf"),
- filename:join(Dir,"target_params.old")),
+ ?line ok = file:rename(join(Dir,"target_params.conf"),
+ join(Dir,"target_params.old")),
Conf = [{"target_v3", v3, usm, SecName, SecLevel}],
- snmp_config:write_agent_target_params_config(Dir, "", Conf).
+ ?line ok = snmp_config:write_agent_target_params_config(Dir, "", Conf).
reset_target_params_conf(Dir) ->
- ?line ok = file:rename(filename:join(Dir,"target_params.old"),
- filename:join(Dir,"target_params.conf")).
+ ?line ok = file:rename(join(Dir,"target_params.old"),
+ join(Dir,"target_params.conf")).
write_notify_conf(Dir) ->
Conf = [{"standard trap", "std_trap", trap},
{"standard inform", "std_inform", inform}],
- snmp_config:write_agent_notify_config(Dir, "", Conf).
+ ?line ok = snmp_config:write_agent_notify_config(Dir, "", Conf).
write_view_conf(Dir) ->
Conf = [{2, [1,3,6], included, null},
{2, ?tDescr_instance, excluded, null}],
- snmp_config:write_agent_view_config(Dir, "", Conf).
+ ?line ok = snmp_config:write_agent_view_config(Dir, "", Conf).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1499,6 +1669,9 @@ rpc(Node, F, A) ->
rpc:call(Node, snmpa, F, A).
+join(Dir, File) ->
+ filename:join(Dir, File).
+
%% await_pdu(To) ->
%% await_response(To, pdu).
%%
@@ -1540,7 +1713,6 @@ rpc(Node, F, A) ->
%% timeout() ->
%% timeout(os:type()).
%%
-%% timeout(vxworks) -> 7000;
%% timeout(_) -> 3500.
diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl
index 9b13e7cf1a..5e69866f9a 100644
--- a/lib/snmp/test/snmp_app_test.erl
+++ b/lib/snmp/test/snmp_app_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -22,454 +23,29 @@
%%----------------------------------------------------------------------
-module(snmp_app_test).
--export([
- all/0, groups/0,
- init_per_group/2, end_per_group/2,
- init_per_suite/1, end_per_suite/1,
- init_per_testcase/2, end_per_testcase/2,
-
- fields/1,
- modules/1,
- exportall/1,
- app_depend/1,
- undef_funcs/1,
-
-
- start_and_stop_empty/1,
- start_and_stop_with_agent/1,
- start_and_stop_with_manager/1,
- start_and_stop_with_agent_and_manager/1,
- start_epmty_and_then_agent_and_manager_and_stop/1,
- start_with_agent_and_then_manager_and_stop/1,
- start_with_manager_and_then_agent_and_stop/1
- ]).
-
-
--include_lib("kernel/include/file.hrl").
--include_lib("test_server/include/test_server.hrl").
--include("snmp_test_lib.hrl").
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+-include_lib("common_test/include/ct.hrl").
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
+%%--------------------------------------------------------------------
+%% Common Test interface functions -----------------------------------
+%%--------------------------------------------------------------------
all() ->
- Cases =
- [
- fields,
- modules,
- exportall,
- app_depend,
- undef_funcs,
- {group, start_and_stop}
- ],
- Cases.
-
-groups() ->
- [{start_and_stop, [],
- [start_and_stop_empty,
- start_and_stop_with_agent,
- start_and_stop_with_manager,
- start_and_stop_with_agent_and_manager,
- start_epmty_and_then_agent_and_manager_and_stop,
- start_with_agent_and_then_manager_and_stop,
- start_with_manager_and_then_agent_and_stop]}].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-init_per_suite(Config) when is_list(Config) ->
- ?DISPLAY_SUITE_INFO(),
-
- %% Note that part of this stuff (the suite top dir creation)
- %% may already be done (if we run the entire snmp suite).
-
- PrivDir = ?config(priv_dir, Config),
- TopDir = filename:join(PrivDir, app),
- case file:make_dir(TopDir) of
- ok ->
- ok;
- {error, eexist} ->
- ok;
- Error ->
- fail({failed_creating_subsuite_top_dir, Error})
- end,
- AppFile =
- case is_app() of
- {ok, File} ->
- io:format("File: ~n~p~n", [File]),
- snmp:print_version_info(),
- File;
- {error, Reason} ->
- fail(Reason)
- end,
- [{app_topdir, TopDir}, {app_file, AppFile} | Config].
-
-
-is_app() ->
- is_app(?APPLICATION).
-
-is_app(App) ->
- LibDir = code:lib_dir(App),
- File = filename:join([LibDir, "ebin", atom_to_list(App) ++ ".app"]),
- case file:consult(File) of
- {ok, [{application, App, AppFile}]} ->
- {ok, AppFile};
- Error ->
- {error, {invalid_format, Error}}
- end.
-
-end_per_suite(suite) -> [];
-end_per_suite(doc) -> [];
-end_per_suite(Config) when is_list(Config) ->
- Config.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%% Test server callbacks
-init_per_testcase(undef_funcs, Config) ->
- Config2 = lists:keydelete(watchdog, 1, Config),
- [{watchdog, ?WD_START(?MINS(10))} | Config2];
-init_per_testcase(_Case, Config) ->
- Config.
-
-end_per_testcase(_Case, Config) ->
- Config.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-fields(suite) ->
- [];
-fields(doc) ->
- [];
-fields(Config) when is_list(Config) ->
- AppFile = key1search(app_file, Config),
- Fields = [vsn, description, modules, registered, applications],
- case check_fields(Fields, AppFile, []) of
- [] ->
- ok;
- Missing ->
- fail({missing_fields, Missing})
- end.
-
-check_fields([], _AppFile, Missing) ->
- Missing;
-check_fields([Field|Fields], AppFile, Missing) ->
- check_fields(Fields, AppFile, check_field(Field, AppFile, Missing)).
-
-check_field(Name, AppFile, Missing) ->
- io:format("checking field: ~p~n", [Name]),
- case lists:keymember(Name, 1, AppFile) of
- true ->
- Missing;
- false ->
- [Name|Missing]
- end.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-modules(suite) ->
- [];
-modules(doc) ->
- [];
-modules(Config) when is_list(Config) ->
- AppFile = key1search(app_file, Config),
- Mods = key1search(modules, AppFile),
- EbinList = get_ebin_mods(snmp),
- case missing_modules(Mods, EbinList, []) of
- [] ->
- ok;
- Missing ->
- fail({missing_modules, Missing})
- end,
- Allowed = [snmpc,
- snmpc_lib,
- snmpc_misc,
- snmpc_mib_gram,
- snmpc_mib_to_hrl,
- snmpc_tok],
- case extra_modules(Mods, EbinList, Allowed, []) of
- [] ->
- ok;
- Extra ->
- fail({extra_modules, Extra})
- end,
- {ok, Mods}.
-
-get_ebin_mods(App) ->
- LibDir = code:lib_dir(App),
- EbinDir = filename:join([LibDir,"ebin"]),
- {ok, Files0} = file:list_dir(EbinDir),
- Files1 = [lists:reverse(File) || File <- Files0],
- [list_to_atom(lists:reverse(Name)) || [$m,$a,$e,$b,$.|Name] <- Files1].
-
-
-missing_modules([], _Ebins, Missing) ->
- Missing;
-missing_modules([Mod|Mods], Ebins, Missing) ->
- case lists:member(Mod, Ebins) of
- true ->
- missing_modules(Mods, Ebins, Missing);
- false ->
- io:format("missing module: ~p~n", [Mod]),
- missing_modules(Mods, Ebins, [Mod|Missing])
- end.
-
-
-extra_modules(_Mods, [], Allowed, Extra) ->
- Extra--Allowed;
-extra_modules(Mods, [Mod|Ebins], Allowed, Extra) ->
- case lists:member(Mod, Mods) of
- true ->
- extra_modules(Mods, Ebins, Allowed, Extra);
- false ->
- io:format("superfluous module: ~p~n", [Mod]),
- extra_modules(Mods, Ebins, Allowed, [Mod|Extra])
- end.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-exportall(suite) ->
- [];
-exportall(doc) ->
- [];
-exportall(Config) when is_list(Config) ->
- AppFile = key1search(app_file, Config),
- Mods = key1search(modules, AppFile),
- check_export_all(Mods).
-
-
-check_export_all([]) ->
- ok;
-check_export_all([Mod|Mods]) ->
- case (catch apply(Mod, module_info, [compile])) of
- {'EXIT', {undef, _}} ->
- check_export_all(Mods);
- O ->
- case lists:keysearch(options, 1, O) of
- false ->
- check_export_all(Mods);
- {value, {options, List}} ->
- case lists:member(export_all, List) of
- true ->
- fail({export_all, Mod});
- false ->
- check_export_all(Mods)
- end
- end
- end.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-app_depend(suite) ->
- [];
-app_depend(doc) ->
- [];
-app_depend(Config) when is_list(Config) ->
- AppFile = key1search(app_file, Config),
- Apps = key1search(applications, AppFile),
- check_apps(Apps).
-
-
-check_apps([]) ->
- ok;
-check_apps([App|Apps]) ->
- case is_app(App) of
- {ok, _} ->
- check_apps(Apps);
- Error ->
- throw({error, {missing_app, {App, Error}}})
- end.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-undef_funcs(suite) ->
- [];
-undef_funcs(doc) ->
- [];
-undef_funcs(Config) when is_list(Config) ->
- App = snmp,
- AppFile = key1search(app_file, Config),
- Mods = key1search(modules, AppFile),
- Root = code:root_dir(),
- LibDir = code:lib_dir(App),
- EbinDir = filename:join([LibDir,"ebin"]),
- XRefTestName = undef_funcs_make_name(App, xref_test_name),
- {ok, XRef} = xref:start(XRefTestName),
- ok = xref:set_default(XRef,
- [{verbose,false},{warnings,false}]),
- XRefName = undef_funcs_make_name(App, xref_name),
- {ok, XRefName} = xref:add_release(XRef, Root, {name,XRefName}),
- {ok, App} = xref:replace_application(XRef, App, EbinDir),
- {ok, Undefs} = xref:analyze(XRef, undefined_function_calls),
- xref:stop(XRef),
- analyze_undefined_function_calls(Undefs, Mods, []).
-
-valid_undef(crypto = CalledMod) ->
- case (catch CalledMod:version()) of
- Version when is_list(Version) ->
- %% The called module was crypto and the version
- %% function returns a valid value.
- %% This means that the function is
- %% actually undefined...
- true;
- _ ->
- %% The called module was crypto but the version
- %% function does *not* return a valid value.
- %% This means the crypto was not actually not
- %% build, which is an case snmp handles.
- false
- end;
-valid_undef(_) ->
- true.
-
-
-analyze_undefined_function_calls([], _, []) ->
- ok;
-analyze_undefined_function_calls([], _, AppUndefs) ->
- exit({suite_failed, {undefined_function_calls, AppUndefs}});
-analyze_undefined_function_calls([{{Mod, _F, _A}, _C} = AppUndef|Undefs],
- AppModules, AppUndefs) ->
- %% Check that this module is our's
- case lists:member(Mod,AppModules) of
- true ->
- {Calling,Called} = AppUndef,
- {Mod1,Func1,Ar1} = Calling,
- {Mod2,Func2,Ar2} = Called,
- %% If the called module is crypto, then we will *not*
- %% fail if crypto is not built (since crypto is actually
- %% not built for all platforms)
- case valid_undef(Mod2) of
- true ->
- io:format("undefined function call: "
- "~n ~w:~w/~w calls ~w:~w/~w~n",
- [Mod1,Func1,Ar1,Mod2,Func2,Ar2]),
- analyze_undefined_function_calls(
- Undefs, AppModules, [AppUndef|AppUndefs]);
- false ->
- io:format("skipping ~p (calling ~w:~w/~w)~n",
- [Mod, Mod2, Func2, Ar2]),
- analyze_undefined_function_calls(Undefs,
- AppModules, AppUndefs)
- end;
- false ->
- io:format("dropping ~p~n", [Mod]),
- analyze_undefined_function_calls(Undefs, AppModules, AppUndefs)
- end.
-
-%% This function is used simply to avoid cut-and-paste errors later...
-undef_funcs_make_name(App, PostFix) ->
- list_to_atom(atom_to_list(App) ++ "_" ++ atom_to_list(PostFix)).
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-start_and_stop_empty(suite) ->
- [];
-start_and_stop_empty(doc) ->
- ["Start and stop the application empty (no configured components)"];
-start_and_stop_empty(Config) when is_list(Config) ->
- ?line false = ?IS_SNMP_RUNNING(),
-
- ?line ok = snmp:start(),
-
- ?line true = ?IS_SNMP_RUNNING(),
-
- ?line ok = snmp:stop(),
-
- ?line false = ?IS_SNMP_RUNNING(),
-
- ok.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-start_and_stop_with_agent(suite) ->
- [];
-start_and_stop_with_agent(doc) ->
- ["Start and stop the application with the agent pre-configured"];
-start_and_stop_with_agent(Config) when is_list(Config) ->
- ?SKIP(not_implemented_yet).
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-start_and_stop_with_manager(suite) ->
- [];
-start_and_stop_with_manager(doc) ->
- ["Start and stop the application with the manager pre-configured"];
-start_and_stop_with_manager(Config) when is_list(Config) ->
- ?SKIP(not_implemented_yet).
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-start_and_stop_with_agent_and_manager(suite) ->
- [];
-start_and_stop_with_agent_and_manager(doc) ->
- ["Start and stop the application with both the agent "
- "and the manager pre-configured"];
-start_and_stop_with_agent_and_manager(Config) when is_list(Config) ->
- ?SKIP(not_implemented_yet).
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-start_epmty_and_then_agent_and_manager_and_stop(suite) ->
- [];
-start_epmty_and_then_agent_and_manager_and_stop(doc) ->
- ["Start the application empty, then start the agent and then "
- "the manager and then stop the application"];
-start_epmty_and_then_agent_and_manager_and_stop(Config) when is_list(Config) ->
- ?SKIP(not_implemented_yet).
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-start_with_agent_and_then_manager_and_stop(suite) ->
- [];
-start_with_agent_and_then_manager_and_stop(doc) ->
- ["Start the application with the agent pre-configured, "
- "then start the manager and then stop the application"];
-start_with_agent_and_then_manager_and_stop(Config) when is_list(Config) ->
- ?SKIP(not_implemented_yet).
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-start_with_manager_and_then_agent_and_stop(suite) ->
- [];
-start_with_manager_and_then_agent_and_stop(doc) ->
- ["Start the application with the manager pre-configured, "
- "then start the agent and then stop the application"];
-start_with_manager_and_then_agent_and_stop(Config) when is_list(Config) ->
- ?SKIP(not_implemented_yet).
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-fail(Reason) ->
- exit({suite_failed, Reason}).
-
-key1search(Key, L) ->
- case lists:keysearch(Key, 1, L) of
- undefined ->
- fail({not_found, Key, L});
- {value, {Key, Value}} ->
- Value
- end.
+ [
+ app,
+ appup
+ ].
+
+%%--------------------------------------------------------------------
+%% Test Cases --------------------------------------------------------
+%%--------------------------------------------------------------------
+app() ->
+ [{doc, "Test that the snmp app file is ok"}].
+app(Config) when is_list(Config) ->
+ ok = test_server:app_test(snmp).
+%%--------------------------------------------------------------------
+appup() ->
+ [{doc, "Test that the snmp appup file is ok"}].
+appup(Config) when is_list(Config) ->
+ ok = test_server:appup_test(snmp).
diff --git a/lib/snmp/test/snmp_appup_mgr.erl b/lib/snmp/test/snmp_appup_mgr.erl
index 6648ce9dbe..c19cffdec1 100644
--- a/lib/snmp/test/snmp_appup_mgr.erl
+++ b/lib/snmp/test/snmp_appup_mgr.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -140,7 +141,7 @@ handle_req(#agent{host = Host, port = Port}, Reqs) ->
{ok, ReqId} = snmpm:ag(?USER_ID, Host, Port, Oids),
p("issued get-request (~w) for: ~s", [ReqId, oid_descs(Descs)]),
ReqTimer = erlang:send_after(?REQ_TIMEOUT, self(), {req_timeout, ReqId}),
- {ReqId, erlang:now(), ReqTimer}.
+ {ReqId, erlang:monotonic_time(micro_seconds), ReqTimer}.
oid_descs([]) ->
[];
@@ -163,7 +164,7 @@ handle_req_timeout(#state{ids = IDs0} = State, ReqId) ->
handle_snmp(#state{ids = IDs0} = S, {error, ReqId, Reason}) ->
case lists:keysearch(ReqId, 1, IDs0) of
{value, {ReqId, T, Ref}} ->
- Diff = timer:now_diff(erlang:now(), T),
+ Diff = erlang:monotonic_time(micro_seconds) - T,
p("SNMP error regarding outstanding request after ~w microsec:"
"~n ReqId: ~w"
"~n Reason: ~w", [Diff, ReqId, Reason]),
@@ -187,7 +188,7 @@ handle_snmp(State, {agent, Addr, Port, SnmpInfo}) ->
handle_snmp(#state{ids = IDs0} = S, {pdu, Addr, Port, ReqId, SnmpResponse}) ->
case lists:keysearch(ReqId, 1, IDs0) of
{value, {ReqId, T, Ref}} ->
- Diff = timer:now_diff(erlang:now(), T),
+ Diff = erlang:monotonic_time(micro_seconds) - T,
p("SNMP pdu regarding outstanding request after ~w microsec:"
"~n ReqId: ~w"
"~n Addr: ~w"
diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl
index 99994a2410..aff1c7c782 100644
--- a/lib/snmp/test/snmp_appup_test.erl
+++ b/lib/snmp/test/snmp_appup_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -63,33 +64,9 @@ end_per_group(_GroupName, Config) ->
init_per_suite(suite) -> [];
init_per_suite(doc) -> [];
init_per_suite(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
- TopDir = filename:join(PrivDir, appup),
- case file:make_dir(TopDir) of
- ok ->
- ok;
- Error ->
- fail({failed_creating_subsuite_top_dir, Error})
- end,
- AppFile = file_name(?APPLICATION, ".app"),
- AppupFile = file_name(?APPLICATION, ".appup"),
- [{app_file, AppFile},
- {appup_file, AppupFile},
- {appup_topdir, TopDir} | Config].
+ Config.
-file_name(App, Ext) ->
- Env = init:get_arguments(),
- LibDir =
- case lists:keysearch(clearcase, 1, Env) of
- false ->
- code:lib_dir(App);
- _ ->
- ".."
- end,
- filename:join([LibDir, "ebin", atom_to_list(App) ++ Ext]).
-
-
end_per_suite(suite) -> [];
end_per_suite(doc) -> [];
end_per_suite(Config) when is_list(Config) ->
@@ -108,467 +85,6 @@ end_per_testcase(_Case, Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-appup_file(suite) ->
- [];
-appup_file(doc) ->
- "Perform a simple check of the appup file";
+%% Perform a simple check of the appup file
appup_file(Config) when is_list(Config) ->
- AppupFile = key1search(appup_file, Config),
- AppFile = key1search(app_file, Config),
- Modules = modules(AppFile),
- check_appup(AppupFile, Modules).
-
-modules(File) ->
- case file:consult(File) of
- {ok, [{application,snmp,Info}]} ->
- case lists:keysearch(modules,1,Info) of
- {value, {modules, Modules}} ->
- Modules;
- false ->
- fail({bad_appinfo, Info})
- end;
- Error ->
- fail({bad_appfile, Error, File})
- end.
-
-
-check_appup(AppupFile, Modules) ->
- case file:consult(AppupFile) of
- {ok, [{V, UpFrom, DownTo}]} ->
- check_appup(V, UpFrom, DownTo, Modules);
- Else ->
- fail({bad_appupfile, Else})
- end.
-
-
-check_appup(V, UpFrom, DownTo, Modules) ->
- check_version(V),
- check_depends(up, UpFrom, Modules),
- check_depends(down, DownTo, Modules),
- check_module_subset(up, UpFrom),
- check_module_subset(down, DownTo),
- ok.
-
-check_depends(_, [], _) ->
- ok;
-check_depends(UpDown, [Dep|Deps], Modules) ->
- check_depend(UpDown, Dep, Modules),
- check_depends(UpDown, Deps, Modules).
-
-
-check_depend(up = UpDown, {add_application, ?APPLICATION} = Instr, Modules) ->
- d("check_instructions(~w) -> entry with"
- "~n Instruction: ~p"
- "~n Modules: ~p", [UpDown, Instr, Modules]),
- ok;
-check_depend(down = UpDown, {remove_application, ?APPLICATION} = Instr,
- Modules) ->
- d("check_instructions(~w) -> entry with"
- "~n Instruction: ~p"
- "~n Modules: ~p", [UpDown, Instr, Modules]),
- ok;
-check_depend(UpDown, {V, Instructions}, Modules) ->
- d("check_instructions(~w) -> entry with"
- "~n V: ~p"
- "~n Modules: ~p", [UpDown, V, Modules]),
- check_version(V),
- case check_instructions(UpDown,
- Instructions, Instructions, [], [], Modules) of
- {_Good, []} ->
- ok;
- {_, Bad} ->
- fail({bad_instructions, Bad, UpDown})
- end.
-
-
-check_instructions(_, [], _, Good, Bad, _) ->
- {lists:reverse(Good), lists:reverse(Bad)};
-check_instructions(UpDown, [Instr|Instrs], AllInstr, Good, Bad, Modules) ->
- d("check_instructions(~w) -> entry with"
- "~n Instr: ~p", [UpDown,Instr]),
- case (catch check_instruction(UpDown, Instr, AllInstr, Modules)) of
- ok ->
- check_instructions(UpDown, Instrs, AllInstr,
- [Instr|Good], Bad, Modules);
- {error, Reason} ->
- check_instructions(UpDown, Instrs, AllInstr, Good,
- [{Instr, Reason}|Bad], Modules)
- end;
-check_instructions(UpDown, Instructions, _, _, _, _) ->
- fail({bad_instructions, {UpDown, Instructions}}).
-
-check_instruction(_, {restart_application, ?APPLICATION}, _, _Modules) ->
- d("check_instruction -> entry when restart_application instruction"),
- ok;
-
-%% A new module is added
-check_instruction(up, {add_module, Module}, _, Modules)
- when is_atom(Module) ->
- d("check_instruction -> entry when up-add_module instruction with"
- "~n Module: ~p", [Module]),
- check_module(Module, Modules);
-
-%% An old module is re-added
-check_instruction(down, {add_module, Module}, _, Modules)
- when is_atom(Module) ->
- d("check_instruction -> entry when down-add_module instruction with"
- "~n Module: ~p", [Module]),
- case (catch check_module(Module, Modules)) of
- {error, {unknown_module, Module, Modules}} ->
- ok;
- ok ->
- error({existing_readded_module, Module})
- end;
-
-check_instruction(up, {delete_module, Module}, _, Modules)
- when is_atom(Module) ->
- d("check_instruction -> entry when up-delete_module instruction with"
- "~n Module: ~p", [Module]),
- case (catch check_module(Module, Modules)) of
- {error, {unknown_module, Module, Modules}} ->
- ok;
- ok ->
- error({module_cannot_be_deleted, Module})
- end;
-
-%% An new module is deleted
-check_instruction(down, {delete_module, Module}, _, Modules)
- when is_atom(Module) ->
- d("check_instruction -> entry when down-delete_module instruction with"
- "~n Module: ~p", [Module]),
- check_module(Module, Modules);
-
-%% Removing a module on upgrade:
-%% - the module has been removed from the app-file.
-%% - check that no module depends on this (removed) module
-check_instruction(up, {remove, {Module, Pre, Post}}, _, Modules)
- when is_atom(Module) and is_atom(Pre) and is_atom(Post) ->
- d("check_instruction -> entry when up-remove instruction with"
- "~n Module: ~p"
- "~n Pre: ~p"
- "~n Post: ~p", [Module, Pre, Post]),
- case (catch check_module(Module, Modules)) of
- {error, {unknown_module, Module, Modules}} ->
- check_purge(Pre),
- check_purge(Post);
- ok ->
- error({existing_removed_module, Module})
- end;
-
-%% Removing a module on downgrade: the module exist
-%% in the app-file.
-check_instruction(down, {remove, {Module, Pre, Post}}, AllInstr, Modules)
- when is_atom(Module) and is_atom(Pre) and is_atom(Post) ->
- d("check_instruction -> entry when down-remove instruction with"
- "~n Module: ~p"
- "~n Pre: ~p"
- "~n Post: ~p", [Module, Pre, Post]),
- case (catch check_module(Module, Modules)) of
- ok ->
- check_purge(Pre),
- check_purge(Post),
- check_no_remove_depends(Module, AllInstr);
- {error, {unknown_module, Module, Modules}} ->
- error({nonexisting_removed_module, Module})
- end;
-
-check_instruction(_, {load_module, Module, Pre, Post, Depend},
- AllInstr, Modules)
- when is_atom(Module) and
- is_atom(Pre) and
- is_atom(Post) and
- is_list(Depend) ->
- d("check_instruction -> entry when load_module instruction with"
- "~n Module: ~p"
- "~n Pre: ~p"
- "~n Post: ~p"
- "~n Depend: ~p", [Module, Pre, Post, Depend]),
- check_module(Module, Modules),
- check_module_depend(Module, Depend, Modules),
- check_module_depend(Module, Depend, updated_modules(AllInstr, [])),
- check_purge(Pre),
- check_purge(Post);
-
-check_instruction(_, {update, Module, Change, Pre, Post, Depend},
- AllInstr, Modules)
- when is_atom(Module) and
- is_atom(Pre) and
- is_atom(Post) and
- is_list(Depend) ->
- d("check_instruction -> entry when update instruction with"
- "~n Module: ~p"
- "~n Change: ~p"
- "~n Pre: ~p"
- "~n Post: ~p"
- "~n Depend: ~p", [Module, Change, Pre, Post, Depend]),
- check_module(Module, Modules),
- check_module_depend(Module, Depend, Modules),
- check_module_depend(Module, Depend, updated_modules(AllInstr, [])),
- check_change(Change),
- check_purge(Pre),
- check_purge(Post);
-
-check_instruction(_, {update, Module, supervisor}, _, Modules)
- when is_atom(Module) ->
- d("check_instruction -> entry when supervisor update instruction with"
- "~n Module: ~p", [Module]),
- check_module(Module, Modules);
-
-check_instruction(_, {apply, {Module, Function, Args}}, _, _Modules)
- when is_atom(Module) and is_atom(Function) and is_list(Args) ->
- d("check_instruction -> entry when apply instruction with"
- "~n Module: ~p"
- "~n Function: ~p"
- "~n Args: ~p", [Module, Function, Args]),
- check_apply(Module, Function, Args);
-
-check_instruction(_, Instr, _AllInstr, _Modules) ->
- error({error, {unknown_instruction, Instr}}).
-
-%% If Module X depends on Module Y, then module Y must have an update
-%% instruction of some sort (otherwise the depend is faulty).
-updated_modules([], Modules) ->
- d("updated_modules -> entry when done with"
- "~n Modules: ~p", [Modules]),
- Modules;
-updated_modules([Instr|Instrs], Modules) ->
- d("updated_modules -> entry with"
- "~n Instr: ~p"
- "~n Modules: ~p", [Instr,Modules]),
- case instruction_module(Instr) of
- {module, Module} ->
- d("updated_modules -> Module: ~p", [Module]),
- updated_modules(Instrs, [Module|Modules]);
- no_module ->
- updated_modules(Instrs, Modules)
- end.
-
-instruction_module({add_module, Module}) ->
- {module, Module};
-instruction_module({delete_module, Module}) ->
- {module, Module};
-instruction_module({remove, {Module, _, _}}) ->
- {module, Module};
-instruction_module({load_module, Module, _, _, _}) ->
- {module, Module};
-instruction_module({update, Module, _, _, _, _}) ->
- {module, Module};
-instruction_module({update, Module, _}) ->
- {module, Module};
-instruction_module({apply, {_, _, _}}) ->
- no_module;
-instruction_module(Instr) ->
- d("instruction_module -> entry when unknown instruction with"
- "~n Instr: ~p", [Instr]),
- error({error, {unknown_instruction, Instr}}).
-
-
-%% Check that the modules handled in an instruction set for version X
-%% is a subset of the instruction set for version X-1.
-check_module_subset(Direction, Instructions) ->
- d("check_module_subset(~w) -> entry when"
- "~n Instructions: ~p", [Direction,Instructions]),
- do_check_module_subset(modules_of(Instructions)).
-
-do_check_module_subset([]) ->
- ok;
-do_check_module_subset([_]) ->
- ok;
-do_check_module_subset([{_V1, Mods1}|T]) ->
- d("do_check_module_subset -> entry with"
- "~n V1: ~s"
- "~n Mods1: ~p", [_V1, Mods1]),
- {V2, Mods2} = hd(T),
- d("do_check_module_subset -> "
- "~n V2: ~s"
- "~n Mods2: ~p", [V2, Mods2]),
- %% Check that the modules in V1 is a subset of V2
- case do_check_module_subset2(Mods1, Mods2) of
- ok ->
- do_check_module_subset(T);
- {error, Modules} ->
- fail({subset_missing_instructions, V2, Modules})
- end.
-
-do_check_module_subset2(_Mods1, [{restart_application, ?APPLICATION}]) ->
- ok;
-do_check_module_subset2(Mods1, Mods2) ->
- do_check_module_subset2(Mods1, Mods2, []).
-
-do_check_module_subset2([], _, []) ->
- ok;
-do_check_module_subset2([], _, Acc) ->
- {error, lists:reverse(Acc)};
-do_check_module_subset2([Mod|Mods], Mods2, Acc) ->
- case lists:member(Mod, Mods2) of
- true ->
- do_check_module_subset2(Mods, Mods2, Acc);
- false ->
- do_check_module_subset2(Mods, Mods2, [Mod|Acc])
- end.
-
-
-modules_of(Instructions) ->
- modules_of(Instructions, []).
-
-modules_of([], Acc) ->
- lists:reverse(Acc);
-modules_of([{_V,[{restart_application, ?APPLICATION}]}|T], Acc) ->
- modules_of(T, Acc);
-modules_of([{V,Instructions}|T], Acc) ->
- Mods = modules_of2(Instructions, []),
- modules_of(T, [{V, Mods}|Acc]).
-
-modules_of2([], Acc) ->
- lists:reverse(Acc);
-modules_of2([Instr|Instructions], Acc) ->
- d("module_of -> entry with"
- "~n Instr: ~p", [Instr]),
- case module_of(Instr) of
- {value, Mod} ->
- d("module_of -> Mod: ~p", [Mod]),
- modules_of2(Instructions, [Mod|Acc]);
- false ->
- modules_of2(Instructions, Acc)
- end.
-
-module_of({add_module, Module}) ->
- {value, Module};
-module_of({delete_module, Module}) ->
- {value, Module};
-module_of({remove, {Module, _Pre, _Post}}) ->
- {value, Module};
-module_of({load_module, Module, _Pre, _Post, _Depend}) ->
- {value, Module};
-module_of({update, Module, _Change, _Pre, _Post, _Depend}) ->
- {value, Module};
-module_of({update, Module, supervisor}) ->
- {value, Module};
-module_of(_) ->
- false.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-check_version(V) when is_list(V) ->
- ok;
-check_version(V) ->
- error({bad_version, V}).
-
-
-check_module(M, Modules) when is_atom(M) ->
- case lists:member(M, Modules) of
- true ->
- ok;
- false ->
- error({unknown_module, M, Modules})
- end;
-check_module(M, _) ->
- error({bad_module, M}).
-
-
-check_module_depend(M, [], _) when is_atom(M) ->
- ok;
-check_module_depend(M, Deps, Modules) when is_atom(M) and is_list(Deps) ->
- case [Dep || Dep <- Deps, lists:member(Dep, Modules) == false] of
- [] ->
- ok;
- Unknown ->
- error({unknown_depend_modules, Unknown})
- end;
-check_module_depend(_M, D, _Modules) ->
- error({bad_depend, D}).
-
-
-check_no_remove_depends(_Module, []) ->
- ok;
-check_no_remove_depends(Module, [Instr|Instrs]) ->
- check_no_remove_depend(Module, Instr),
- check_no_remove_depends(Module, Instrs).
-
-check_no_remove_depend(Module, {load_module, Mod, _Pre, _Post, Depend}) ->
- case lists:member(Module, Depend) of
- true ->
- error({removed_module_in_depend, load_module, Mod, Module});
- false ->
- ok
- end;
-check_no_remove_depend(Module, {update, Mod, _Change, _Pre, _Post, Depend}) ->
- case lists:member(Module, Depend) of
- true ->
- error({removed_module_in_depend, update, Mod, Module});
- false ->
- ok
- end;
-check_no_remove_depend(_, _) ->
- ok.
-
-
-check_change(soft) ->
- ok;
-check_change({advanced, _Something}) ->
- ok;
-check_change(Change) ->
- error({bad_change, Change}).
-
-
-check_purge(soft_purge) ->
- ok;
-check_purge(brutal_purge) ->
- ok;
-check_purge(Purge) ->
- error({bad_purge, Purge}).
-
-check_apply(Module, Function, Args) ->
- case (catch Module:module_info()) of
- Info when is_list(Info) ->
- check_exported(Function, Args, Info);
- {'EXIT', {undef, _}} ->
- error({not_existing_module, Module})
- end.
-
-check_exported(Function, Args, Info) ->
- case lists:keysearch(exports, 1, Info) of
- {value, {exports, FuncList}} ->
- Arity = length(Args),
- Arities = [A || {F, A} <- FuncList, F == Function],
- case lists:member(Arity, Arities) of
- true ->
- ok;
- false ->
- fail({not_exported_function, Function, Arity})
- end;
- _ ->
- error({bad_export, Info})
- end.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-error(Reason) ->
- throw({error, Reason}).
-
-fail(Reason) ->
- exit({suite_failed, Reason}).
-
-key1search(Key, L) ->
- case lists:keysearch(Key, 1, L) of
- undefined ->
- fail({not_found, Key, L});
- {value, {Key, Value}} ->
- Value
- end.
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-d(F) ->
- d(F, []).
-
-d(F, A) ->
- d(true, F, A).
-
-d(true, F, A) ->
- io:format(F ++ "~n", A);
-d(_, _, _) ->
- ok.
-
+ ok = ?t:appup_test(snmp).
diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl
index 1840d37dfd..9b3c2bfd2c 100644
--- a/lib/snmp/test/snmp_compiler_test.erl
+++ b/lib/snmp/test/snmp_compiler_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2017. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -28,7 +29,7 @@
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-include_lib("snmp/include/snmp_types.hrl").
@@ -55,7 +56,8 @@
otp_8574/1,
otp_8595/1,
otp_10799/1,
- otp_10808/1
+ otp_10808/1,
+ otp_14145/1
]).
@@ -134,7 +136,8 @@ all() ->
].
groups() ->
- [{tickets, [], [otp_6150, otp_8574, otp_8595, otp_10799, otp_10808]}].
+ [{tickets, [],
+ [otp_6150, otp_8574, otp_8595, otp_10799, otp_10808, otp_14145]}].
init_per_group(_GroupName, Config) ->
Config.
@@ -430,6 +433,30 @@ otp_10808(Config) when is_list(Config) ->
%%======================================================================
+otp_14145(suite) ->
+ [];
+otp_14145(Config) when is_list(Config) ->
+ put(tname, otp10808),
+ p("starting with Config: ~p~n", [Config]),
+
+ Dir = ?config(case_top_dir, Config),
+ MibDir = ?config(mib_dir, Config),
+ MibName = "OTP14145-MIB",
+ MibFile = join(MibDir, MibName++".mib"),
+ ?line {ok, MibBin} =
+ snmpc:compile(MibFile, [{outdir, Dir},
+ {verbosity, trace},
+ {group_check, false},
+ module_compliance]),
+ p("Mib: ~n~p~n", [MibBin]),
+ MIB = read_mib(MibBin),
+ Oid = [1,3,6,1,2,1,67,4],
+ check_mib(MIB#mib.mes, Oid, undefined),
+ ok.
+
+
+%%======================================================================
+
augments_extra_info(suite) ->
[];
augments_extra_info(Config) when is_list(Config) ->
diff --git a/lib/snmp/test/snmp_conf_test.erl b/lib/snmp/test/snmp_conf_test.erl
index c4341d8d7e..6242fdeca3 100644
--- a/lib/snmp/test/snmp_conf_test.erl
+++ b/lib/snmp/test/snmp_conf_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -26,7 +27,7 @@
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-include_lib("snmp/include/STANDARD-MIB.hrl").
@@ -117,7 +118,7 @@ check_mandatory(Config) when is_list(Config) ->
{b, mandatory},
{d, {value, 20202}},
{e, {value, "kalle"}}],
- ?line {ok, L1} = verify_mandatory(A1, B1),
+ ?line {ok, _L1} = verify_mandatory(A1, B1),
?DBG("check_mandatory -> L1: ~p", [L1]),
A2 = [{a, hej}, {c, 10}, {d, 10101}, {f, 10.88}],
B2 = [{a, {value, hejsan}},
@@ -373,6 +374,8 @@ verify_ip(Val) ->
case (catch snmp_conf:check_ip(Val)) of
{error, Reason} ->
?FAIL({verify_ip, Val, Reason});
+ {ok, _} ->
+ ok;
ok ->
ok
end.
@@ -401,7 +404,7 @@ check_taddress(Config) when is_list(Config) ->
ok.
verify_taddress(Val) ->
- case (catch snmp_conf:check_taddress(Val)) of
+ case (catch snmp_conf:check_taddress(snmpUDPDomain, Val)) of
{error, Reason} ->
?FAIL({verify_taddress, Val, Reason});
ok ->
@@ -409,7 +412,7 @@ verify_taddress(Val) ->
end.
verify_not_taddress(Val) ->
- case (catch snmp_conf:check_taddress(Val)) of
+ case (catch snmp_conf:check_taddress(snmpUDPDomain, Val)) of
ok ->
?FAIL({verify_taddress, Val});
{error, _Reason} ->
diff --git a/lib/snmp/test/snmp_log_test.erl b/lib/snmp/test/snmp_log_test.erl
index 3b810493cb..8890b4b20d 100644
--- a/lib/snmp/test/snmp_log_test.erl
+++ b/lib/snmp/test/snmp_log_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -29,7 +30,7 @@
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-define(SNMP_USE_V3, true).
-include_lib("snmp/include/snmp_types.hrl").
@@ -331,7 +332,7 @@ log_to_io1(doc) -> "Log to io from the same process that opened "
log_to_io1(Config) when is_list(Config) ->
p(log_to_io1),
put(sname,l2i1),
- put(verbosity, debug),
+ put(verbosity,debug),
?DBG("log_to_io1 -> start", []),
Dir = ?config(log_dir, Config),
Name = "snmp_test_l2i1",
@@ -365,7 +366,7 @@ log_to_io1(Config) when is_list(Config) ->
display_info(Info),
?DBG("log_to_io1 -> do the convert to io (stdout)", []),
- ? line ok = snmp_log:log_to_io(Log, File, Dir, []),
+ ? line ok = snmp:log_to_io(Dir, [], Name, File, false),
?DBG("log_to_io1 -> close log", []),
?line ok = snmp_log:close(Log),
@@ -375,9 +376,9 @@ log_to_io1(Config) when is_list(Config) ->
%%======================================================================
-%% Starta en logger-process som med ett visst intervall loggar
-%% meddelanden. Starta en reader-process som vid ett viss tillf�lle
-%% l�ser fr�n loggen.
+%% Start a logger-process that logs messages with a certain interval.
+%% Start a reader-process that reads messages from the log at a certain
+%% point in time.
log_to_io2(suite) -> [];
log_to_io2(doc) -> "Log to io from a different process than which "
@@ -386,7 +387,7 @@ log_to_io2(Config) when is_list(Config) ->
process_flag(trap_exit, true),
p(log_to_io2),
put(sname, l2i2),
- put(verbosity, debug),
+ put(verbosity,debug),
?DBG("log_to_io2 -> start", []),
Dir = ?config(log_dir, Config),
Name = "snmp_test_l2i2",
@@ -414,13 +415,13 @@ log_to_io2(Config) when is_list(Config) ->
log_reader_log_to(Reader,
fun() ->
I = disk_log:info(Log),
- R = snmp_log:log_to_io(Log, File, Dir, []),
+ R = snmp:log_to_io(Dir, [], Name, File, true),
{R, I}
end),
case Res of
- {ok, Info} ->
- ?DBG("log_to_io2 -> ~n Info: ~p", [Info]),
+ {ok, _Info} ->
+ ?DBG("log_to_io2 -> ~n Info: ~p", [_Info]),
ok;
{Error, Info} ->
?DBG("log_to_io2 -> log to io failed: "
@@ -445,7 +446,7 @@ log_to_txt1(suite) -> [];
log_to_txt1(Config) when is_list(Config) ->
p(log_to_txt1),
put(sname,l2t1),
- put(verbosity, debug),
+ put(verbosity,debug),
?DBG("log_to_txt1 -> start", []),
Name = "snmp_test_l2t1",
@@ -463,7 +464,7 @@ log_to_txt2(suite) -> [];
log_to_txt2(Config) when is_list(Config) ->
p(log_to_txt2),
put(sname,l2t2),
- put(verbosity, debug),
+ put(verbosity,debug),
?DBG("log_to_txt2 -> start", []),
Name = "snmp_test_l2t2",
@@ -520,14 +521,21 @@ log_to_txt(Name, SeqNoGen, Config) when is_list(Config) ->
?line {ok, Info} = snmp_log:info(Log),
display_info(Info),
- Out1 = join(Dir, "snmp_text-1.txt"),
- ?DBG("log_to_txt -> do the convert to a text file when"
- "~n Out1: ~p", [Out1]),
- ?line ok = snmp:log_to_txt(Dir, [], Out1, Log, File),
+ Out1a = join(Dir, "snmp_text-1-unblocked.txt"),
+ ?DBG("log_to_txt -> do the convert to a text file (~s) unblocked", [Out1a]),
+ ?line ok = snmp:log_to_txt(Dir, [], Out1a, Log, File, false),
+
+ ?line {ok, #file_info{size = Size1a}} = file:read_file_info(Out1a),
+ ?DBG("log_to_txt -> text file size: ~p", [Size1a]),
+ validate_size(Size1a),
- ?line {ok, #file_info{size = Size1}} = file:read_file_info(Out1),
- ?DBG("log_to_txt -> text file size: ~p", [Size1]),
- validate_size(Size1),
+ Out1b = join(Dir, "snmp_text-1-blocked.txt"),
+ ?DBG("log_to_txt -> do the convert to a text file (~s) blocked", [Out1b]),
+ ?line ok = snmp:log_to_txt(Dir, [], Out1b, Log, File, true),
+
+ ?line {ok, #file_info{size = Size1b}} = file:read_file_info(Out1b),
+ ?DBG("log_to_txt -> text file size: ~p", [Size1b]),
+ validate_size(Size1b, {eq, Size1a}),
Out2 = join(Dir, "snmp_text-2.txt"),
?DBG("log_to_txt -> do the convert to a text file when"
@@ -538,7 +546,7 @@ log_to_txt(Name, SeqNoGen, Config) when is_list(Config) ->
?line {ok, #file_info{size = Size2}} = file:read_file_info(Out2),
?DBG("log_to_txt -> text file size: ~p", [Size2]),
- validate_size(Size2, {le, Size1}),
+ validate_size(Size2, {le, Size1a}),
%% Calculate new start / stop times...
GStart = calendar:datetime_to_gregorian_seconds(Start),
@@ -568,7 +576,7 @@ log_to_txt(Name, SeqNoGen, Config) when is_list(Config) ->
?line {ok, #file_info{size = Size3}} = file:read_file_info(Out3),
?DBG("log_to_txt -> text file size: ~p", [Size3]),
- validate_size(Size3, {l, Size1}),
+ validate_size(Size3, {l, Size1a}),
?DBG("log_to_txt -> close log", []),
?line ok = snmp_log:close(Log),
@@ -578,9 +586,9 @@ log_to_txt(Name, SeqNoGen, Config) when is_list(Config) ->
%%======================================================================
-%% Starta en logger-process som med ett visst intervall loggar
-%% meddelanden. Starta en reader-process som vid ett viss tillf�lle
-%% l�ser fr�n loggen.
+%% Start a logger-process that logs messages with a certain interval.
+%% Start a reader-process that reads messages from the log at a certain
+%% point of time.
%%
%% Test: ts:run(snmp, snmp_log_test, log_to_txt2, [batch]).
@@ -593,7 +601,7 @@ log_to_txt3(Config) when is_list(Config) ->
process_flag(trap_exit, true),
p(log_to_txt3),
put(sname,l2t3),
- put(verbosity, debug),
+ put(verbosity,debug),
?DBG("log_to_txt3 -> start", []),
Dir = ?config(log_dir, Config),
Name = "snmp_test_l2t3",
@@ -626,19 +634,19 @@ log_to_txt3(Config) when is_list(Config) ->
log_reader_log_to(Reader,
fun() ->
I = disk_log:info(Log),
- T1 = t(),
+ T1 = snmp_misc:now(ms),
R = snmp_log:log_to_txt(Log, LogFile, Dir,
Mibs, TxtFile),
- T2 = t(),
- io:format(user,
+ T2 = snmp_misc:now(ms),
+ io:format(user,
"Time converting file: ~w ms~n",
[T2 - T1]),
{R, I}
end),
case Res of
- {ok, Info} ->
- ?DBG("log_to_txt3 -> ~n Info: ~p", [Info]),
+ {ok, _Info} ->
+ ?DBG("log_to_txt3 -> ~n Info: ~p", [_Info]),
?line {ok, #file_info{size = FileSize}} =
file:read_file_info(TxtFile),
?DBG("log_to_txt3 -> text file size: ~p", [FileSize]),
@@ -667,6 +675,8 @@ validate_size(_) ->
validate_size(0, _) ->
?FAIL(invalid_size);
+validate_size(A, {eq, A}) ->
+ ok;
validate_size(A, {le, B}) when A =< B ->
ok;
validate_size(A, {l, B}) when A < B ->
@@ -695,11 +705,11 @@ log_writer_start(Name, File, Size, Repair) ->
log_writer_stop(Pid) ->
Pid ! {stop, self()},
- T1 = t(),
+ _T1 = snmp_misc:now(ms),
receive
{'EXIT', Pid, normal} ->
- T2 = t(),
- ?DBG("it took ~w ms to stop the writer", [T2 - T1]),
+ _T2 = snmp_misc:now(ms),
+ ?DBG("it took ~w ms to stop the writer", [_T2 - _T1]),
ok
after 60000 ->
Msg = receive Any -> Any after 0 -> nothing end,
@@ -712,11 +722,11 @@ log_writer_info(Pid) ->
log_writer_sleep(Pid, Time) ->
Pid ! {sleep, Time, self()},
- T1 = t(),
+ _T1 = snmp_misc:now(ms),
receive
{sleeping, Pid} ->
- T2 = t(),
- ?DBG("it took ~w ms to put the writer to sleep", [T2 - T1]),
+ _T2 = snmp_misc:now(ms),
+ ?DBG("it took ~w ms to put the writer to sleep", [_T2 - _T1]),
ok;
{'EXIT', Pid, Reason} ->
{error, Reason}
@@ -784,11 +794,11 @@ lp(F, A) ->
log_reader_start() ->
Pid = spawn_link(?MODULE, log_reader_main, [self()]),
- T1 = t(),
+ _T1 = snmp_misc:now(ms),
receive
{started, Pid} ->
- T2 = t(),
- ?DBG("it took ~w ms to start the reader", [T2 - T1]),
+ _T2 = snmp_misc:now(ms),
+ ?DBG("it took ~w ms to start the reader", [_T2 - _T1]),
{ok, Pid};
{'EXIT', Pid, Reason} ->
{error, Reason}
@@ -798,11 +808,11 @@ log_reader_start() ->
log_reader_stop(Pid) ->
Pid ! {stop, self()},
- T1 = t(),
+ _T1 = snmp_misc:now(ms),
receive
{'EXIT', Pid, normal} ->
- T2 = t(),
- ?DBG("it took ~w ms to put the reader to eleep", [T2 - T1]),
+ _T2 = snmp_misc:now(ms),
+ ?DBG("it took ~w ms to put the reader to eleep", [_T2 - _T1]),
ok
after 1000 ->
Msg = receive Any -> Any after 0 -> nothing end,
@@ -1115,8 +1125,3 @@ join(D, F) ->
p(Case) ->
io:format(user, "test case: ~w~n", [Case]).
-
-%% Time in milli sec
-t() ->
- {A,B,C} = erlang:now(),
- A*1000000000+B*1000+(C div 1000).
diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl
index 3192fe1b40..64d3134055 100644
--- a/lib/snmp/test/snmp_manager_config_test.erl
+++ b/lib/snmp/test/snmp_manager_config_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -31,7 +32,7 @@
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-include_lib("snmp/src/manager/snmpm_usm.hrl").
@@ -57,6 +58,7 @@
start_with_invalid_users_conf_file1/1,
start_with_invalid_agents_conf_file1/1,
start_with_invalid_usm_conf_file1/1,
+ start_with_create_db_and_dir_opt/1,
@@ -139,8 +141,13 @@ init_per_testcase(Case, Config) when is_list(Config) ->
file:make_dir(MgrTopDir = filename:join(CaseTopDir, "manager/")),
?line ok =
file:make_dir(MgrConfDir = filename:join(MgrTopDir, "conf/")),
- ?line ok =
- file:make_dir(MgrDbDir = filename:join(MgrTopDir, "db/")),
+ MgrDbDir = filename:join(MgrTopDir, "db/"),
+ case Case of
+ start_with_create_db_and_dir_opt ->
+ ok;
+ _ ->
+ ?line ok = file:make_dir(MgrDbDir)
+ end,
?line ok =
file:make_dir(MgrLogDir = filename:join(MgrTopDir, "log/")),
[{case_top_dir, CaseTopDir},
@@ -174,6 +181,7 @@ groups() ->
start_without_mandatory_opts2,
start_with_all_valid_opts, start_with_unknown_opts,
start_with_incorrect_opts,
+ start_with_create_db_and_dir_opt,
start_with_invalid_manager_conf_file1,
start_with_invalid_users_conf_file1,
start_with_invalid_agents_conf_file1,
@@ -332,7 +340,8 @@ start_with_all_valid_opts(Conf) when is_list(Conf) ->
{no_reuse, false}]}],
ServerOpts = [{timeout, 10000}, {verbosity, trace}],
NoteStoreOpts = [{timeout, 20000}, {verbosity, trace}],
- ConfigOpts = [{dir, ConfDir}, {verbosity, trace}, {db_dir, DbDir}],
+ ConfigOpts = [{dir, ConfDir}, {verbosity, trace},
+ {db_dir, DbDir}, {db_init_error, create}],
Mibs = [join(StdMibDir, "SNMP-NOTIFICATION-MIB"),
join(StdMibDir, "SNMP-USER-BASED-SM-MIB")],
Prio = normal,
@@ -685,7 +694,7 @@ start_with_invalid_manager_conf_file1(Conf) when is_list(Conf) ->
"arne_anka", "4001", "500", "\"bmkEngine\""),
?line {error, Reason12} = config_start(Opts),
p("start failed (as expected): ~p", [Reason12]),
- ?line {failed_check, _, _, 2, {invalid_ip_address, _}} = Reason12,
+ ?line {failed_check, _, _, 2, {bad_address, _}} = Reason12,
await_config_not_running(),
%% --
@@ -694,7 +703,7 @@ start_with_invalid_manager_conf_file1(Conf) when is_list(Conf) ->
"9999", "4001", "500", "\"bmkEngine\""),
?line {error, Reason13} = config_start(Opts),
p("start failed (as expected): ~p", [Reason13]),
- ?line {failed_check, _, _, 2, {invalid_ip_address, _}} = Reason13,
+ ?line {failed_check, _, _, 2, {bad_address, _}} = Reason13,
await_config_not_running(),
%% --
@@ -712,7 +721,8 @@ start_with_invalid_manager_conf_file1(Conf) when is_list(Conf) ->
"[134,138,177,189]", "-1", "500", "\"bmkEngine\""),
?line {error, Reason22} = config_start(Opts),
p("start failed (as expected): ~p", [Reason22]),
- ?line {failed_check, _, _, 3, {invalid_integer, _}} = Reason22,
+ io:format("Reason22: ~p~n", [Reason22]),
+ ?line {failed_check, _, _, 3, {bad_port, _}} = Reason22,
await_config_not_running(),
%% --
@@ -721,7 +731,7 @@ start_with_invalid_manager_conf_file1(Conf) when is_list(Conf) ->
"[134,138,177,189]", "\"kalle-anka\"", "500", "\"bmkEngine\""),
?line {error, Reason23} = config_start(Opts),
p("start failed (as expected): ~p", [Reason23]),
- ?line {failed_check, _, _, 3, {invalid_integer, _}} = Reason23,
+ ?line {failed_check, _, _, 3, {bad_port, _}} = Reason23,
await_config_not_running(),
%% --
@@ -1039,7 +1049,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) ->
case config_start(Opts) of
{error, Reason51} ->
p("start failed (as expected): ~p", [Reason51]),
- ?line {failed_check, _, _, _, {bad_address, _}} = Reason51,
+ ?line {failed_check, _, _, _, {bad_domain, _}} = Reason51,
await_config_not_running();
OK_51 ->
exit({error, {unexpected_success, "51", OK_51}})
@@ -1065,7 +1075,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) ->
case config_start(Opts) of
{error, Reason53} ->
p("start failed (as expected): ~p", [Reason53]),
- ?line {failed_check, _, _, _, {invalid_ip_address, _}} = Reason53,
+ ?line {failed_check, _, _, _, {bad_address, _}} = Reason53,
await_config_not_running();
OK_53 ->
exit({error, {unexpected_success, "53", OK_53}})
@@ -1078,7 +1088,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) ->
case config_start(Opts) of
{error, Reason54} ->
p("start failed (as expected): ~p", [Reason54]),
- ?line {failed_check, _, _, _, {invalid_ip_address, _}} = Reason54,
+ ?line {failed_check, _, _, _, {bad_address, _}} = Reason54,
await_config_not_running();
OK_54 ->
exit({error, {unexpected_success, "54", OK_54}})
@@ -1090,7 +1100,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) ->
write_agents_conf(ConfDir, [Agent55]),
?line {error, Reason55} = config_start(Opts),
p("start failed (as expected): ~p", [Reason55]),
- ?line {failed_check, _, _, _, {invalid_ip_address, _}} = Reason55,
+ ?line {failed_check, _, _, _, {bad_address, _}} = Reason55,
await_config_not_running(),
%% --
@@ -1099,7 +1109,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) ->
write_agents_conf(ConfDir, [Agent61]),
?line {error, Reason61} = config_start(Opts),
p("start failed (as expected): ~p", [Reason61]),
- ?line {failed_check, _, _, _, {invalid_integer, _}} = Reason61,
+ ?line {failed_check, _, _, _, {bad_address, _}} = Reason61,
await_config_not_running(),
%% --
@@ -1108,7 +1118,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) ->
write_agents_conf(ConfDir, [Agent62]),
?line {error, Reason62} = config_start(Opts),
p("start failed (as expected): ~p", [Reason62]),
- ?line {failed_check, _, _, _, {invalid_integer, _}} = Reason62,
+ ?line {failed_check, _, _, _, {bad_address, _}} = Reason62,
await_config_not_running(),
%% --
@@ -1117,7 +1127,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) ->
write_agents_conf(ConfDir, [Agent63]),
?line {error, Reason63} = config_start(Opts),
p("start failed (as expected): ~p", [Reason63]),
- ?line {failed_check, _, _, _, {invalid_integer, _}} = Reason63,
+ ?line {failed_check, _, _, _, {bad_address, _}} = Reason63,
await_config_not_running(),
%% --
@@ -1674,7 +1684,34 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) ->
%% ---
%%
+start_with_create_db_and_dir_opt(suite) -> [];
+start_with_create_db_and_dir_opt(doc) ->
+ "Start the snmp manager config process with the\n"
+ "create_db_and_dir option.";
+start_with_create_db_and_dir_opt(Conf) when is_list(Conf) ->
+ put(tname, swcdado),
+ p("start"),
+ process_flag(trap_exit, true),
+ ConfDir = ?config(manager_conf_dir, Conf),
+ DbDir = ?config(manager_db_dir, Conf),
+ true = not filelib:is_dir(DbDir) and not filelib:is_file(DbDir),
+ write_manager_conf(ConfDir),
+
+ p("verify nonexistent db_dir"),
+ ConfigOpts01 = [{verbosity,trace}, {dir, ConfDir}, {db_dir, DbDir}],
+ {error, Reason01} = config_start([{config, ConfigOpts01}]),
+ p("nonexistent db_dir res: ~p", [Reason01]),
+ {invalid_conf_db_dir, _, not_found} = Reason01,
+ p("verify nonexistent db_dir gets created"),
+ ConfigOpts02 = [{db_init_error, create_db_and_dir} | ConfigOpts01],
+ {ok, _Pid} = config_start([{config, ConfigOpts02}]),
+ true = filelib:is_dir(DbDir),
+ p("verified: nonexistent db_dir was correctly created"),
+ ok = config_stop(),
+
+ p("done"),
+ ok.
%%
%% ---
@@ -2133,7 +2170,6 @@ register_usm_user_using_function(Conf) when is_list(Conf) ->
%% --
p("done"),
ok.
-%% ?SKIP(not_yet_implemented).
%%
@@ -2223,8 +2259,9 @@ create_and_increment(Conf) when is_list(Conf) ->
?line {ok, _Pid} = snmpm_config:start_link(Opts),
%% Random init
- {A,B,C} = erlang:now(),
- random:seed(A,B,C),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
StartVal = random:uniform(2147483647),
IncVal = 42,
diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl
index c374a2f0a6..71f4017d8b 100644
--- a/lib/snmp/test/snmp_manager_test.erl
+++ b/lib/snmp/test/snmp_manager_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -31,7 +32,7 @@
%% Include files
%%----------------------------------------------------------------------
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
-include("snmp_test_data/Test2.hrl").
@@ -139,6 +140,8 @@
-define(NS_TIMEOUT, 10000).
+-define(DEFAULT_MNESIA_DEBUG, none).
+
%%----------------------------------------------------------------------
%% Records
@@ -173,11 +176,41 @@ end_per_suite(Config) when is_list(Config) ->
init_per_testcase(Case, Config) when is_list(Config) ->
- io:format(user, "~n~n*** INIT ~w:~w ***~n~n", [?MODULE,Case]),
- init_per_testcase2(Case, Config).
+ io:format(user, "~n~n*** INIT ~w:~w ***~n~n", [?MODULE, Case]),
+ p(Case, "init_per_testcase begin when"
+ "~n Nodes: ~p~n~n", [erlang:nodes()]),
+ %% This version of the API, based on Addr and Port, has been deprecated
+ DeprecatedApiCases =
+ [
+ simple_sync_get1,
+ simple_async_get1,
+ simple_sync_get_next1,
+ simple_async_get_next1,
+ simple_sync_set1,
+ simple_async_set1,
+ simple_sync_get_bulk1,
+ simple_async_get_bulk1,
+ misc_async1
+ ],
+ Result =
+ case lists:member(Case, DeprecatedApiCases) of
+ true ->
+ %% ?SKIP(api_no_longer_supported);
+ {skip, api_no_longer_supported};
+ false ->
+ init_per_testcase2(Case, Config)
+ end,
+ p(Case, "init_per_testcase end when"
+ "~n Nodes: ~p"
+ "~n Result: ~p"
+ "~n~n", [Result, erlang:nodes()]),
+ Result.
init_per_testcase2(Case, Config) ->
- ?DBG("init_per_testcase2 -> ~p", [erlang:nodes()]),
+ ?DBG("init_per_testcase2 -> "
+ "~n Case: ~p"
+ "~n Config: ~p"
+ "~n Nodes: ~p", [Case, Config, erlang:nodes()]),
CaseTopDir = snmp_test_lib:init_testcase_top_dir(Case, Config),
@@ -209,8 +242,11 @@ init_per_testcase2(Case, Config) ->
AgLogDir = filename:join(AgTopDir, "log/"),
?line ok = file:make_dir(AgLogDir),
+ Family = proplists:get_value(ipfamily, Config, inet),
+
Conf = [{watchdog, ?WD_START(?MINS(5))},
- {ip, ?LOCALHOST()},
+ {ipfamily, Family},
+ {ip, ?LOCALHOST(Family)},
{case_top_dir, CaseTopDir},
{agent_dir, AgTopDir},
{agent_conf_dir, AgConfDir},
@@ -226,18 +262,6 @@ init_per_testcase2(Case, Config) ->
Conf2.
init_per_testcase3(Case, Config) ->
- ApiCases01 =
- [
- simple_sync_get1,
- simple_async_get1,
- simple_sync_get_next1,
- simple_async_get_next1,
- simple_sync_set1,
- simple_async_set1,
- simple_sync_get_bulk1,
- simple_async_get_bulk1,
- misc_async1
- ],
ApiCases02 =
[
simple_sync_get2,
@@ -273,7 +297,6 @@ init_per_testcase3(Case, Config) ->
inform_swarm,
report
] ++
- ApiCases01 ++
ApiCases02 ++
ApiCases03,
case lists:member(Case, Cases) of
@@ -308,6 +331,8 @@ init_per_testcase3(Case, Config) ->
end.
end_per_testcase(Case, Config) when is_list(Config) ->
+ p(Case, "end_per_testcase begin when"
+ "~n Nodes: ~p~n~n", [erlang:nodes()]),
?DBG("fin [~w] Nodes [1]: ~p", [Case, erlang:nodes()]),
Dog = ?config(watchdog, Config),
?WD_STOP(Dog),
@@ -316,21 +341,11 @@ end_per_testcase(Case, Config) when is_list(Config) ->
?DBG("fin [~w] Nodes [2]: ~p", [Case, erlang:nodes()]),
%% TopDir = ?config(top_dir, Conf2),
%% ?DEL_DIR(TopDir),
+ p(Case, "end_per_testcase end when"
+ "~n Nodes: ~p~n~n", [erlang:nodes()]),
Conf2.
end_per_testcase2(Case, Config) ->
- ApiCases01 =
- [
- simple_sync_get1,
- simple_async_get1,
- simple_sync_get_next1,
- simple_async_get_next1,
- simple_sync_set1,
- simple_async_set1,
- simple_sync_get_bulk1,
- simple_async_get_bulk1,
- misc_async1
- ],
ApiCases02 =
[
simple_sync_get2,
@@ -366,7 +381,6 @@ end_per_testcase2(Case, Config) ->
inform_swarm,
report
] ++
- ApiCases01 ++
ApiCases02 ++
ApiCases03,
case lists:member(Case, Cases) of
@@ -400,7 +414,9 @@ all() ->
{group, event_tests},
{group, event_tests_mt},
discovery,
- {group, tickets}
+ {group, tickets},
+ {group, ipv6},
+ {group, ipv6_mt}
].
groups() ->
@@ -435,10 +451,10 @@ groups() ->
{request_tests, [],
[
{group, get_tests},
- {group, get_next_tests},
+ {group, get_next_tests},
{group, set_tests},
- {group, bulk_tests},
- {group, misc_request_tests}
+ {group, bulk_tests},
+ {group, misc_request_tests}
]
},
{request_tests_mt, [],
@@ -535,9 +551,29 @@ groups() ->
[
otp8395_1
]
- }
+ },
+ {ipv6, [], ipv6_tests()},
+ {ipv6_mt, [], ipv6_tests()}
+
+ ].
+
+ipv6_tests() ->
+ [
+ register_agent1,
+ simple_sync_get_next3,
+ simple_async_get2,
+ simple_sync_get3,
+ simple_async_get_next2,
+ simple_sync_set3,
+ simple_async_set2,
+ simple_sync_get_bulk2,
+ simple_async_get_bulk3,
+ misc_async2,
+ inform1,
+ inform_swarm
].
+
init_per_group(request_tests_mt = GroupName, Config) ->
snmp_test_lib:init_group_top_dir(
GroupName,
@@ -546,10 +582,39 @@ init_per_group(event_tests_mt = GroupName, Config) ->
snmp_test_lib:init_group_top_dir(
GroupName,
[{manager_net_if_module, snmpm_net_if_mt} | Config]);
+init_per_group(ipv6_mt = GroupName, Config) ->
+ {ok, Hostname0} = inet:gethostname(),
+ case ct:require(ipv6_hosts) of
+ ok ->
+ case lists:member(list_to_atom(Hostname0), ct:get_config(ipv6_hosts)) of
+ true ->
+ ipv6_init(
+ snmp_test_lib:init_group_top_dir(
+ GroupName,
+ [{manager_net_if_module, snmpm_net_if_mt}
+ | Config]));
+ false ->
+ {skip, "Host does not support IPv6"}
+ end;
+ _ ->
+ {skip, "Test config ipv6_hosts is missing"}
+ end;
+init_per_group(ipv6 = GroupName, Config) ->
+ {ok, Hostname0} = inet:gethostname(),
+ case ct:require(ipv6_hosts) of
+ ok ->
+ case lists:member(list_to_atom(Hostname0), ct:get_config(ipv6_hosts)) of
+ true ->
+ ipv6_init(snmp_test_lib:init_group_top_dir(GroupName, Config));
+ false ->
+ {skip, "Host does not support IPv6"}
+ end;
+ _ ->
+ {skip, "Test config ipv6_hosts is missing"}
+ end;
init_per_group(GroupName, Config) ->
snmp_test_lib:init_group_top_dir(GroupName, Config).
-
end_per_group(_GroupName, Config) ->
%% Do we really need to do this?
lists:keydelete(snmp_group_top_dir, 1, Config).
@@ -1498,7 +1563,7 @@ register_agent3(Config) when is_list(Config) ->
TargetName2 = "agent3",
?line ok = mgr_register_agent(ManagerNode, user_alfa, TargetName2,
[{tdomain, transportDomainUdpIpv6},
- {address, LocalHost},
+ {address, {0,0,0,0,0,0,0,1}},
{port, 5002},
{engine_id, "agentEngineId-2"}]),
TargetName3 = "agent4",
@@ -1596,12 +1661,14 @@ register_agent3(Config) when is_list(Config) ->
simple_sync_get1(doc) -> ["Simple sync get-request - Old style (Addr & Port)"];
simple_sync_get1(suite) -> [];
simple_sync_get1(Config) when is_list(Config) ->
+ ?SKIP(api_no_longer_supported),
+
process_flag(trap_exit, true),
put(tname, ssg1),
p("starting with Config: ~p~n", [Config]),
Node = ?config(manager_node, Config),
- Addr = ?config(ip, Config),
+ Addr = ?config(manager_agent_target_name, Config),
Port = ?AGENT_PORT,
p("issue get-request without loading the mib"),
@@ -1620,10 +1687,10 @@ simple_sync_get1(Config) when is_list(Config) ->
ok.
do_simple_sync_get(Node, Addr, Port, Oids) ->
- ?line {ok, Reply, Rem} = mgr_user_sync_get(Node, Addr, Port, Oids),
+ ?line {ok, Reply, _Rem} = mgr_user_sync_get(Node, Addr, Port, Oids),
?DBG("~n Reply: ~p"
- "~n Rem: ~w", [Reply, Rem]),
+ "~n Rem: ~w", [Reply, _Rem]),
%% verify that the operation actually worked:
%% The order should be the same, so no need to seach
@@ -1687,10 +1754,10 @@ do_simple_sync_get2(Config, Get, PostVerify) ->
do_simple_sync_get2(Node, TargetName, Oids, Get, PostVerify)
when is_function(Get, 3) andalso is_function(PostVerify, 0) ->
- ?line {ok, Reply, Rem} = Get(Node, TargetName, Oids),
+ ?line {ok, Reply, _Rem} = Get(Node, TargetName, Oids),
?DBG("~n Reply: ~p"
- "~n Rem: ~w", [Reply, Rem]),
+ "~n Rem: ~w", [Reply, _Rem]),
%% verify that the operation actually worked:
%% The order should be the same, so no need to seach
@@ -1757,6 +1824,8 @@ simple_async_get1(doc) ->
["Simple (async) get-request - Old style (Addr & Port)"];
simple_async_get1(suite) -> [];
simple_async_get1(Config) when is_list(Config) ->
+ ?SKIP(api_no_longer_supported),
+
process_flag(trap_exit, true),
put(tname, sag1),
p("starting with Config: ~p~n", [Config]),
@@ -1972,6 +2041,8 @@ simple_sync_get_next1(doc) -> ["Simple (sync) get_next-request - "
"Old style (Addr & Port)"];
simple_sync_get_next1(suite) -> [];
simple_sync_get_next1(Config) when is_list(Config) ->
+ ?SKIP(api_no_longer_supported),
+
process_flag(trap_exit, true),
put(tname, ssgn1),
p("starting with Config: ~p~n", [Config]),
@@ -2062,10 +2133,10 @@ simple_sync_get_next1(Config) when is_list(Config) ->
do_simple_get_next(N, Node, Addr, Port, Oids, Verify) ->
p("issue get-next command ~w", [N]),
case mgr_user_sync_get_next(Node, Addr, Port, Oids) of
- {ok, Reply, Rem} ->
+ {ok, Reply, _Rem} ->
?DBG("get-next ok:"
"~n Reply: ~p"
- "~n Rem: ~w", [Reply, Rem]),
+ "~n Rem: ~w", [Reply, _Rem]),
Verify(Reply);
Error ->
@@ -2218,10 +2289,10 @@ do_simple_sync_get_next2(Config, GetNext, PostVerify)
do_simple_get_next(N, Node, TargetName, Oids, Verify, GetNext, PostVerify) ->
p("issue get-next command ~w", [N]),
case GetNext(Node, TargetName, Oids) of
- {ok, Reply, Rem} ->
+ {ok, Reply, _Rem} ->
?DBG("get-next ok:"
"~n Reply: ~p"
- "~n Rem: ~w", [Reply, Rem]),
+ "~n Rem: ~w", [Reply, _Rem]),
PostVerify(Verify(Reply));
Error ->
@@ -2264,6 +2335,8 @@ simple_async_get_next1(doc) -> ["Simple (async) get_next-request - "
"Old style (Addr & Port)"];
simple_async_get_next1(suite) -> [];
simple_async_get_next1(Config) when is_list(Config) ->
+ ?SKIP(api_no_longer_supported),
+
process_flag(trap_exit, true),
put(tname, ssgn1),
p("starting with Config: ~p~n", [Config]),
@@ -2516,6 +2589,8 @@ simple_sync_set1(doc) -> ["Simple (sync) set-request - "
"Old style (Addr & Port)"];
simple_sync_set1(suite) -> [];
simple_sync_set1(Config) when is_list(Config) ->
+ ?SKIP(api_no_longer_supported),
+
process_flag(trap_exit, true),
put(tname, sss1),
p("starting with Config: ~p~n", [Config]),
@@ -2548,10 +2623,10 @@ simple_sync_set1(Config) when is_list(Config) ->
do_simple_set1(Node, Addr, Port, VAVs) ->
[SysName, SysLoc] = value_of_vavs(VAVs),
- ?line {ok, Reply, Rem} = mgr_user_sync_set(Node, Addr, Port, VAVs),
+ ?line {ok, Reply, _Rem} = mgr_user_sync_set(Node, Addr, Port, VAVs),
?DBG("~n Reply: ~p"
- "~n Rem: ~w", [Reply, Rem]),
+ "~n Rem: ~w", [Reply, _Rem]),
%% verify that the operation actually worked:
%% The order should be the same, so no need to seach
@@ -2628,10 +2703,10 @@ do_simple_sync_set2(Config, Set, PostVerify)
do_simple_set2(Node, TargetName, VAVs, Set, PostVerify) ->
[SysName, SysLoc] = value_of_vavs(VAVs),
- ?line {ok, Reply, Rem} = Set(Node, TargetName, VAVs),
+ ?line {ok, Reply, _Rem} = Set(Node, TargetName, VAVs),
?DBG("~n Reply: ~p"
- "~n Rem: ~w", [Reply, Rem]),
+ "~n Rem: ~w", [Reply, _Rem]),
%% verify that the operation actually worked:
%% The order should be the same, so no need to seach
@@ -2686,6 +2761,8 @@ simple_async_set1(doc) -> ["Simple (async) set-request - "
"Old style (Addr & Port)"];
simple_async_set1(suite) -> [];
simple_async_set1(Config) when is_list(Config) ->
+ ?SKIP(api_no_longer_supported),
+
process_flag(trap_exit, true),
put(tname, sas1),
p("starting with Config: ~p~n", [Config]),
@@ -2896,6 +2973,8 @@ simple_sync_get_bulk1(doc) -> ["Simple (sync) get_bulk-request - "
"Old style (Addr & Port)"];
simple_sync_get_bulk1(suite) -> [];
simple_sync_get_bulk1(Config) when is_list(Config) ->
+ ?SKIP(api_no_longer_supported),
+
process_flag(trap_exit, true),
put(tname, ssgb1),
p("starting with Config: ~p~n", [Config]),
@@ -3019,10 +3098,10 @@ fl(L) ->
do_simple_get_bulk1(N, Node, Addr, Port, NonRep, MaxRep, Oids, Verify) ->
p("issue get-bulk command ~w", [N]),
case mgr_user_sync_get_bulk(Node, Addr, Port, NonRep, MaxRep, Oids) of
- {ok, Reply, Rem} ->
+ {ok, Reply, _Rem} ->
?DBG("get-bulk ok:"
"~n Reply: ~p"
- "~n Rem: ~w", [Reply, Rem]),
+ "~n Rem: ~w", [Reply, _Rem]),
Verify(Reply);
Error ->
@@ -3206,10 +3285,10 @@ do_simple_get_bulk2(N,
is_function(PostVerify) ->
p("issue get-bulk command ~w", [N]),
case GetBulk(NonRep, MaxRep, Oids) of
- {ok, Reply, Rem} ->
+ {ok, Reply, _Rem} ->
?DBG("get-bulk ok:"
"~n Reply: ~p"
- "~n Rem: ~w", [Reply, Rem]),
+ "~n Rem: ~w", [Reply, _Rem]),
PostVerify(Verify(Reply));
Error ->
@@ -3261,6 +3340,8 @@ simple_async_get_bulk1(doc) -> ["Simple (async) get_bulk-request - "
"Old style (Addr & Port)"];
simple_async_get_bulk1(suite) -> [];
simple_async_get_bulk1(Config) when is_list(Config) ->
+ ?SKIP(api_no_longer_supported),
+
process_flag(trap_exit, true),
put(tname, sagb1),
p("starting with Config: ~p~n", [Config]),
@@ -3605,6 +3686,8 @@ misc_async1(doc) -> ["Misc (async) request(s) - "
"Old style (Addr & Port)"];
misc_async1(suite) -> [];
misc_async1(Config) when is_list(Config) ->
+ ?SKIP(api_no_longer_supported),
+
process_flag(trap_exit, true),
put(tname, ms1),
p("starting with Config: ~p~n", [Config]),
@@ -5046,7 +5129,7 @@ inform_swarm_collector(N) ->
inform_swarm_collector(N, SentAckCnt, RecvCnt, RespCnt, _)
when ((N == SentAckCnt) and
(N == RespCnt) and
- (N >= RecvCnt)) ->
+ (N =< RecvCnt)) ->
p("inform_swarm_collector -> done when"
"~n N: ~w"
"~n SentAckCnt: ~w"
@@ -5292,34 +5375,59 @@ init_manager(AutoInform, Config) ->
?line Node = start_manager_node(),
+ %% The point with this (try catch block) is to be
+ %% able to do some cleanup in case we fail to
+ %% start some of the apps. That is, if we fail to
+ %% start the apps (mnesia, crypto and snmp agent)
+ %% we stop the (agent) node!
- %% --
- %% Start and initiate crypto on manager node
- %%
-
- ?line ok = init_crypto(Node),
+ try
+ begin
- %%
- %% Write manager config
- %%
+ %% --
+ %% Start and initiate crypto on manager node
+ %%
+
+ ?line ok = init_crypto(Node),
+
+ %%
+ %% Write manager config
+ %%
+
+ ?line ok = write_manager_config(Config),
+
+ IRB = case AutoInform of
+ true ->
+ auto;
+ _ ->
+ user
+ end,
+ Conf = [{manager_node, Node}, {irb, IRB} | Config],
+ Vsns = [v1,v2,v3],
+ start_manager(Node, Vsns, Conf)
+ end
+ catch
+ T:E ->
+ StackTrace = ?STACK(),
+ p("Failure during manager start: "
+ "~n Error Type: ~p"
+ "~n Error: ~p"
+ "~n StackTrace: ~p", [T, E, StackTrace]),
+ %% And now, *try* to cleanup
+ (catch stop_node(Node)),
+ ?FAIL({failed_starting_manager, T, E, StackTrace})
+ end.
- ?line ok = write_manager_config(Config),
-
- IRB = case AutoInform of
- true ->
- auto;
- _ ->
- user
- end,
- Conf = [{manager_node, Node}, {irb, IRB} | Config],
- Vsns = [v1,v2,v3],
- start_manager(Node, Vsns, Conf).
-
fin_manager(Config) ->
Node = ?config(manager_node, Config),
- stop_manager(Node, Config),
- fin_crypto(Node),
- stop_node(Node),
+ StopMgrRes = stop_manager(Node),
+ StopCryptoRes = fin_crypto(Node),
+ StopNode = stop_node(Node),
+ p("fin_agent -> stop apps and (mgr node ~p) node results: "
+ "~n SNMP Mgr: ~p"
+ "~n Crypto: ~p"
+ "~n Node: ~p",
+ [Node, StopMgrRes, StopCryptoRes, StopNode]),
Config.
@@ -5341,52 +5449,93 @@ init_agent(Config) ->
?line Node = start_agent_node(),
+ %% The point with this (try catch block) is to be
+ %% able to do some cleanup in case we fail to
+ %% start some of the apps. That is, if we fail to
+ %% start the apps (mnesia, crypto and snmp agent)
+ %% we stop the (agent) node!
- %% --
- %% Start and initiate mnesia on agent node
- %%
-
- ?line ok = init_mnesia(Node, Dir),
-
-
- %% --
- %% Start and initiate crypto on agent node
- %%
-
- ?line ok = init_crypto(Node),
-
-
- %%
- %% Write agent config
- %%
-
- Vsns = [v1,v2],
- ?line ok = write_agent_config(Vsns, Config),
-
- Conf = [{agent_node, Node},
- {mib_dir, MibDir} | Config],
+ try
+ begin
+
+ %% --
+ %% Start and initiate mnesia on agent node
+ %%
+
+ ?line ok = init_mnesia(Node, Dir, ?config(mnesia_debug, Config)),
+
+
+ %% --
+ %% Start and initiate crypto on agent node
+ %%
+
+ ?line ok = init_crypto(Node),
+
+
+ %%
+ %% Write agent config
+ %%
+
+ Vsns = [v1,v2],
+ ?line ok = write_agent_config(Vsns, Config),
+
+ Conf = [{agent_node, Node},
+ {mib_dir, MibDir} | Config],
- %%
- %% Start the agent
- %%
-
- start_agent(Node, Vsns, Conf).
+ %%
+ %% Start the agent
+ %%
+
+ start_agent(Node, Vsns, Conf)
+ end
+ catch
+ T:E ->
+ StackTrace = ?STACK(),
+ p("Failure during agent start: "
+ "~n Error Type: ~p"
+ "~n Error: ~p"
+ "~n StackTrace: ~p", [T, E, StackTrace]),
+ %% And now, *try* to cleanup
+ (catch stop_node(Node)),
+ ?FAIL({failed_starting_agent, T, E, StackTrace})
+ end.
+
fin_agent(Config) ->
Node = ?config(agent_node, Config),
- stop_agent(Node, Config),
- fin_crypto(Node),
- fin_mnesia(Node),
- stop_node(Node),
+ StopAgentRes = stop_agent(Node),
+ StopCryptoRes = fin_crypto(Node),
+ StopMnesiaRes = fin_mnesia(Node),
+ StopNode = stop_node(Node),
+ p("fin_agent -> stop apps and (agent node ~p) node results: "
+ "~n SNMP Agent: ~p"
+ "~n Crypto: ~p"
+ "~n Mnesia: ~p"
+ "~n Node: ~p",
+ [Node, StopAgentRes, StopCryptoRes, StopMnesiaRes, StopNode]),
Config.
-init_mnesia(Node, Dir) ->
+init_mnesia(Node, Dir, MnesiaDebug)
+ when ((MnesiaDebug =/= none) andalso
+ (MnesiaDebug =/= debug) andalso (MnesiaDebug =/= trace)) ->
+ init_mnesia(Node, Dir, ?DEFAULT_MNESIA_DEBUG);
+init_mnesia(Node, Dir, MnesiaDebug) ->
?DBG("init_mnesia -> load application mnesia", []),
?line ok = load_mnesia(Node),
?DBG("init_mnesia -> application mnesia: set_env dir: ~n~p",[Dir]),
?line ok = set_mnesia_env(Node, dir, filename:join(Dir, "mnesia")),
+ %% Just in case, only set (known to be) valid values for debug
+ if
+ ((MnesiaDebug =:= debug) orelse (MnesiaDebug =:= trace)) ->
+ ?DBG("init_mnesia -> application mnesia: set_env debug: ~w",
+ [MnesiaDebug]),
+ ?line ok = set_mnesia_env(Node, debug, MnesiaDebug);
+ true ->
+ ok
+ end,
+
?DBG("init_mnesia -> create mnesia schema",[]),
?line case create_schema(Node) of
ok ->
@@ -5423,25 +5572,89 @@ fin_crypto(Node) ->
%% -- Misc application wrapper functions --
-load_app(Node, App) when (Node =:= node()) andalso is_atom(App) ->
- application:load(App);
-load_app(Node, App) when is_atom(App) ->
- rcall(Node, application, load, [App]).
-
-start_app(Node, App) when (Node =:= node()) andalso is_atom(App) ->
- application:start(App);
+load_app(Node, App) ->
+ VerifySuccess = fun(ok) ->
+ ok;
+ ({error, {already_loaded, LoadedApp}}) when (LoadedApp =:= App) ->
+ ok;
+ ({error, Reason}) ->
+ p("failed loading app ~w on ~p: "
+ "~n ~p", [App, Node, Reason]),
+ ?FAIL({failed_load, Node, App, Reason})
+ end,
+ do_load_app(Node, App, VerifySuccess).
+
+do_load_app(Node, App, VerifySuccess)
+ when (Node =:= node()) andalso is_atom(App) ->
+ %% Local app
+ exec(fun() -> application:load(App) end, VerifySuccess);
+do_load_app(Node, App, VerifySuccess) ->
+ %% Remote app
+ exec(fun() -> rcall(Node, application, load, [App]) end, VerifySuccess).
+
+
start_app(Node, App) ->
- rcall(Node, application, start, [App]).
+ VerifySuccess = fun(ok) ->
+ ok;
+ ({error, {already_started, LoadedApp}}) when (LoadedApp =:= App) ->
+ ok;
+ ({error, Reason}) ->
+ p("failed starting app ~w on ~p: "
+ "~n ~p", [App, Node, Reason]),
+ ?FAIL({failed_start, Node, App, Reason})
+ end,
+ start_app(Node, App, VerifySuccess).
+
+start_app(Node, App, VerifySuccess)
+ when (Node =:= node()) andalso is_atom(App) ->
+ exec(fun() -> application:start(App) end, VerifySuccess);
+start_app(Node, App, VerifySuccess) ->
+ exec(fun() -> rcall(Node, application, start, [App]) end, VerifySuccess).
+
+
+stop_app(Node, App) ->
+ VerifySuccess = fun(ok) ->
+ ok;
+ ({error, {not_started, LoadedApp}}) when (LoadedApp =:= App) ->
+ ok;
+ ({error, Reason}) ->
+ p("failed stopping app ~w on ~p: "
+ "~n ~p", [App, Node, Reason]),
+ ?FAIL({failed_stop, Node, App, Reason})
+ end,
+ stop_app(Node, App, VerifySuccess).
+
+stop_app(Node, App, VerifySuccess)
+ when (Node =:= node()) andalso is_atom(App) ->
+ exec(fun() -> application:stop(App) end, VerifySuccess);
+stop_app(Node, App, VerifySuccess) when is_atom(App) ->
+ exec(fun() -> rcall(Node, application, stop, [App]) end, VerifySuccess).
+
+
+set_app_env(Node, App, Key, Val) ->
+ VerifySuccess = fun(ok) ->
+ ok;
+ ({error, Reason}) ->
+ p("failed setting app ~w env on ~p"
+ "~n Key: ~p"
+ "~n Val: ~p"
+ "~n Reason: ~p"
+ "~n ~p", [App, Node, Key, Val, Reason]),
+ ?FAIL({failed_set_app_env,
+ Node, App, Key, Val, Reason})
+ end,
+ set_app_env(Node, App, Key, Val, VerifySuccess).
+
+set_app_env(Node, App, Key, Val, VerifySuccess)
+ when (Node =:= node()) andalso is_atom(App) ->
+ exec(fun() -> application:set_env(App, Key, Val) end, VerifySuccess);
+set_app_env(Node, App, Key, Val, VerifySuccess) when is_atom(App) ->
+ exec(fun() -> rcall(Node, application, set_env, [App, Key, Val]) end,
+ VerifySuccess).
-stop_app(Node, App) when (Node =:= node()) andalso is_atom(App) ->
- application:stop(App);
-stop_app(Node, App) when is_atom(App) ->
- rcall(Node, application, stop, [App]).
-set_app_env(Node, App, Key, Val) when (Node =:= node()) andalso is_atom(App) ->
- application:set_env(App, Key, Val);
-set_app_env(Node, App, Key, Val) when is_atom(App) ->
- rcall(Node, application, set_env, [App, Key, Val]).
+exec(Cmd, VerifySuccess) ->
+ VerifySuccess(Cmd()).
%% -- Misc snmp wrapper functions --
@@ -5591,42 +5804,72 @@ fin_mgr_user(Conf) ->
init_mgr_user_data1(Conf) ->
Node = ?config(manager_node, Conf),
- Addr = ?config(ip, Conf),
- Port = ?AGENT_PORT,
- ?line ok = mgr_user_register_agent(Node, Addr, Port),
- Agents = mgr_user_which_own_agents(Node),
- ?DBG("Own agents: ~p", [Agents]),
+ TargetName = ?config(manager_agent_target_name, Conf),
+ IpFamily = ?config(ipfamily, Conf),
+ Ip = ?config(ip, Conf),
+ Port = ?AGENT_PORT,
+ ?line ok =
+ case IpFamily of
+ inet ->
+ mgr_user_register_agent(
+ Node, TargetName,
+ [{address, Ip},
+ {port, Port},
+ {engine_id, "agentEngine"}]);
+ inet6 ->
+ mgr_user_register_agent(
+ Node, TargetName,
+ [{tdomain, transportDomainUdpIpv6},
+ {taddress, {Ip, Port}},
+ {engine_id, "agentEngine"}])
+ end,
+ _Agents = mgr_user_which_own_agents(Node),
+ ?DBG("Own agents: ~p", [_Agents]),
- ?line {ok, DefAgentConf} = mgr_user_agent_info(Node, Addr, Port, all),
- ?DBG("Default agent config: ~n~p", [DefAgentConf]),
+ ?line {ok, _DefAgentConf} = mgr_user_agent_info(Node, TargetName, all),
+ ?DBG("Default agent config: ~n~p", [_DefAgentConf]),
- ?line ok = mgr_user_update_agent_info(Node, Addr, Port,
+ ?line ok = mgr_user_update_agent_info(Node, TargetName,
community, "all-rights"),
- ?line ok = mgr_user_update_agent_info(Node, Addr, Port,
+ ?line ok = mgr_user_update_agent_info(Node, TargetName,
sec_name, "all-rights"),
- ?line ok = mgr_user_update_agent_info(Node, Addr, Port,
+ ?line ok = mgr_user_update_agent_info(Node, TargetName,
engine_id, "agentEngine"),
- ?line ok = mgr_user_update_agent_info(Node, Addr, Port,
+ ?line ok = mgr_user_update_agent_info(Node, TargetName,
max_message_size, 1024),
- ?line {ok, AgentConf} = mgr_user_agent_info(Node, Addr, Port, all),
- ?DBG("Updated agent config: ~n~p", [AgentConf]),
+ ?line {ok, _AgentConf} = mgr_user_agent_info(Node, TargetName, all),
+ ?DBG("Updated agent config: ~n~p", [_AgentConf]),
Conf.
init_mgr_user_data2(Conf) ->
+ ?DBG("init_mgr_user_data2 -> entry with"
+ "~n Conf: ~p", [Conf]),
Node = ?config(manager_node, Conf),
TargetName = ?config(manager_agent_target_name, Conf),
- Addr = ?config(ip, Conf),
+ IpFamily = ?config(ipfamily, Conf),
+ Ip = ?config(ip, Conf),
Port = ?AGENT_PORT,
- ?line ok = mgr_user_register_agent(Node, TargetName,
- [{address, Addr},
- {port, Port},
- {engine_id, "agentEngine"}]),
- Agents = mgr_user_which_own_agents(Node),
- ?DBG("Own agents: ~p", [Agents]),
+ ?line ok =
+ case IpFamily of
+ inet ->
+ mgr_user_register_agent(
+ Node, TargetName,
+ [{address, Ip},
+ {port, Port},
+ {engine_id, "agentEngine"}]);
+ inet6 ->
+ mgr_user_register_agent(
+ Node, TargetName,
+ [{tdomain, transportDomainUdpIpv6},
+ {taddress, {Ip, Port}},
+ {engine_id, "agentEngine"}])
+ end,
+ _Agents = mgr_user_which_own_agents(Node),
+ ?DBG("Own agents: ~p", [_Agents]),
- ?line {ok, DefAgentConf} = mgr_user_agent_info(Node, TargetName, all),
- ?DBG("Default agent config: ~n~p", [DefAgentConf]),
+ ?line {ok, _DefAgentConf} = mgr_user_agent_info(Node, TargetName, all),
+ ?DBG("Default agent config: ~n~p", [_DefAgentConf]),
?line ok = mgr_user_update_agent_info(Node, TargetName,
community, "all-rights"),
@@ -5635,15 +5878,14 @@ init_mgr_user_data2(Conf) ->
?line ok = mgr_user_update_agent_info(Node, TargetName,
max_message_size, 1024),
- ?line {ok, AgentConf} = mgr_user_agent_info(Node, TargetName, all),
- ?DBG("Updated agent config: ~n~p", [AgentConf]),
+ ?line {ok, _AgentConf} = mgr_user_agent_info(Node, TargetName, all),
+ ?DBG("Updated agent config: ~n~p", [_AgentConf]),
Conf.
fin_mgr_user_data1(Conf) ->
Node = ?config(manager_node, Conf),
- Addr = ?config(ip, Conf),
- Port = ?AGENT_PORT,
- mgr_user_unregister_agent(Node, Addr, Port),
+ TargetName = ?config(manager_agent_target_name, Conf),
+ mgr_user_unregister_agent(Node, TargetName),
mgr_user_which_own_agents(Node),
Conf.
@@ -5670,33 +5912,41 @@ mgr_user_stop(Node) ->
%% mgr_user_register_agent(Node, Addr, ?AGENT_PORT, []).
mgr_user_register_agent(Node, TargetName, Conf)
when is_list(TargetName) andalso is_list(Conf) ->
- rcall(Node, snmp_manager_user, register_agent, [TargetName, Conf]);
-mgr_user_register_agent(Node, Addr, Port) ->
- mgr_user_register_agent(Node, Addr, Port, []).
-mgr_user_register_agent(Node, Addr, Port, Conf) ->
- rcall(Node, snmp_manager_user, register_agent, [Addr, Port, Conf]).
+ rcall(Node, snmp_manager_user, register_agent, [TargetName, Conf]).
+%% <REMOVED-IN-R16B>
+%% mgr_user_register_agent(Node, Addr, Port) ->
+%% mgr_user_register_agent(Node, Addr, Port, []).
+%% mgr_user_register_agent(Node, Addr, Port, Conf) ->
+%% rcall(Node, snmp_manager_user, register_agent, [Addr, Port, Conf]).
+%% </REMOVED-IN-R16B>
%% mgr_user_unregister_agent(Node) ->
%% mgr_user_unregister_agent(Node, ?LOCALHOST(), ?AGENT_PORT).
-mgr_user_unregister_agent(Node, Addr_or_TargetName) ->
- rcall(Node, snmp_manager_user, unregister_agent, [Addr_or_TargetName]).
-mgr_user_unregister_agent(Node, Addr, Port) ->
- rcall(Node, snmp_manager_user, unregister_agent, [Addr, Port]).
-
-mgr_user_agent_info(Node, Addr_or_TargetName, Item) when is_atom(Item) ->
- rcall(Node, snmp_manager_user, agent_info, [Addr_or_TargetName, Item]).
-mgr_user_agent_info(Node, Addr, Port, Item) when is_atom(Item) ->
- rcall(Node, snmp_manager_user, agent_info, [Addr, Port, Item]).
+mgr_user_unregister_agent(Node, TargetName) when is_list(TargetName) ->
+ rcall(Node, snmp_manager_user, unregister_agent, [TargetName]).
+%% <REMOVED-IN-R16B>
+%% mgr_user_unregister_agent(Node, Addr, Port) ->
+%% rcall(Node, snmp_manager_user, unregister_agent, [Addr, Port]).
+%% </REMOVED-IN-R16B>
+
+mgr_user_agent_info(Node, TargetName, Item)
+ when is_list(TargetName) andalso is_atom(Item) ->
+ rcall(Node, snmp_manager_user, agent_info, [TargetName, Item]).
+%% <REMOVED-IN-R16B>
+%% mgr_user_agent_info(Node, Addr, Port, Item) when is_atom(Item) ->
+%% rcall(Node, snmp_manager_user, agent_info, [Addr, Port, Item]).
+%% </REMOVED-IN-R16B>
%% mgr_user_update_agent_info(Node, Item, Val) when atom(Item) ->
%% mgr_user_update_agent_info(Node, ?LOCALHOST(), ?AGENT_PORT, Item, Val).
-mgr_user_update_agent_info(Node, Addr_or_TargetName, Item, Val)
- when is_atom(Item) ->
- rcall(Node, snmp_manager_user, update_agent_info,
- [Addr_or_TargetName, Item, Val]).
-mgr_user_update_agent_info(Node, Addr, Port, Item, Val) when is_atom(Item) ->
- rcall(Node, snmp_manager_user, update_agent_info,
- [Addr, Port, Item, Val]).
+mgr_user_update_agent_info(Node, TargetName, Item, Val)
+ when is_list(TargetName) andalso is_atom(Item) ->
+ rcall(Node, snmp_manager_user, update_agent_info, [TargetName, Item, Val]).
+%% <REMOVED-IN-R16B>
+%% mgr_user_update_agent_info(Node, Addr, Port, Item, Val) when is_atom(Item) ->
+%% rcall(Node, snmp_manager_user, update_agent_info,
+%% [Addr, Port, Item, Val]).
+%% </REMOVED-IN-R16B>
%% mgr_user_which_all_agents(Node) ->
%% rcall(Node, snmp_manager_user, which_all_agents, []).
@@ -5709,89 +5959,112 @@ mgr_user_load_mib(Node, Mib) ->
%% mgr_user_sync_get(Node, Oids) ->
%% mgr_user_sync_get(Node, ?LOCALHOST(), ?AGENT_PORT, Oids).
-mgr_user_sync_get(Node, Addr_or_TargetName, Oids) ->
- rcall(Node, snmp_manager_user, sync_get, [Addr_or_TargetName, Oids]).
+mgr_user_sync_get(Node, TargetName, Oids) when is_list(TargetName) ->
+ rcall(Node, snmp_manager_user, sync_get, [TargetName, Oids]).
+%% <REMOVED-IN-R16B>
mgr_user_sync_get(Node, Addr, Port, Oids) ->
rcall(Node, snmp_manager_user, sync_get, [Addr, Port, Oids]).
+%% </REMOVED-IN-R16B>
-mgr_user_sync_get2(Node, TargetName, Oids, SendOpts) ->
+mgr_user_sync_get2(Node, TargetName, Oids, SendOpts) when is_list(TargetName) ->
rcall(Node, snmp_manager_user, sync_get2, [TargetName, Oids, SendOpts]).
%% mgr_user_async_get(Node, Oids) ->
%% mgr_user_async_get(Node, ?LOCALHOST(), ?AGENT_PORT, Oids).
-mgr_user_async_get(Node, Addr_or_TargetName, Oids) ->
- rcall(Node, snmp_manager_user, async_get, [Addr_or_TargetName, Oids]).
+mgr_user_async_get(Node, TargetName, Oids) when is_list(TargetName) ->
+ rcall(Node, snmp_manager_user, async_get, [TargetName, Oids]).
+%% <REMOVED-IN-R16B>
mgr_user_async_get(Node, Addr, Port, Oids) ->
rcall(Node, snmp_manager_user, async_get, [Addr, Port, Oids]).
+%% </REMOVED-IN-R16B>
-mgr_user_async_get2(Node, TargetName, Oids, SendOpts) ->
+mgr_user_async_get2(Node, TargetName, Oids, SendOpts)
+ when is_list(TargetName) ->
rcall(Node, snmp_manager_user, async_get2, [TargetName, Oids, SendOpts]).
%% mgr_user_sync_get_next(Node, Oids) ->
%% mgr_user_sync_get_next(Node, ?LOCALHOST(), ?AGENT_PORT, Oids).
-mgr_user_sync_get_next(Node, Addr_or_TargetName, Oids) ->
- rcall(Node, snmp_manager_user, sync_get_next, [Addr_or_TargetName, Oids]).
+mgr_user_sync_get_next(Node, TargetName, Oids) when is_list(TargetName) ->
+ rcall(Node, snmp_manager_user, sync_get_next, [TargetName, Oids]).
+%% <REMOVED-IN-R16B>
mgr_user_sync_get_next(Node, Addr, Port, Oids) ->
rcall(Node, snmp_manager_user, sync_get_next, [Addr, Port, Oids]).
+%% </REMOVED-IN-R16B>
-mgr_user_sync_get_next2(Node, TargetName, Oids, SendOpts) ->
+mgr_user_sync_get_next2(Node, TargetName, Oids, SendOpts)
+ when is_list(TargetName) ->
rcall(Node, snmp_manager_user, sync_get_next2, [TargetName, Oids, SendOpts]).
%% mgr_user_async_get_next(Node, Oids) ->
%% mgr_user_async_get_next(Node, ?LOCALHOST(), ?AGENT_PORT, Oids).
-mgr_user_async_get_next(Node, Addr_or_TargetName, Oids) ->
- rcall(Node, snmp_manager_user, async_get_next, [Addr_or_TargetName, Oids]).
+mgr_user_async_get_next(Node, TargetName, Oids) when is_list(TargetName) ->
+ rcall(Node, snmp_manager_user, async_get_next, [TargetName, Oids]).
+%% <REMOVED-IN-R16B>
mgr_user_async_get_next(Node, Addr, Port, Oids) ->
rcall(Node, snmp_manager_user, async_get_next, [Addr, Port, Oids]).
+%% </REMOVED-IN-R16B>
-mgr_user_async_get_next2(Node, TargetName, Oids, SendOpts) ->
+mgr_user_async_get_next2(Node, TargetName, Oids, SendOpts)
+ when is_list(TargetName) ->
rcall(Node, snmp_manager_user, async_get_next2, [TargetName, Oids, SendOpts]).
%% mgr_user_sync_set(Node, VAV) ->
%% mgr_user_sync_set(Node, ?LOCALHOST(), ?AGENT_PORT, VAV).
-mgr_user_sync_set(Node, Addr_or_TargetName, VAV) ->
- rcall(Node, snmp_manager_user, sync_set, [Addr_or_TargetName, VAV]).
+mgr_user_sync_set(Node, TargetName, VAV) when is_list(TargetName) ->
+ rcall(Node, snmp_manager_user, sync_set, [TargetName, VAV]).
+%% <REMOVED-IN-R16B>
mgr_user_sync_set(Node, Addr, Port, VAV) ->
rcall(Node, snmp_manager_user, sync_set, [Addr, Port, VAV]).
+%% </REMOVED-IN-R16B>
-mgr_user_sync_set2(Node, TargetName, VAV, SendOpts) ->
+mgr_user_sync_set2(Node, TargetName, VAV, SendOpts) when is_list(TargetName) ->
rcall(Node, snmp_manager_user, sync_set2, [TargetName, VAV, SendOpts]).
%% mgr_user_async_set(Node, VAV) ->
%% mgr_user_async_set(Node, ?LOCALHOST(), ?AGENT_PORT, VAV).
-mgr_user_async_set(Node, Addr_or_TargetName, VAV) ->
- rcall(Node, snmp_manager_user, async_set, [Addr_or_TargetName, VAV]).
+mgr_user_async_set(Node, TargetName, VAV) when is_list(TargetName) ->
+ rcall(Node, snmp_manager_user, async_set, [TargetName, VAV]).
+%% <REMOVED-IN-R16B>
mgr_user_async_set(Node, Addr, Port, VAV) ->
rcall(Node, snmp_manager_user, async_set, [Addr, Port, VAV]).
+%% </REMOVED-IN-R16B>
-mgr_user_async_set2(Node, TargetName, VAV, SendOpts) ->
+mgr_user_async_set2(Node, TargetName, VAV, SendOpts) when is_list(TargetName) ->
rcall(Node, snmp_manager_user, async_set2, [TargetName, VAV, SendOpts]).
%% mgr_user_sync_get_bulk(Node, NonRep, MaxRep, Oids) ->
%% mgr_user_sync_get_bulk(Node, ?LOCALHOST(), ?AGENT_PORT,
%% NonRep, MaxRep, Oids).
-mgr_user_sync_get_bulk(Node, Addr_or_TargetName, NonRep, MaxRep, Oids) ->
+mgr_user_sync_get_bulk(Node, TargetName, NonRep, MaxRep, Oids)
+ when is_list(TargetName) ->
rcall(Node, snmp_manager_user, sync_get_bulk,
- [Addr_or_TargetName, NonRep, MaxRep, Oids]).
+ [TargetName, NonRep, MaxRep, Oids]).
+%% <REMOVED-IN-R16B>
mgr_user_sync_get_bulk(Node, Addr, Port, NonRep, MaxRep, Oids) ->
rcall(Node, snmp_manager_user, sync_get_bulk,
[Addr, Port, NonRep, MaxRep, Oids]).
+%% </REMOVED-IN-R16B>
-mgr_user_sync_get_bulk2(Node, TargetName, NonRep, MaxRep, Oids, SendOpts) ->
+mgr_user_sync_get_bulk2(Node, TargetName, NonRep, MaxRep, Oids, SendOpts)
+ when is_list(TargetName) ->
rcall(Node, snmp_manager_user, sync_get_bulk2,
[TargetName, NonRep, MaxRep, Oids, SendOpts]).
%% mgr_user_async_get_bulk(Node, NonRep, MaxRep, Oids) ->
%% mgr_user_async_get_bulk(Node, ?LOCALHOST(), ?AGENT_PORT,
%% NonRep, MaxRep, Oids).
-mgr_user_async_get_bulk(Node, Addr_or_TargetName, NonRep, MaxRep, Oids) ->
+mgr_user_async_get_bulk(Node, TargetName, NonRep, MaxRep, Oids)
+ when is_list(TargetName) ->
rcall(Node, snmp_manager_user, async_get_bulk,
- [Addr_or_TargetName, NonRep, MaxRep, Oids]).
+ [TargetName, NonRep, MaxRep, Oids]).
+%% <REMOVED-IN-R16B>
mgr_user_async_get_bulk(Node, Addr, Port, NonRep, MaxRep, Oids) ->
rcall(Node, snmp_manager_user, async_get_bulk,
[Addr, Port, NonRep, MaxRep, Oids]).
+%% </REMOVED-IN-R16B>
-mgr_user_async_get_bulk2(Node, TargetName, NonRep, MaxRep, Oids, SendOpts) ->
+mgr_user_async_get_bulk2(Node, TargetName, NonRep, MaxRep, Oids, SendOpts)
+ when is_list(TargetName) ->
rcall(Node, snmp_manager_user, async_get_bulk2,
[TargetName, NonRep, MaxRep, Oids, SendOpts]).
@@ -5806,12 +6079,12 @@ mgr_user_name_to_oid(Node, Name) ->
start_manager(Node, Vsns, Config) ->
start_manager(Node, Vsns, Config, []).
-start_manager(Node, Vsns, Conf0, Opts) ->
+start_manager(Node, Vsns, Conf0, _Opts) ->
?DBG("start_manager -> entry with"
"~n Node: ~p"
"~n Vsns: ~p"
"~n Conf0: ~p"
- "~n Opts: ~p", [Node, Vsns, Conf0, Opts]),
+ "~n Opts: ~p", [Node, Vsns, Conf0, _Opts]),
AtlDir = ?config(manager_log_dir, Conf0),
ConfDir = ?config(manager_conf_dir, Conf0),
@@ -5853,20 +6126,20 @@ start_manager(Node, Vsns, Conf0, Opts) ->
Conf0.
-stop_manager(Node, Conf) ->
- stop_snmp(Node),
- Conf.
+stop_manager(Node) ->
+ stop_snmp(Node).
+
%% -- Misc agent wrapper functions --
start_agent(Node, Vsns, Config) ->
start_agent(Node, Vsns, Config, []).
-start_agent(Node, Vsns, Conf0, Opts) ->
+start_agent(Node, Vsns, Conf0, _Opts) ->
?DBG("start_agent -> entry with"
"~n Node: ~p"
"~n Vsns: ~p"
"~n Conf0: ~p"
- "~n Opts: ~p", [Node, Vsns, Conf0, Opts]),
+ "~n Opts: ~p", [Node, Vsns, Conf0, _Opts]),
AtlDir = ?config(agent_log_dir, Conf0),
ConfDir = ?config(agent_conf_dir, Conf0),
@@ -5904,9 +6177,8 @@ start_agent(Node, Vsns, Conf0, Opts) ->
?line ok = start_snmp(Node),
Conf0.
-stop_agent(Node, Conf) ->
- stop_snmp(Node),
- Conf.
+stop_agent(Node) ->
+ stop_snmp(Node).
agent_load_mib(Node, Mib) ->
rcall(Node, snmpa, load_mibs, [[Mib]]).
@@ -5968,17 +6240,18 @@ stop_node(Node) ->
rpc:cast(Node, erlang, halt, []),
await_stopped(Node, 5).
-await_stopped(_, 0) ->
+await_stopped(Node, 0) ->
+ p("await_stopped -> ~p still exist: giving up", [Node]),
ok;
await_stopped(Node, N) ->
Nodes = erlang:nodes(),
case lists:member(Node, Nodes) of
true ->
- ?DBG("[~w] ~p still exist", [N, Node]),
+ p("await_stopped -> ~p still exist: ~w", [Node, N]),
?SLEEP(1000),
await_stopped(Node, N-1);
false ->
- ?DBG("[~w] ~p gone", [N, Node]),
+ p("await_stopped -> ~p gone: ~w", [Node, N]),
ok
end.
@@ -5988,10 +6261,16 @@ await_stopped(Node, N) ->
write_manager_config(Config) ->
Dir = ?config(manager_conf_dir, Config),
- Ip = ?config(ip, Config),
- Addr = tuple_to_list(Ip),
- snmp_config:write_manager_snmp_files(Dir, Addr, ?MGR_PORT,
- ?MGR_MMS, ?MGR_ENGINE_ID, [], [], []).
+ Ip = tuple_to_list(?config(ip, Config)),
+ {Addr, Port} =
+ case ?config(ipfamily, Config) of
+ inet ->
+ {Ip, ?MGR_PORT};
+ inet6 ->
+ {transportDomainUdpIpv6, {Ip, ?MGR_PORT}}
+ end,
+ snmp_config:write_manager_snmp_files(
+ Dir, Addr, Port, ?MGR_MMS, ?MGR_ENGINE_ID, [], [], []).
write_manager_conf(Dir) ->
Port = "5000",
@@ -6020,25 +6299,27 @@ write_manager_conf(Dir, Str) ->
write_agent_config(Vsns, Conf) ->
Dir = ?config(agent_conf_dir, Conf),
- Ip = ?config(ip, Conf),
- ?line Addr = tuple_to_list(Ip),
- ?line ok = write_agent_config_files(Dir, Vsns, Addr),
+ ?line Ip = tuple_to_list(?config(ip, Conf)),
+ ?line Domain =
+ case ?config(ipfamily, Conf) of
+ inet ->
+ snmpUDPDomain;
+ inet6 ->
+ transportDomainUdpIpv6
+ end,
+ ?line ok = write_agent_config_files(Dir, Vsns, Domain, Ip),
?line ok = update_agent_usm(Vsns, Dir),
?line ok = update_agent_community(Vsns, Dir),
?line ok = update_agent_vacm(Vsns, Dir),
- ?line ok = write_agent_target_addr_conf(Dir, Addr, Vsns),
+ ?line ok = write_agent_target_addr_conf(Dir, Domain, Ip, Vsns),
?line ok = write_agent_target_params_conf(Dir, Vsns),
?line ok = write_agent_notify_conf(Dir),
ok.
-write_agent_config_files(Dir, Vsns, Addr) ->
- snmp_config:write_agent_snmp_files(Dir, Vsns,
- Addr, ?MGR_PORT,
- Addr, ?AGENT_PORT,
- "mgr-test", "trap",
- none, "",
- ?AGENT_ENGINE_ID,
- ?AGENT_MMS).
+write_agent_config_files(Dir, Vsns, Domain, Ip) ->
+ snmp_config:write_agent_snmp_files(
+ Dir, Vsns, Domain, {Ip, ?MGR_PORT}, {Ip, ?AGENT_PORT}, "mgr-test",
+ trap, none, "", ?AGENT_ENGINE_ID, ?AGENT_MMS).
update_agent_usm(Vsns, Dir) ->
case lists:member(v3, Vsns) of
@@ -6106,9 +6387,9 @@ update_agent_vacm(_Vsns, Dir) ->
excluded, null}],
snmp_config:update_agent_vacm_config(Dir, Conf).
-write_agent_target_addr_conf(Dir, Addr, Vsns) ->
- snmp_config:write_agent_snmp_target_addr_conf(Dir, Addr, ?MGR_PORT,
- 300, 3, Vsns).
+write_agent_target_addr_conf(Dir, Domain, Ip, Vsns) ->
+ snmp_config:write_agent_snmp_target_addr_conf(
+ Dir, Domain, {Ip, ?MGR_PORT}, 300, 3, Vsns).
write_agent_target_params_conf(Dir, Vsns) ->
F = fun(v1) -> {"target_v1", v1, v1, "all-rights", noAuthNoPriv};
@@ -6224,7 +6505,7 @@ p(F, A) ->
p(TName, F, A) ->
io:format("*** [~w][~s] ***"
- "~n" ++ F ++ "~n", [TName, formated_timestamp()|A]).
+ "~n " ++ F ++ "~n", [TName, formated_timestamp()|A]).
formated_timestamp() ->
snmp_test_lib:formated_timestamp().
@@ -6232,3 +6513,5 @@ formated_timestamp() ->
%% p(TName, F, A) ->
%% io:format("~w -> " ++ F ++ "~n", [TName|A]).
+ipv6_init(Config) when is_list(Config) ->
+ [{ipfamily, inet6} | Config].
diff --git a/lib/snmp/test/snmp_manager_user.erl b/lib/snmp/test/snmp_manager_user.erl
index 1b62b04960..409f87cf40 100644
--- a/lib/snmp/test/snmp_manager_user.erl
+++ b/lib/snmp/test/snmp_manager_user.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -30,7 +31,7 @@
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include("test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
@@ -44,20 +45,20 @@
info/0,
system_info/0,
simulate_crash/1,
- register_agent/2, register_agent/3,
- unregister_agent/1, unregister_agent/2,
- agent_info/2, agent_info/3,
- update_agent_info/3, update_agent_info/4,
+ register_agent/2,
+ unregister_agent/1,
+ agent_info/2,
+ update_agent_info/3,
which_all_agents/0, which_own_agents/0,
load_mib/1, unload_mib/1,
- sync_get/1, sync_get/2, sync_get/3, sync_get2/3,
- async_get/1, async_get/2, async_get/3, async_get2/3,
- sync_get_next/1, sync_get_next/2, sync_get_next/3, sync_get_next2/3,
- async_get_next/1, async_get_next/2, async_get_next/3, async_get_next2/3,
- sync_set/1, sync_set/2, sync_set/3, sync_set2/3,
- async_set/1, async_set/2, async_set/3, async_set2/3,
- sync_get_bulk/3, sync_get_bulk/4, sync_get_bulk/5, sync_get_bulk2/5,
- async_get_bulk/3, async_get_bulk/4, async_get_bulk/5, async_get_bulk2/5,
+ sync_get/1, sync_get/2, sync_get2/3,
+ async_get/1, async_get/2, async_get2/3,
+ sync_get_next/1, sync_get_next/2, sync_get_next2/3,
+ async_get_next/1, async_get_next/2, async_get_next2/3,
+ sync_set/1, sync_set/2, sync_set2/3,
+ async_set/1, async_set/2, async_set2/3,
+ sync_get_bulk/3, sync_get_bulk/4, sync_get_bulk2/5,
+ async_get_bulk/3, async_get_bulk/4, async_get_bulk2/5,
name_to_oid/1, oid_to_name/1,
purify_oid/1
]).
@@ -73,15 +74,11 @@
-export([
handle_error/3,
- handle_agent/4,
+ handle_agent/5,
handle_pdu/4,
handle_trap/3,
handle_inform/3,
- handle_report/3,
- handle_pdu/5, % For backwards compatibillity
- handle_trap/4, % For backwards compatibillity
- handle_inform/4, % For backwards compatibillity
- handle_report/4 % For backwards compatibillity
+ handle_report/3
]).
@@ -113,7 +110,18 @@ start_link(Parent, Id) ->
proc_lib:start_link(?MODULE, main, [true, Parent, self(), Id]).
stop() ->
- cast(stop).
+ MRef = erlang:monitor(process, ?SERVER),
+ cast(stop),
+ receive {'DOWN', MRef, _, _, Info} ->
+ case Info of
+ noproc ->
+ ok;
+ noconnection ->
+ ok;
+ normal ->
+ ok
+ end
+ end.
info() ->
call(info).
@@ -126,27 +134,16 @@ simulate_crash(Reason) ->
register_agent(TargetName, Config)
when is_list(TargetName) andalso is_list(Config) ->
- call({register_agent, TargetName, Config});
-register_agent(Addr, Port) ->
- register_agent(Addr, Port, []).
-
-register_agent(Addr, Port, Conf) ->
- call({register_agent, Addr, Port, Conf}).
+ call({register_agent, TargetName, Config}).
unregister_agent(TargetName) ->
call({unregister_agent, TargetName}).
-unregister_agent(Addr, Port) ->
- call({unregister_agent, Addr, Port}).
agent_info(TargetName, Item) ->
call({agent_info, TargetName, Item}).
-agent_info(Addr, Port, Item) ->
- call({agent_info, Addr, Port, Item}).
update_agent_info(TargetName, Item, Val) ->
call({update_agent_info, TargetName, Item, Val}).
-update_agent_info(Addr, Port, Item, Val) ->
- call({update_agent_info, Addr, Port, Item, Val}).
which_all_agents() ->
call(which_all_agents).
@@ -165,11 +162,8 @@ unload_mib(Mib) ->
sync_get(Oids) ->
call({sync_get, Oids}).
-sync_get(Addr_or_TargetName, Oids) ->
- call({sync_get, Addr_or_TargetName, Oids}).
-
-sync_get(Addr, Port, Oids) ->
- call({sync_get, Addr, Port, Oids}).
+sync_get(TargetName, Oids) ->
+ call({sync_get, TargetName, Oids}).
sync_get2(TargetName, Oids, SendOpts) ->
call({sync_get2, TargetName, Oids, SendOpts}).
@@ -180,11 +174,8 @@ sync_get2(TargetName, Oids, SendOpts) ->
async_get(Oids) ->
call({async_get, Oids}).
-async_get(Addr_or_TargetName, Oids) ->
- call({async_get, Addr_or_TargetName, Oids}).
-
-async_get(Addr, Port, Oids) ->
- call({async_get, Addr, Port, Oids}).
+async_get(TargetName, Oids) ->
+ call({async_get, TargetName, Oids}).
async_get2(TargetName, Oids, SendOpts) ->
call({async_get2, TargetName, Oids, SendOpts}).
@@ -194,11 +185,8 @@ async_get2(TargetName, Oids, SendOpts) ->
sync_get_next(Oids) ->
call({sync_get_next, Oids}).
-sync_get_next(Addr_or_TargetName, Oids) ->
- call({sync_get_next, Addr_or_TargetName, Oids}).
-
-sync_get_next(Addr, Port, Oids) ->
- call({sync_get_next, Addr, Port, Oids}).
+sync_get_next(TargetName, Oids) ->
+ call({sync_get_next, TargetName, Oids}).
sync_get_next2(TargetName, Oids, SendOpts) ->
call({sync_get_next2, TargetName, Oids, SendOpts}).
@@ -208,11 +196,8 @@ sync_get_next2(TargetName, Oids, SendOpts) ->
async_get_next(Oids) ->
call({async_get_next, Oids}).
-async_get_next(Addr_or_TargetName, Oids) ->
- call({async_get_next, Addr_or_TargetName, Oids}).
-
-async_get_next(Addr, Port, Oids) ->
- call({async_get_next, Addr, Port, Oids}).
+async_get_next(TargetName, Oids) ->
+ call({async_get_next, TargetName, Oids}).
async_get_next2(TargetName, Oids, SendOpts) ->
call({async_get_next2, TargetName, Oids, SendOpts}).
@@ -222,11 +207,8 @@ async_get_next2(TargetName, Oids, SendOpts) ->
sync_set(VAV) ->
call({sync_set, VAV}).
-sync_set(Addr_or_TargetName, VAV) ->
- call({sync_set, Addr_or_TargetName, VAV}).
-
-sync_set(Addr, Port, VAV) ->
- call({sync_set, Addr, Port, VAV}).
+sync_set(TargetName, VAV) ->
+ call({sync_set, TargetName, VAV}).
sync_set2(TargetName, VAV, SendOpts) ->
call({sync_set2, TargetName, VAV, SendOpts}).
@@ -236,11 +218,8 @@ sync_set2(TargetName, VAV, SendOpts) ->
async_set(VAV) ->
call({async_set, VAV}).
-async_set(Addr_or_TargetName, VAV) ->
- call({async_set, Addr_or_TargetName, VAV}).
-
-async_set(Addr, Port, VAV) ->
- call({async_set, Addr, Port, VAV}).
+async_set(TargetName, VAV) ->
+ call({async_set, TargetName, VAV}).
async_set2(TargetName, VAV, SendOpts) ->
call({async_set2, TargetName, VAV, SendOpts}).
@@ -250,11 +229,8 @@ async_set2(TargetName, VAV, SendOpts) ->
sync_get_bulk(NonRep, MaxRep, Oids) ->
call({sync_get_bulk, NonRep, MaxRep, Oids}).
-sync_get_bulk(Addr_or_TargetName, NonRep, MaxRep, Oids) ->
- call({sync_get_bulk, Addr_or_TargetName, NonRep, MaxRep, Oids}).
-
-sync_get_bulk(Addr, Port, NonRep, MaxRep, Oids) ->
- call({sync_get_bulk, Addr, Port, NonRep, MaxRep, Oids}).
+sync_get_bulk(TargetName, NonRep, MaxRep, Oids) ->
+ call({sync_get_bulk, TargetName, NonRep, MaxRep, Oids}).
sync_get_bulk2(TargetName, NonRep, MaxRep, Oids, SendOpts) ->
call({sync_get_bulk2, TargetName, NonRep, MaxRep, Oids, SendOpts}).
@@ -264,11 +240,8 @@ sync_get_bulk2(TargetName, NonRep, MaxRep, Oids, SendOpts) ->
async_get_bulk(NonRep, MaxRep, Oids) ->
call({async_get_bulk, NonRep, MaxRep, Oids}).
-async_get_bulk(Addr_or_TargetName, NonRep, MaxRep, Oids) ->
- call({async_get_bulk, Addr_or_TargetName, NonRep, MaxRep, Oids}).
-
-async_get_bulk(Addr, Port, NonRep, MaxRep, Oids) ->
- call({async_get_bulk, Addr, Port, NonRep, MaxRep, Oids}).
+async_get_bulk(TargetName, NonRep, MaxRep, Oids) ->
+ call({async_get_bulk, TargetName, NonRep, MaxRep, Oids}).
async_get_bulk2(TargetName, NonRep, MaxRep, Oids, SendOpts) ->
call({async_get_bulk2, TargetName, NonRep, MaxRep, Oids, SendOpts}).
@@ -340,24 +313,12 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{register_agent, Addr, Port, Conf}, From, Ref} ->
- d("loop -> received register_agent request"),
- Res = snmpm:register_agent(Id, Addr, Port, Conf),
- reply(From, Res, Ref),
- loop(S);
-
{{unregister_agent, TargetName}, From, Ref} ->
d("loop -> received unregister_agent request"),
Res = snmpm:unregister_agent(Id, TargetName),
reply(From, Res, Ref),
loop(S);
- {{unregister_agent, Addr, Port}, From, Ref} ->
- d("loop -> received unregister_agent request"),
- Res = snmpm:unregister_agent(Id, Addr, Port),
- reply(From, Res, Ref),
- loop(S);
-
{{agent_info, TargetName, Item}, From, Ref} ->
d("loop -> received agent_info request with"
"~n TargetName: ~p"
@@ -368,15 +329,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{agent_info, Addr, Port, Item}, From, Ref} ->
- d("loop -> received agent_info request with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Item: ~p", [Addr, Port, Item]),
- Res = snmpm:agent_info(Addr, Port, Item),
- reply(From, Res, Ref),
- loop(S);
-
{{update_agent_info, TargetName, Item, Val}, From, Ref} ->
d("loop -> received update_agent_info request with"
"~n TargetName: ~p"
@@ -386,16 +338,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{update_agent_info, Addr, Port, Item, Val}, From, Ref} ->
- d("loop -> received update_agent_info request with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Item: ~p"
- "~n Val: ~p", [Addr, Port, Item, Val]),
- Res = snmpm:update_agent_info(Id, Addr, Port, Item, Val),
- reply(From, Res, Ref),
- loop(S);
-
{which_all_agents, From, Ref} ->
d("loop -> received which_all_agents request"),
Res = snmpm:which_agents(),
@@ -452,23 +394,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{sync_get, Addr, Oids}, From, Ref} ->
- d("loop -> received sync_get request with"
- "~n Addr: ~p"
- "~n Oids: ~p", [Addr, Oids]),
- Res = snmpm:g(Id, Addr, Oids),
- reply(From, Res, Ref),
- loop(S);
-
- {{sync_get, Addr, Port, Oids}, From, Ref} ->
- d("loop -> received sync_get request with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n Oids: ~p", [Addr, Port, Oids]),
- Res = snmpm:g(Id, Addr, Port, Oids),
- reply(From, Res, Ref),
- loop(S);
-
%%
%% -- (async) get-request --
@@ -500,18 +425,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{async_get, Addr, Oids}, From, Ref} ->
- d("loop -> received async_get request"),
- Res = snmpm:ag(Id, Addr, Oids),
- reply(From, Res, Ref),
- loop(S);
-
- {{async_get, Addr, Port, Oids}, From, Ref} ->
- d("loop -> received async_get request"),
- Res = snmpm:ag(Id, Addr, Port, Oids),
- reply(From, Res, Ref),
- loop(S);
-
%%
%% -- (sync) get_next-request --
@@ -543,18 +456,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{sync_get_next, Addr, Oids}, From, Ref} ->
- d("loop -> received sync_get_next request"),
- Res = snmpm:gn(Id, Addr, Oids),
- reply(From, Res, Ref),
- loop(S);
-
- {{sync_get_next, Addr, Port, Oids}, From, Ref} ->
- d("loop -> received sync_get_next request"),
- Res = snmpm:gn(Id, Addr, Port, Oids),
- reply(From, Res, Ref),
- loop(S);
-
%%
%% -- (async) get_next-request --
@@ -586,18 +487,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{async_get_next, Addr, Oids}, From, Ref} ->
- d("loop -> received async_get_next request"),
- Res = snmpm:agn(Id, Addr, Oids),
- reply(From, Res, Ref),
- loop(S);
-
- {{async_get_next, Addr, Port, Oids}, From, Ref} ->
- d("loop -> received async_get_next request"),
- Res = snmpm:agn(Id, Addr, Port, Oids),
- reply(From, Res, Ref),
- loop(S);
-
%%
%% -- (sync) set-request --
@@ -626,18 +515,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{sync_set, Addr, VAV}, From, Ref} ->
- d("loop -> received sync_set request"),
- Res = snmpm:s(Id, Addr, VAV),
- reply(From, Res, Ref),
- loop(S);
-
- {{sync_set, Addr, Port, VAV}, From, Ref} ->
- d("loop -> received sync_set request"),
- Res = snmpm:s(Id, Addr, Port, VAV),
- reply(From, Res, Ref),
- loop(S);
-
%%
%% -- (async) set-request --
@@ -666,18 +543,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{async_set, Addr, VAV}, From, Ref} ->
- d("loop -> received async_set request"),
- Res = snmpm:as(Id, Addr, VAV),
- reply(From, Res, Ref),
- loop(S);
-
- {{async_set, Addr, Port, VAV}, From, Ref} ->
- d("loop -> received async_set request"),
- Res = snmpm:as(Id, Addr, Port, VAV),
- reply(From, Res, Ref),
- loop(S);
-
%%
%% -- (sync) get-bulk-request --
@@ -718,27 +583,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{sync_get_bulk, Addr, NonRep, MaxRep, Oids}, From, Ref} ->
- d("loop -> received sync_get_bulk request with"
- "~n Addr: ~p"
- "~n NonRep: ~w"
- "~n MaxRep: ~w"
- "~n Oids: ~p", [Addr, NonRep, MaxRep, Oids]),
- Res = snmpm:gb(Id, Addr, NonRep, MaxRep, Oids),
- reply(From, Res, Ref),
- loop(S);
-
- {{sync_get_bulk, Addr, Port, NonRep, MaxRep, Oids}, From, Ref} ->
- d("loop -> received sync_get_bulk request with"
- "~n Addr: ~p"
- "~n Port: ~w"
- "~n NonRep: ~w"
- "~n MaxRep: ~w"
- "~n Oids: ~p", [Addr, Port, NonRep, MaxRep, Oids]),
- Res = snmpm:gb(Id, Addr, Port, NonRep, MaxRep, Oids),
- reply(From, Res, Ref),
- loop(S);
-
%%
%% -- (async) get-bulk-request --
@@ -779,27 +623,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
reply(From, Res, Ref),
loop(S);
- {{async_get_bulk, Addr, NonRep, MaxRep, Oids}, From, Ref} ->
- d("loop -> received async_get_bulk request with"
- "~n Addr: ~p"
- "~n NonRep: ~w"
- "~n MaxRep: ~w"
- "~n Oids: ~p", [Addr, NonRep, MaxRep, Oids]),
- Res = snmpm:agb(Id, Addr, NonRep, MaxRep, Oids),
- reply(From, Res, Ref),
- loop(S);
-
- {{async_get_bulk, Addr, Port, NonRep, MaxRep, Oids}, From, Ref} ->
- d("loop -> received async_get_bulk request with"
- "~n Addr: ~p"
- "~n Port: ~w"
- "~n NonRep: ~w"
- "~n MaxRep: ~w"
- "~n Oids: ~p", [Addr, Port, NonRep, MaxRep, Oids]),
- Res = snmpm:agb(Id, Addr, Port, NonRep, MaxRep, Oids),
- reply(From, Res, Ref),
- loop(S);
-
%%
%% -- logical name translation --
@@ -846,12 +669,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
Parent ! {async_event, ReqId, {pdu, SnmpResponse}},
loop(S);
- %% For backwards compatibillity
- {handle_pdu, _Pid, _Addr, _Port, ReqId, SnmpResponse} ->
- d("loop -> received pdu callback from manager for ~w", [ReqId]),
- Parent ! {async_event, ReqId, {pdu, SnmpResponse}},
- loop(S);
-
{handle_trap, _Pid, TargetName, SnmpTrap} ->
d("loop -> received trap callback from manager for "
"~n ~p",
@@ -860,15 +677,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
Parent ! {async_event, TargetName, {trap, SnmpTrap}},
loop(S);
- %% For backwards compatibillity
- {handle_trap, _Pid, Addr, Port, SnmpTrap} ->
- d("loop -> received trap callback from manager for "
- "~n ~p:~w",
- "~n ~p",
- [Addr, Port, SnmpTrap]),
- Parent ! {async_event, {Addr, Port}, {trap, SnmpTrap}},
- loop(S);
-
{handle_inform, Pid, TargetName, SnmpInform} ->
d("loop -> received inform callback from manager for "
"~n ~p",
@@ -877,15 +685,6 @@ loop(#state{parent = Parent, id = Id} = S) ->
Parent ! {async_event, TargetName, {inform, Pid, SnmpInform}},
loop(S);
- %% For backwards compatibillity
- {handle_inform, Pid, Addr, Port, SnmpInform} ->
- d("loop -> received inform callback from manager for "
- "~n ~p:~w",
- "~n ~p",
- [Addr, Port, SnmpInform]),
- Parent ! {async_event, {Addr, Port}, {inform, Pid, SnmpInform}},
- loop(S);
-
{handle_report, _Pid, TargetName, SnmpReport} ->
d("loop -> received report callback from manager for "
"~n ~p",
@@ -894,13 +693,13 @@ loop(#state{parent = Parent, id = Id} = S) ->
Parent ! {async_event, TargetName, {report, SnmpReport}},
loop(S);
- %% For backwards compatibillity
- {handle_report, _Pid, Addr, Port, SnmpReport} ->
- d("loop -> received report callback from manager for "
- "~n ~p:~w",
- "~n ~p",
- [Addr, Port, SnmpReport]),
- Parent ! {async_event, {Addr, Port}, {report, SnmpReport}},
+ {handle_invalid_result, _Pid, In, Out} ->
+ d("loop -> received invalid result callback from manager for "
+ "~n In: ~p",
+ "~n Out: ~p", [In, Out]),
+ info("received invalid result message: "
+ "~n In: ~p"
+ "~n Out: ~p", [In, Out]),
loop(S);
{'EXIT', Parent, Reason} ->
@@ -981,8 +780,8 @@ handle_error(ReqId, Reason, UserPid) ->
ignore.
-handle_agent(Addr, Port, SnmpInfo, UserPid) ->
- UserPid ! {handle_agent, self(), Addr, Port, SnmpInfo},
+handle_agent(Addr, Port, SnmpInfo, UserPid, UserData) ->
+ UserPid ! {handle_agent, self(), Addr, Port, SnmpInfo, UserData},
ignore.
@@ -990,21 +789,9 @@ handle_pdu(TargetName, ReqId, SnmpResponse, UserPid) ->
UserPid ! {handle_pdu, self(), TargetName, ReqId, SnmpResponse},
ignore.
-%% For backwards compatibillity
-handle_pdu(Addr, Port, ReqId, SnmpResponse, UserPid) ->
- UserPid ! {handle_pdu, self(), Addr, Port, ReqId, SnmpResponse},
- ignore.
-
-
handle_trap(TargetName, SnmpTrap, UserPid) ->
UserPid ! {handle_trap, self(), TargetName, SnmpTrap},
- ok.
-
-%% For backwards compatibillity
-handle_trap(Addr, Port, SnmpTrap, UserPid) ->
- UserPid ! {handle_trap, self(), Addr, Port, SnmpTrap},
- ok.
-
+ ignore.
handle_inform(TargetName, SnmpInform, UserPid) ->
UserPid ! {handle_inform, self(), TargetName, SnmpInform},
@@ -1012,28 +799,12 @@ handle_inform(TargetName, SnmpInform, UserPid) ->
{handle_inform_no_response, TargetName} ->
no_reply;
{handle_inform_response, TargetName} ->
- ok
- end.
-
-%% For backwards compatibillity
-handle_inform(Addr, Port, SnmpInform, UserPid) ->
- UserPid ! {handle_inform, self(), Addr, Port, SnmpInform},
- receive
- {handle_inform_no_response, {Addr, Port}} ->
- no_reply;
- {handle_inform_response, {Addr, Port}} ->
- ok
+ ignore
end.
-
handle_report(TargetName, SnmpReport, UserPid) ->
UserPid ! {handle_report, self(), TargetName, SnmpReport},
- ok.
-
-%% For backwards compatibillity
-handle_report(Addr, Port, SnmpReport, UserPid) ->
- UserPid ! {handle_report, self(), Addr, Port, SnmpReport},
- ok.
+ ignore.
%%----------------------------------------------------------------------
diff --git a/lib/snmp/test/snmp_manager_user_old.erl b/lib/snmp/test/snmp_manager_user_old.erl
index 6280cef51f..51b55da2e6 100644
--- a/lib/snmp/test/snmp_manager_user_old.erl
+++ b/lib/snmp/test/snmp_manager_user_old.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -29,7 +30,7 @@
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include("test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
@@ -107,10 +108,20 @@ unregister_agent(Addr, Port) ->
snmpm:unregister_agent(?USER_ID, Addr, Port).
agent_info(Addr, Port, Item) ->
- snmpm:agent_info(?USER_ID, Addr, Port, Item).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:agent_info(TargetName, Item);
+ Error ->
+ Error
+ end.
update_agent_info(Addr, Port, Item, Val) ->
- snmpm:update_agent_info(?USER_ID, Addr, Port, Item, Val).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:update_agent_info(?USER_ID, TargetName, Item, Val);
+ Error ->
+ Error
+ end.
which_agents() ->
snmpm:which_agents().
@@ -128,73 +139,153 @@ unload_mib(Mib) ->
%% --
sync_get(Addr, Oids) ->
- snmpm:g(?USER_ID, Addr, Oids).
+ case snmpm:target_name(Addr) of
+ {ok, TargetName} ->
+ snmpm:sync_get2(?USER_ID, TargetName, Oids);
+ Error ->
+ Error
+ end.
sync_get(Addr, Port, Oids) ->
- snmpm:g(?USER_ID, Addr, Port, Oids).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:sync_get2(?USER_ID, TargetName, Oids);
+ Error ->
+ Error
+ end.
%% --
async_get(Addr, Oids) ->
- snmpm:ag(?USER_ID, Addr, Oids).
+ case snmpm:target_name(Addr) of
+ {ok, TargetName} ->
+ snmpm:async_get2(?USER_ID, TargetName, Oids);
+ Error ->
+ Error
+ end.
async_get(Addr, Port, Oids) ->
- snmpm:ag(?USER_ID, Addr, Port, Oids).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:async_get2(?USER_ID, TargetName, Oids);
+ Error ->
+ Error
+ end.
%% --
sync_get_next(Addr, Oids) ->
- snmpm:gn(?USER_ID, Addr, Oids).
+ case snmpm:target_name(Addr) of
+ {ok, TargetName} ->
+ snmpm:sync_get_next2(?USER_ID, TargetName, Oids);
+ Error ->
+ Error
+ end.
sync_get_next(Addr, Port, Oids) ->
- snmpm:gn(?USER_ID, Addr, Port, Oids).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:sync_get_next2(?USER_ID, TargetName, Oids);
+ Error ->
+ Error
+ end.
%% --
async_get_next(Addr, Oids) ->
- snmpm:agn(?USER_ID, Addr, Oids).
+ case snmpm:target_name(Addr) of
+ {ok, TargetName} ->
+ snmpm:async_get_next2(?USER_ID, TargetName, Oids);
+ Error ->
+ Error
+ end.
async_get_next(Addr, Port, Oids) ->
- snmpm:agn(?USER_ID, Addr, Port, Oids).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:async_get_next2(?USER_ID, TargetName, Oids);
+ Error ->
+ Error
+ end.
%% --
sync_set(Addr, VAV) ->
- snmpm:s(?USER_ID, Addr, VAV).
+ case snmpm:target_name(Addr) of
+ {ok, TargetName} ->
+ snmpm:sync_set2(?USER_ID, TargetName, VAV);
+ Error ->
+ Error
+ end.
sync_set(Addr, Port, VAV) ->
- snmpm:s(?USER_ID, Addr, Port, VAV).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:sync_set2(?USER_ID, TargetName, VAV);
+ Error ->
+ Error
+ end.
%% --
async_set(Addr, VAV) ->
- snmpm:as(?USER_ID, Addr, VAV).
+ case snmpm:target_name(Addr) of
+ {ok, TargetName} ->
+ snmpm:async_set2(?USER_ID, TargetName, VAV);
+ Error ->
+ Error
+ end.
async_set(Addr, Port, VAV) ->
- snmpm:as(?USER_ID, Addr, Port, VAV).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:async_set2(?USER_ID, TargetName, VAV);
+ Error ->
+ Error
+ end.
%% --
sync_get_bulk(Addr, NonRep, MaxRep, Oids) ->
- snmpm:gb(?USER_ID, Addr, NonRep, MaxRep, Oids).
+ case snmpm:target_name(Addr) of
+ {ok, TargetName} ->
+ snmpm:sync_get_bulk2(?USER_ID, TargetName, NonRep, MaxRep, Oids);
+ Error ->
+ Error
+ end.
sync_get_bulk(Addr, Port, NonRep, MaxRep, Oids) ->
- snmpm:gb(?USER_ID, Addr, Port, NonRep, MaxRep, Oids).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:sync_get_bulk2(?USER_ID, TargetName, NonRep, MaxRep, Oids);
+ Error ->
+ Error
+ end.
%% --
async_get_bulk(Addr, NonRep, MaxRep, Oids) ->
- snmpm:agb(?USER_ID, Addr, NonRep, MaxRep, Oids).
+ case snmpm:target_name(Addr) of
+ {ok, TargetName} ->
+ snmpm:async_get_bulk2(?USER_ID, TargetName, NonRep, MaxRep, Oids);
+ Error ->
+ Error
+ end.
async_get_bulk(Addr, Port, NonRep, MaxRep, Oids) ->
- snmpm:agb(?USER_ID, Addr, Port, NonRep, MaxRep, Oids).
+ case snmpm:target_name(Addr, Port) of
+ {ok, TargetName} ->
+ snmpm:async_get_bulk2(?USER_ID, TargetName, NonRep, MaxRep, Oids);
+ Error ->
+ Error
+ end.
%% --
diff --git a/lib/snmp/test/snmp_manager_user_test.erl b/lib/snmp/test/snmp_manager_user_test.erl
index fefa1ad713..915249ec77 100644
--- a/lib/snmp/test/snmp_manager_user_test.erl
+++ b/lib/snmp/test/snmp_manager_user_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -26,7 +27,7 @@
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
@@ -36,7 +37,7 @@
%% -compile(export_all).
-export([
-all/0,groups/0,init_per_group/2,end_per_group/2,
+ all/0,groups/0,init_per_group/2,end_per_group/2,
init_per_testcase/2, end_per_testcase/2,
diff --git a/lib/snmp/test/snmp_manager_user_test_lib.erl b/lib/snmp/test/snmp_manager_user_test_lib.erl
index bf8fff7c4c..8df7f1e662 100644
--- a/lib/snmp/test/snmp_manager_user_test_lib.erl
+++ b/lib/snmp/test/snmp_manager_user_test_lib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -29,7 +30,7 @@
%%----------------------------------------------------------------------
%% Include files
%%----------------------------------------------------------------------
--include("test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-include("snmp_test_lib.hrl").
diff --git a/lib/snmp/test/snmp_note_store_test.erl b/lib/snmp/test/snmp_note_store_test.erl
index 24ba88f986..94d400fb53 100644
--- a/lib/snmp/test/snmp_note_store_test.erl
+++ b/lib/snmp/test/snmp_note_store_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/test/snmp_pdus_test.erl b/lib/snmp/test/snmp_pdus_test.erl
index 7d649b1dad..29a793ebcb 100644
--- a/lib/snmp/test/snmp_pdus_test.erl
+++ b/lib/snmp/test/snmp_pdus_test.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/test/snmp_test_data/.gitignore b/lib/snmp/test/snmp_test_data/.gitignore
new file mode 100644
index 0000000000..c7cffa7f6d
--- /dev/null
+++ b/lib/snmp/test/snmp_test_data/.gitignore
@@ -0,0 +1,2 @@
+*.bin
+*.hrl
diff --git a/lib/snmp/test/snmp_test_data/OTP14145-MIB.mib b/lib/snmp/test/snmp_test_data/OTP14145-MIB.mib
new file mode 100644
index 0000000000..f29c65c4c2
--- /dev/null
+++ b/lib/snmp/test/snmp_test_data/OTP14145-MIB.mib
@@ -0,0 +1,44 @@
+OTP14145-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE,
+ mib-2 FROM SNMPv2-SMI
+ InetAddressType, InetAddress FROM INET-ADDRESS-MIB
+ MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF;
+
+testMibId MODULE-IDENTITY
+ LAST-UPDATED "200608210000Z" -- 21 August 2006
+ ORGANIZATION "a"
+ CONTACT-INFO "a"
+ DESCRIPTION "a"
+ REVISION "200608210000Z" -- 21 August 2006
+ DESCRIPTION "a"
+ ::= { mib-2 67 }
+
+testObj OBJECT-TYPE
+ SYNTAX InetAddressType
+ -- SYNTAX InetAddress
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "a"
+ ::= { testMibId 2 }
+
+testObjId OBJECT IDENTIFIER ::= { testMibId 3 }
+
+testMibCompliance MODULE-COMPLIANCE
+ STATUS current
+ DESCRIPTION "a"
+ MODULE
+ OBJECT testObj
+ SYNTAX InetAddressType { ipv4(1), ipv6(2) }
+ -- SYNTAX InetAddress ( SIZE(4|16) )
+ DESCRIPTION "a"
+ ::= { testMibId 4 }
+
+testObjGroup OBJECT-GROUP
+ OBJECTS { testObj }
+ STATUS current
+ DESCRIPTION "a"
+ ::= { testObjId 1 }
+
+END
diff --git a/lib/snmp/test/snmp_test_lib.erl b/lib/snmp/test/snmp_test_lib.erl
index 26115a0c74..290f1bc31a 100644
--- a/lib/snmp/test/snmp_test_lib.erl
+++ b/lib/snmp/test/snmp_test_lib.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -22,7 +23,7 @@
-include_lib("kernel/include/file.hrl").
--export([hostname/0, hostname/1, localhost/0, os_type/0, sz/1,
+-export([hostname/0, hostname/1, localhost/0, localhost/1, os_type/0, sz/1,
display_suite_info/1]).
-export([non_pc_tc_maybe_skip/4, os_based_skip/1]).
-export([fix_data_dir/1,
@@ -30,7 +31,7 @@
lookup/2,
replace_config/3, set_config/3, get_config/2, get_config/3]).
-export([fail/3, skip/3]).
--export([millis/0, millis_diff/2, hours/1, minutes/1, seconds/1, sleep/1]).
+-export([hours/1, minutes/1, seconds/1, sleep/1]).
-export([flush_mqueue/0, trap_exit/0, trap_exit/1]).
-export([ping/1, local_nodes/0, nodes_on/1]).
-export([start_node/2]).
@@ -60,6 +61,9 @@ from(_H, []) -> [].
localhost() ->
{ok, Ip} = snmp_misc:ip(net_adm:localhost()),
Ip.
+localhost(Family) ->
+ {ok, Ip} = snmp_misc:ip(net_adm:localhost(), Family),
+ Ip.
sz(L) when is_list(L) ->
length(L);
@@ -324,21 +328,13 @@ fail(Reason, Mod, Line) ->
skip(Reason, Module, Line) ->
String = lists:flatten(io_lib:format("Skipping ~p(~p): ~p~n",
[Module, Line, Reason])),
- exit({skipped, String}).
+ exit({skip, String}).
%% ----------------------------------------------------------------
%% Time related function
%%
-millis() ->
- erlang:now().
-
-millis_diff(A,B) ->
- T1 = (element(1,A)*1000000) + element(2,A) + (element(3,A)/1000000),
- T2 = (element(1,B)*1000000) + element(2,B) + (element(3,B)/1000000),
- T1 - T2.
-
hours(N) -> trunc(N * 1000 * 60 * 60).
minutes(N) -> trunc(N * 1000 * 60).
seconds(N) -> trunc(N * 1000).
@@ -435,7 +431,7 @@ crypto_start() ->
end.
crypto_support() ->
- crypto_support([md5_mac_96, sha_mac_96], []).
+ crypto_support([md5, sha], []).
crypto_support([], []) ->
yes;
@@ -450,12 +446,7 @@ crypto_support([Func|Funcs], Acc) ->
end.
is_crypto_supported(Func) ->
- %% The 'catch' handles the case when 'crypto' is
- %% not present in the system (or not started).
- case (catch lists:member(Func, crypto:info())) of
- true -> true;
- _ -> false
- end.
+ snmp_misc:is_crypto_supported(Func).
%% ----------------------------------------------------------------
@@ -516,8 +507,6 @@ warning_msg(F, A) ->
timeout(T) ->
trunc(timeout(T, os:type())).
-timeout(T, vxworks) ->
- 5 * T * timetrap_scale_factor();
timeout(T, _) ->
T * timetrap_scale_factor().
@@ -632,4 +621,3 @@ format_timestamp({_N1, _N2, N3} = Now) ->
io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w ~w",
[YYYY,MM,DD,Hour,Min,Sec,round(N3/1000)]),
lists:flatten(FormatDate).
-
diff --git a/lib/snmp/test/snmp_test_lib.hrl b/lib/snmp/test/snmp_test_lib.hrl
index 8cc3f75dc5..7acebee1f1 100644
--- a/lib/snmp/test/snmp_test_lib.hrl
+++ b/lib/snmp/test/snmp_test_lib.hrl
@@ -1,21 +1,22 @@
-%%<copyright>
-%% <year>2002-2008</year>
-%% <holder>Ericsson AB, All Rights Reserved</holder>
-%%</copyright>
-%%<legalnotice>
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2002-2015. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% The Initial Developer of the Original Code is Ericsson AB.
-%%</legalnotice>
+%% %CopyrightEnd%
%%
%%----------------------------------------------------------------------
%% Purpose: Define common macros for testing
@@ -32,14 +33,15 @@
-define(APPLICATION, snmp).
-endif.
--define(SCONF(K,D,C), snmp_test_lib:set_config(K,D,C)).
--define(GCONF(K,C), snmp_test_lib:get_config(K,C)).
--define(RCONF(K,C,V), snmp_test_lib:replace_config(K,C,V)).
--define(HOSTNAME(N), snmp_test_lib:hostname(N)).
--define(LOCALHOST(), snmp_test_lib:localhost()).
--define(SZ(X), snmp_test_lib:sz(X)).
--define(OSTYPE(), snmp_test_lib:os_type()).
--define(DISPLAY_SUITE_INFO(), snmp_test_lib:display_suite_info(?MODULE)).
+-define(SCONF(K,D,C), snmp_test_lib:set_config(K,D,C)).
+-define(GCONF(K,C), snmp_test_lib:get_config(K,C)).
+-define(RCONF(K,C,V), snmp_test_lib:replace_config(K,C,V)).
+-define(HOSTNAME(N), snmp_test_lib:hostname(N)).
+-define(LOCALHOST(), snmp_test_lib:localhost()).
+-define(LOCALHOST(Family), snmp_test_lib:localhost(Family)).
+-define(SZ(X), snmp_test_lib:sz(X)).
+-define(OSTYPE(), snmp_test_lib:os_type()).
+-define(DISPLAY_SUITE_INFO(), snmp_test_lib:display_suite_info(?MODULE)).
%% - Test case macros -
@@ -72,8 +74,6 @@
-endif.
-define(SLEEP(MSEC), snmp_test_lib:sleep(MSEC)).
--define(M(), snmp_test_lib:millis()).
--define(MDIFF(A,B), snmp_test_lib:millis_diff(A,B)).
%% - Process utility macros -
@@ -148,4 +148,3 @@
-define(PRINT(P,F,A),
snmp_test_lib:print(P,?MODULE,?LINE,F,A)).
-
diff --git a/lib/snmp/test/snmp_test_manager.erl b/lib/snmp/test/snmp_test_manager.erl
index 4cc6d36acc..6ab5ce164c 100644
--- a/lib/snmp/test/snmp_test_manager.erl
+++ b/lib/snmp/test/snmp_test_manager.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -43,11 +44,12 @@
%% Manager callback API:
-export([
handle_error/3,
- handle_agent/4,
+ handle_agent/5,
handle_pdu/4,
handle_trap/3,
handle_inform/3,
- handle_report/3
+ handle_report/3,
+ handle_invalid_result/3
]).
@@ -55,7 +57,7 @@
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
code_change/3, terminate/2]).
--record(state, {mgr, parent, req, agent_target_name}).
+-record(state, {parent, req, agent_target_name}).
-define(SERVER, ?MODULE).
-define(USER, ?MODULE).
@@ -129,10 +131,10 @@ init([Parent, Opts]) ->
do_init(Opts) ->
{MgrDir, MgrConf, MgrOpts, AgentTargetName, AgentConf} = parse_opts(Opts),
ok = snmp_config:write_manager_config(MgrDir, "", MgrConf),
- {ok, Pid} = snmpm:start_link(MgrOpts),
+ ok = snmpm:start_link(MgrOpts),
ok = snmpm:register_user(?USER, ?MODULE, self()),
ok = snmpm:register_agent(?USER, AgentTargetName, AgentConf),
- {ok, #state{mgr = Pid, agent_target_name = AgentTargetName}}.
+ {ok, #state{agent_target_name = AgentTargetName}}.
parse_opts(Opts) ->
@@ -239,7 +241,7 @@ handle_info({snmp_error, ReqId, Reason},
P ! {snmp_error, ReqId, Reason},
{noreply, State};
-handle_info({snmp_agent, Addr, Port, Info, Pid},
+handle_info({snmp_agent, Addr, Port, Info, Pid, _UserData},
#state{parent = P} = State) ->
error_msg("detected new agent: "
"~n Addr: ~w"
@@ -279,12 +281,18 @@ handle_info({snmp_inform, TargetName, Info, Pid},
handle_info({snmp_report, TargetName, Info, Pid},
#state{parent = P} = State) ->
info_msg("received snmp report: "
- "~n TargetName: ~p"
- "~n Info: ~p", [TargetName, Info]),
+ "~n TargetName: ~p"
+ "~n Info: ~p", [TargetName, Info]),
Pid ! {snmp_report_reply, ignore, self()},
P ! {snmp_report, TargetName, Info},
{noreply, State};
+handle_info({snmp_invalid_result, In, Out}, State) ->
+ error_msg("Callback failure: "
+ "~n In: ~p"
+ "~n Out: ~p", [In, Out]),
+ {noreply, State};
+
handle_info(Info, State) ->
error_msg("received unknown info: "
"~n Info: ~p", [Info]),
@@ -326,8 +334,8 @@ handle_error(ReqId, Reason, Pid) ->
ignore.
-handle_agent(Addr, Port, SnmpInfo, Pid) ->
- Pid ! {snmp_agent, Addr, Port, SnmpInfo, self()},
+handle_agent(Addr, Port, SnmpInfo, Pid, UserData) ->
+ Pid ! {snmp_agent, Addr, Port, SnmpInfo, self(), UserData},
receive
{snmp_agent_reply, Reply, Pid} ->
Reply
@@ -369,7 +377,12 @@ handle_report(TargetName, SnmpInfo, Pid) ->
after 10000 ->
ignore
end.
-
+
+
+handle_invalid_result(In, Out, Pid) ->
+ Pid ! {snmp_invalid_result, In, Out},
+ ignore.
+
%%----------------------------------------------------------------------
diff --git a/lib/snmp/test/snmp_test_mgr.erl b/lib/snmp/test/snmp_test_mgr.erl
index 499cf7abcf..36637d5cf4 100644
--- a/lib/snmp/test/snmp_test_mgr.erl
+++ b/lib/snmp/test/snmp_test_mgr.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -161,8 +162,7 @@ get_timeout() ->
get_timeout(os:type())
end.
-get_timeout(vxworks) -> 7000;
-get_timeout(_) -> 3500.
+get_timeout(_) -> 10000. % Trying to improve test results % 3500.
%%----------------------------------------------------------------------
%% Receives a trap from the agent.
@@ -189,8 +189,9 @@ receive_trap(Timeout) ->
init({Options, CallerPid}) ->
put(sname, mgr),
put(verbosity, debug),
- {A1,A2,A3} = erlang:now(),
- random:seed(A1,A2,A3),
+ random:seed(erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()),
case (catch is_options_ok(Options)) of
true ->
put(debug, get_value(debug, Options, false)),
@@ -236,21 +237,23 @@ init({Options, CallerPid}) ->
VsnHdrD =
{Com, User, EngineId, CtxEngineId, mk_seclevel(SecLevel)},
io:format("[~w] ~p -> VsnHdrD: ~p~n", [?MODULE, self(), VsnHdrD]),
+ IpFamily = get_value(ipfamily, Options, inet),
+ io:format("[~w] ~p -> IpFamily: ~p~n", [?MODULE, self(), IpFamily]),
AgIp = case snmp_misc:assq(agent, Options) of
{value, Tuple4} when is_tuple(Tuple4) andalso
(size(Tuple4) =:= 4) ->
Tuple4;
{value, Host} when is_list(Host) ->
- {ok, Ip} = snmp_misc:ip(Host),
+ {ok, Ip} = snmp_misc:ip(Host, IpFamily),
Ip
end,
io:format("[~w] ~p -> AgIp: ~p~n", [?MODULE, self(), AgIp]),
Quiet = lists:member(quiet, Options),
io:format("[~w] ~p -> Quiet: ~p~n", [?MODULE, self(), Quiet]),
- PackServ = start_packet_server(Quiet, Options, CallerPid,
- AgIp, Udp, TrapUdp,
- VsnHdrD, Version, Dir, RecBufSz,
- PacksDbg),
+ PackServ =
+ start_packet_server(
+ Quiet, Options, CallerPid, AgIp, Udp, TrapUdp,
+ VsnHdrD, Version, Dir, RecBufSz, PacksDbg, IpFamily),
d("init -> packet server: ~p",[PackServ]),
State = #state{parent = CallerPid,
quiet = Quiet,
@@ -264,23 +267,21 @@ init({Options, CallerPid}) ->
end.
start_packet_server(false, _Options, _CallerPid, AgIp, Udp, TrapUdp,
- VsnHdrD, Version, Dir, RecBufSz, PacksDbg) ->
+ VsnHdrD, Version, Dir, RecBufSz, PacksDbg, IpFamily) ->
d("start_packet_server -> entry", []),
- ?PACK_SERV:start_link_packet({msg, self()},
- AgIp, Udp, TrapUdp,
- VsnHdrD, Version, Dir, RecBufSz,
- PacksDbg);
+ ?PACK_SERV:start_link_packet(
+ {msg, self()}, AgIp, Udp, TrapUdp,
+ VsnHdrD, Version, Dir, RecBufSz, PacksDbg, IpFamily);
start_packet_server(true, Options, CallerPid, AgIp, Udp, TrapUdp,
- VsnHdrD, Version, Dir, RecBufSz, PacksDbg) ->
+ VsnHdrD, Version, Dir, RecBufSz, PacksDbg, IpFamily) ->
Type = get_value(receive_type, Options, pdu),
d("start_packet_server -> entry with"
"~n CallerPid: ~p"
"~n when"
"~n Type: ~p",[CallerPid, Type]),
- ?PACK_SERV:start_link_packet({Type, CallerPid},
- AgIp, Udp, TrapUdp,
- VsnHdrD, Version, Dir, RecBufSz,
- PacksDbg).
+ ?PACK_SERV:start_link_packet(
+ {Type, CallerPid}, AgIp, Udp, TrapUdp,
+ VsnHdrD, Version, Dir, RecBufSz, PacksDbg, IpFamily).
is_options_ok([{mibs,List}|Opts]) when is_list(List) ->
is_options_ok(Opts);
@@ -288,6 +289,10 @@ is_options_ok([quiet|Opts]) ->
is_options_ok(Opts);
is_options_ok([{agent,_}|Opts]) ->
is_options_ok(Opts);
+is_options_ok([{ipfamily,IpFamily}|Opts])
+ when IpFamily =:= inet;
+ IpFamily =:= inet6 ->
+ is_options_ok(Opts);
is_options_ok([{agent_udp,Int}|Opts]) when is_integer(Int) ->
is_options_ok(Opts);
is_options_ok([{trap_udp,Int}|Opts]) when is_integer(Int) ->
@@ -658,7 +663,8 @@ make_vb(Oid) ->
#varbind{oid = Oid, variabletype = 'NULL', value = 'NULL'}.
make_request_id() ->
- random:uniform(16#FFFFFFF-1).
+ %% random:uniform(16#FFFFFFF-1).
+ snmp_test_mgr_counter_server:increment(mgr_request_id, 1, 1, 2147483647).
echo_pdu(PDU, MiniMIB) ->
io:format("~s", [snmp_misc:format_pdu(PDU, MiniMIB)]).
@@ -1131,4 +1137,3 @@ d(_,_F,_A) ->
formated_timestamp() ->
snmp_test_lib:formated_timestamp().
-
diff --git a/lib/snmp/test/snmp_test_mgr_counter_server.erl b/lib/snmp/test/snmp_test_mgr_counter_server.erl
new file mode 100644
index 0000000000..697afdf799
--- /dev/null
+++ b/lib/snmp/test/snmp_test_mgr_counter_server.erl
@@ -0,0 +1,153 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+%% The reason for this (test) counter server is that the
+%% agent test suite is implemented in such a way that the
+%% agent is started once and then used for several test cases.
+%% Each request is given a request id which *was* generated using
+%% random! It is therefor possible, although unlikely, that a
+%% request may get a request id that has recently been used,
+%% which will cause the agent to silently reject the request.
+%% For this reason, we start this server at the start of the
+%% agent suite and stop it at the end and all request ids are
+%% generated by this server.
+%%
+
+-module(snmp_test_mgr_counter_server).
+
+-export([start/0, stop/0, increment/4]).
+
+-define(SERVER, ?MODULE).
+-define(TAB, snmp_test_mgr_counter_tab).
+
+
+%%%-------------------------------------------------------------------
+%%% API
+%%%-------------------------------------------------------------------
+
+-spec start() -> ok.
+
+start() ->
+ Parent = self(),
+ ReqIdServer = spawn(fun() -> init(Parent) end),
+ receive
+ {ReqIdServer, ok} ->
+ ok;
+ {ReqIdServer, {error, Reason}} ->
+ exit({failed_starting_counter_server, Reason})
+ after 5000 ->
+ exit(ReqIdServer, kill), % Cleanup, just in case
+ exit({failed_starting_counter_server, timeout})
+ end.
+
+-spec stop() -> {ok, Counters :: list()} | {error, Reason :: term()}.
+
+stop() ->
+ request(stop).
+
+
+-spec increment(Counter :: atom(),
+ Initial :: non_neg_integer(),
+ Increment :: pos_integer(),
+ Max :: pos_integer()) ->
+ Next :: pos_integer().
+
+increment(Counter, Initial, Increment, Max) ->
+ Request = {increment, Counter, Initial, Increment, Max},
+ case request(Request) of
+ {ok, ReqId} ->
+ ReqId;
+ {error, Reason} ->
+ exit(Reason)
+ end.
+
+
+request(Request) ->
+ Id = make_ref(),
+ Msg = {self(), Id, Request},
+ try
+ begin
+ global:send(?SERVER, Msg),
+ receive
+ {reply, Id, Reply} ->
+ {ok, Reply}
+ end
+ end
+ catch
+ T:E ->
+ {error, {T, E}}
+ end.
+
+
+%%%-------------------------------------------------------------------
+%%% Internal functions
+%%%-------------------------------------------------------------------
+
+init(Parent) ->
+ p("starting"),
+ case global:register_name(?SERVER, self()) of
+ yes ->
+ p("name registration ok"),
+ Parent ! {self(), ok};
+ no ->
+ p("name registration failed"),
+ Parent ! {self(), registration_failed},
+ exit(registration_failed)
+ end,
+ ets:new(?TAB, [set, named_table, {keypos, 1}]),
+ loop().
+
+loop() ->
+ receive
+ {From, Id, {increment, Counter, Initial, Increment, Max}} ->
+ Position = 2,
+ Threshold = Max,
+ SetValue = Initial,
+ UpdateOp = {Position, Increment, Threshold, SetValue},
+ NextVal =
+ try ets:update_counter(?TAB, Counter, UpdateOp) of
+ Next when is_integer(Next) ->
+ p("increment ~w: (next) ~w", [Counter, Next]),
+ Next
+ catch
+ error:badarg ->
+ %% Oups, first time
+ p("increment ~w: (initial) ~w", [Counter, Initial]),
+ ets:insert(?TAB, {Counter, Initial}),
+ Initial
+ end,
+ From ! {reply, Id, NextVal},
+ loop();
+
+ {From, Id, stop} ->
+ p("stop"),
+ Counters = ets:tab2list(?TAB),
+ From ! {reply, Id, Counters},
+ exit(normal)
+ end.
+
+
+p(F) ->
+ p(F, []).
+
+p(F, A) ->
+ io:format("*** [~s] COUNTER-SERVER [~w] " ++ F ++ "~n",
+ [snmp_test_lib:formated_timestamp(), self() | A]).
diff --git a/lib/snmp/test/snmp_test_mgr_misc.erl b/lib/snmp/test/snmp_test_mgr_misc.erl
index 5525c5c3ec..274fb5be26 100644
--- a/lib/snmp/test/snmp_test_mgr_misc.erl
+++ b/lib/snmp/test/snmp_test_mgr_misc.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -23,7 +24,7 @@
-module(snmp_test_mgr_misc).
%% API
--export([start_link_packet/8, start_link_packet/9,
+-export([start_link_packet/8, start_link_packet/9, start_link_packet/10,
stop/1,
send_discovery_pdu/2,
send_pdu/2, send_msg/4, send_bytes/2,
@@ -31,7 +32,7 @@
get_pdu/1, set_pdu/2, format_hdr/1]).
%% internal exports
--export([init_packet/10]).
+-export([init_packet/11]).
-compile({no_auto_import, [error/2]}).
@@ -42,22 +43,26 @@
%%----------------------------------------------------------------------
%% The InHandler process will receive messages on the form {snmp_pdu, Pdu}.
%%----------------------------------------------------------------------
-start_link_packet(InHandler,
- AgentIp, UdpPort, TrapUdp,
- VsnHdr, Version, Dir, BufSz) ->
- start_link_packet(InHandler,
- AgentIp, UdpPort, TrapUdp,
- VsnHdr, Version, Dir, BufSz,
- false).
-
-start_link_packet(InHandler,
- AgentIp, UdpPort, TrapUdp,
- VsnHdr, Version, Dir, BufSz,
- Dbg) when is_integer(UdpPort) ->
- Args = [self(), InHandler,
- AgentIp, UdpPort, TrapUdp,
- VsnHdr, Version, Dir, BufSz,
- Dbg],
+start_link_packet(
+ InHandler, AgentIp, UdpPort, TrapUdp, VsnHdr, Version, Dir, BufSz) ->
+ start_link_packet(
+ InHandler, AgentIp, UdpPort, TrapUdp, VsnHdr, Version, Dir, BufSz,
+ false).
+
+start_link_packet(
+ InHandler, AgentIp, UdpPort, TrapUdp, VsnHdr, Version, Dir, BufSz,
+ Dbg) ->
+ start_link_packet(
+ InHandler, AgentIp, UdpPort, TrapUdp, VsnHdr, Version, Dir, BufSz,
+ Dbg, inet).
+
+start_link_packet(
+ InHandler, AgentIp, UdpPort, TrapUdp, VsnHdr, Version, Dir, BufSz,
+ Dbg, IpFamily) when is_integer(UdpPort) ->
+ Args =
+ [self(),
+ InHandler, AgentIp, UdpPort, TrapUdp, VsnHdr, Version, Dir, BufSz,
+ Dbg, IpFamily],
proc_lib:start_link(?MODULE, init_packet, Args).
stop(Pid) ->
@@ -90,12 +95,14 @@ send_bytes(Bytes, PacketPid) ->
%%--------------------------------------------------
%% The SNMP encode/decode process
%%--------------------------------------------------
-init_packet(Parent, SnmpMgr,
- AgentIp, UdpPort, TrapUdp,
- VsnHdr, Version, Dir, BufSz, DbgOptions) ->
+init_packet(
+ Parent,
+ SnmpMgr, AgentIp, UdpPort, TrapUdp, VsnHdr, Version, Dir, BufSz,
+ DbgOptions, IpFamily) ->
put(sname, mgr_misc),
init_debug(DbgOptions),
- {ok, UdpId} = gen_udp:open(TrapUdp, [{recbuf,BufSz},{reuseaddr, true}]),
+ {ok, UdpId} =
+ gen_udp:open(TrapUdp, [{recbuf,BufSz}, {reuseaddr, true}, IpFamily]),
put(msg_id, 1),
proc_lib:init_ack(Parent, self()),
init_usm(Version, Dir),
diff --git a/lib/snmp/test/snmp_test_server.erl b/lib/snmp/test/snmp_test_server.erl
index ffbd2126a3..a77bdc142c 100644
--- a/lib/snmp/test/snmp_test_server.erl
+++ b/lib/snmp/test/snmp_test_server.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/test/snmp_test_suite.erl b/lib/snmp/test/snmp_test_suite.erl
index 77aaa508ad..539c6348a9 100644
--- a/lib/snmp/test/snmp_test_suite.erl
+++ b/lib/snmp/test/snmp_test_suite.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE.erl b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl
new file mode 100644
index 0000000000..24c14d86ea
--- /dev/null
+++ b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl
@@ -0,0 +1,560 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% This test suite uses the following external programs:
+%% snmpget From packet 'snmp' (in Ubuntu 12.04)
+%% snmpd From packet 'snmpd' (in Ubuntu 12.04)
+%% snmptrapd From packet 'snmpd' (in Ubuntu 12.04)
+%% They originate from the Net-SNMP applications, see:
+%% http://net-snmp.sourceforge.net/
+
+
+-module(snmp_to_snmpnet_SUITE).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("snmp/include/STANDARD-MIB.hrl").
+
+-define(AGENT_ENGINE_ID, "ErlangSnmpAgent").
+-define(MANAGER_ENGINE_ID, "ErlangSnmpManager").
+-define(AGENT_PORT, 4000).
+-define(MANAGER_PORT, 8989).
+-define(DEFAULT_MAX_MESSAGE_SIZE, 484).
+
+expected(?sysDescr_instance = Oid, get) ->
+ OidStr = oid_str(Oid),
+ iolist_to_binary([OidStr | " = STRING: \"Erlang SNMP agent\""]).
+
+%%--------------------------------------------------------------------
+%% Common Test interface functions -----------------------------------
+%%--------------------------------------------------------------------
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [
+ {group, ipv4},
+ {group, ipv6},
+ {group, ipv4_ipv6}
+ ].
+
+groups() ->
+ [{ipv4, [],
+ [{group, snmpget},
+ {group, snmptrapd},
+ {group, snmpd_mt},
+ {group, snmpd}
+ ]},
+ {ipv6, [],
+ [{group, snmpget},
+ {group, snmptrapd},
+ {group, snmpd_mt},
+ {group, snmpd}
+ ]},
+ {ipv4_ipv6, [],
+ [{group, snmpget},
+ {group, snmptrapd},
+ {group, snmpd_mt},
+ {group, snmpd}
+ ]},
+ %%
+ {snmpget, [],
+ [erlang_agent_netsnmp_get]},
+ {snmptrapd, [],
+ [erlang_agent_netsnmp_inform]},
+ {snmpd_mt, [],
+ [erlang_manager_netsnmp_get]},
+ {snmpd, [],
+ [erlang_manager_netsnmp_get]}
+ ].
+
+init_per_suite(Config) ->
+ [{agent_port, ?AGENT_PORT}, {manager_port, ?MANAGER_PORT} | Config].
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_group(ipv4, Config) ->
+ init_per_group_ip([inet], Config);
+init_per_group(ipv6, Config) ->
+ init_per_group_ipv6([inet6], Config);
+init_per_group(ipv4_ipv6, Config) ->
+ init_per_group_ipv6([inet, inet6], Config);
+%%
+init_per_group(snmpget = Exec, Config) ->
+ %% From Ubuntu package snmp
+ init_per_group_agent(Exec, Config);
+init_per_group(snmptrapd = Exec, Config) ->
+ %% From Ubuntu package snmpd
+ init_per_group_agent(Exec, Config);
+init_per_group(snmpd_mt, Config) ->
+ %% From Ubuntu package snmp
+ init_per_group_manager(
+ snmpd,
+ [{manager_net_if_module, snmpm_net_if_mt} | Config]);
+init_per_group(snmpd = Exec, Config) ->
+ %% From Ubuntu package snmp
+ init_per_group_manager(
+ Exec,
+ [{manager_net_if_module, snmpm_net_if} | Config]);
+%%
+init_per_group(_, Config) ->
+ Config.
+
+init_per_group_ipv6(Families, Config) ->
+ {ok, Hostname0} = inet:gethostname(),
+ case ct:require(ipv6_hosts) of
+ ok ->
+ case lists:member(list_to_atom(Hostname0), ct:get_config(ipv6_hosts)) of
+ true ->
+ init_per_group_ip(Families, Config);
+ false ->
+ {skip, "Host does not support IPv6"}
+ end;
+ _ ->
+ {skip, "Test config ipv6_hosts is missing"}
+ end.
+
+init_per_group_ip(Families, Config) ->
+ AgentPort = ?config(agent_port, Config),
+ ManagerPort = ?config(manager_port, Config),
+ {ok, Host} = inet:gethostname(),
+ Transports =
+ [begin
+ {ok, Addr} = inet:getaddr(Host, Family),
+ {domain(Family), {Addr, AgentPort}}
+ end || Family <- Families],
+ Targets =
+ [begin
+ {ok, Addr} = inet:getaddr(Host, Family),
+ {domain(Family), {Addr, ManagerPort}}
+ end || Family <- Families],
+ [{transports, Transports}, {targets, Targets} | Config].
+
+init_per_group_agent(Exec, Config) ->
+ Versions = [v2],
+ Dir = ?config(priv_dir, Config),
+ Transports = ?config(transports, Config),
+ Targets = ?config(targets, Config),
+ agent_config(Dir, Transports, Targets, Versions),
+ find_executable(Exec, [{snmp_versions, Versions} | Config]).
+
+init_per_group_manager(Exec, Config) ->
+ Versions = [v2],
+ Dir = ?config(priv_dir, Config),
+ Targets = ?config(targets, Config),
+ manager_config(Dir, Targets),
+ find_executable(Exec, [{snmp_versions, Versions} | Config]).
+
+
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+init_per_testcase(_Case, Config) ->
+ Dog = ct:timetrap(20000),
+ application:stop(snmp),
+ application:unload(snmp),
+ [{watchdog, Dog} | Config].
+
+end_per_testcase(_, Config) ->
+ case application:stop(snmp) of
+ ok ->
+ ok;
+ E1 ->
+ ct:pal("application:stop(snmp) -> ~p", [E1])
+ end,
+ case application:unload(snmp) of
+ ok ->
+ ok;
+ E2 ->
+ ct:pal("application:unload(snmp) -> ~p", [E2])
+ end,
+ Config.
+
+find_executable(Exec, Config) ->
+ ExecStr = atom_to_list(Exec),
+ case os:find_executable(ExecStr) of
+ false ->
+ %% The sbin dirs are not in the PATH on all platforms...
+ find_sys_executable(
+ Exec, ExecStr,
+ [["usr", "local", "sbin"],
+ ["usr", "sbin"],
+ ["sbin"]],
+ Config);
+ Path ->
+ [{Exec, Path} | Config]
+ end.
+
+find_sys_executable(_Exec, ExecStr, [], _Config) ->
+ {skip, ExecStr ++ " not found"};
+find_sys_executable(Exec, ExecStr, [Dir | Dirs], Config) ->
+ case os:find_executable(filename:join(["/" | Dir] ++ [ExecStr])) of
+ false ->
+ find_sys_executable(Exec, ExecStr, Dirs, Config);
+ Path ->
+ [{Exec, Path} | Config]
+ end.
+
+start_agent(Config) ->
+ ok = application:load(snmp),
+ ok = application:set_env(snmp, agent, agent_app_env(Config)),
+ ok = application:start(snmp).
+
+start_manager(Config) ->
+ ok = application:load(snmp),
+ ok = application:set_env(snmp, manager, manager_app_env(Config)),
+ ok = application:start(snmp).
+
+%%--------------------------------------------------------------------
+%% Test Cases --------------------------------------------------------
+%%--------------------------------------------------------------------
+erlang_agent_netsnmp_get() ->
+ [{doc,"Test that we can access erlang snmp agent "
+ "from snmpnet manager"}].
+
+erlang_agent_netsnmp_get(Config) when is_list(Config) ->
+ Transports = ?config(transports, Config),
+ start_agent(Config),
+ Oid = ?sysDescr_instance,
+ Expected = expected(Oid, get),
+ [Expected = snmpget(Oid, Transport, Config)
+ || Transport <- Transports],
+ ok.
+
+%%--------------------------------------------------------------------
+erlang_manager_netsnmp_get() ->
+ [{doc,"Test that the erlang snmp manager can access snmpnet agent"}].
+
+erlang_manager_netsnmp_get(Config) when is_list(Config) ->
+ Community = "happy-testing",
+ SysDescr = "Net-SNMP agent",
+ TargetName = "Target Net-SNMP agent",
+ Transports = ?config(transports, Config),
+ ProgHandle = start_snmpd(Community, SysDescr, Config),
+ start_manager(Config),
+ snmp_manager_user:start_link(self(), test_user),
+ [snmp_manager_user:register_agent(
+ TargetName++domain_suffix(Domain),
+ [{reg_type, target_name},
+ {tdomain, Domain}, {taddress, Addr},
+ {community, Community}, {engine_id, "EngineId"},
+ {version, v2}, {sec_model, v2c}, {sec_level, noAuthNoPriv}])
+ || {Domain, Addr} <- Transports],
+ Results =
+ [snmp_manager_user:sync_get(
+ TargetName++domain_suffix(Domain),
+ [?sysDescr_instance])
+ || {Domain, _} <- Transports],
+ ct:pal("sync_get -> ~p", [Results]),
+ snmp_manager_user:stop(),
+ stop_program(ProgHandle),
+ [{ok,
+ {noError, 0,
+ [{varbind, ?sysDescr_instance, 'OCTET STRING', SysDescr,1}] },
+ _} = R || R <- Results],
+ ok.
+
+%%--------------------------------------------------------------------
+erlang_agent_netsnmp_inform(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Mib = "TestTrapv2",
+
+ start_agent(Config),
+ ok = snmpa:load_mib(snmp_master_agent, filename:join(DataDir, Mib)),
+
+ ProgHandle = start_snmptrapd(Mib, Config),
+
+ snmpa:send_notification(
+ snmp_master_agent, testTrapv22, {erlang_agent_test, self()}),
+
+ receive
+ {snmp_targets, erlang_agent_test, Addresses} ->
+ ct:pal("Notification sent to: ~p~n", [Addresses]),
+ erlang_agent_netsnmp_inform_responses(Addresses)
+ end,
+ stop_program(ProgHandle).
+
+erlang_agent_netsnmp_inform_responses([]) ->
+ receive
+ {snmp_notification, erlang_agent_test, _} = Unexpected ->
+ ct:pal("Unexpected response: ~p", [Unexpected]),
+ erlang_agent_netsnmp_inform_responses([])
+ after 0 ->
+ ok
+ end;
+erlang_agent_netsnmp_inform_responses([Address | Addresses]) ->
+ receive
+ {snmp_notification, erlang_agent_test,
+ {got_response, Address}} ->
+ ct:pal("Got response from: ~p~n", [Address]),
+ erlang_agent_netsnmp_inform_responses(Addresses);
+ {snmp_notification, erlang_agent_test,
+ {no_response, _} = NoResponse} ->
+ ct:fail(NoResponse)
+ end.
+
+%%--------------------------------------------------------------------
+%% Internal functions ------------------------------------------------
+%%--------------------------------------------------------------------
+snmpget(Oid, Transport, Config) ->
+ Versions = ?config(snmp_versions, Config),
+
+ Args =
+ ["-c", "public", net_snmp_version(Versions),
+ "-m", "",
+ "-Cf",
+ net_snmp_addr_str(Transport),
+ oid_str(Oid)],
+ ProgHandle = start_program(snmpget, Args, none, Config),
+ {_, line, Line} = get_program_output(ProgHandle),
+ stop_program(ProgHandle),
+ Line.
+
+start_snmptrapd(Mibs, Config) ->
+ DataDir = ?config(data_dir, Config),
+ MibDir = filename:join(code:lib_dir(snmp), "mibs"),
+ Targets = ?config(targets, Config),
+ SnmptrapdArgs =
+ ["-f", "-Lo", "-C",
+ "-m", Mibs,
+ "-M", MibDir++":"++DataDir,
+ "--disableAuthorization=yes",
+ "--snmpTrapdAddr=" ++ net_snmp_addr_str(Targets)],
+ {ok, StartCheckMP} = re:compile("NET-SNMP version ", [anchored]),
+ start_program(snmptrapd, SnmptrapdArgs, StartCheckMP, Config).
+
+start_snmpd(Community, SysDescr, Config) ->
+ DataDir = ?config(data_dir, Config),
+ Targets = ?config(targets, Config),
+ Transports = ?config(transports, Config),
+ Port = mk_port_number(),
+ CommunityArgs =
+ ["--rocommunity"++domain_suffix(Domain)++"="
+ ++Community++" "++inet_parse:ntoa(Ip)
+ || {Domain, {Ip, _}} <- Targets],
+ SnmpdArgs =
+ ["-f", "-r", %"-Dverbose",
+ "-c", filename:join(DataDir, "snmpd.conf"),
+ "-C", "-Lo",
+ "-m", "",
+ "--sysDescr="++SysDescr,
+ "--agentXSocket=tcp:localhost:"++integer_to_list(Port)]
+ ++ CommunityArgs
+ ++ [net_snmp_addr_str(Transports)],
+ {ok, StartCheckMP} = re:compile("NET-SNMP version ", [anchored]),
+ start_program(snmpd, SnmpdArgs, StartCheckMP, Config).
+
+start_program(Prog, Args, StartCheckMP, Config) ->
+ ct:pal("Starting program: ~w ~p", [Prog, Args]),
+ Path = ?config(Prog, Config),
+ DataDir = ?config(data_dir, Config),
+ StartWrapper = filename:join(DataDir, "start_stop_wrapper"),
+ Parent = self(),
+ Pid =
+ spawn_link(
+ fun () ->
+ run_program(Parent, StartWrapper, [Path | Args])
+ end),
+ start_check(Pid, erlang:monitor(process, Pid), StartCheckMP).
+
+start_check(Pid, Mon, none) ->
+ {Pid, Mon};
+start_check(Pid, Mon, StartCheckMP) ->
+ receive
+ {Pid, line, Line} ->
+ case re:run(Line, StartCheckMP, [{capture, none}]) of
+ match ->
+ {Pid, Mon};
+ nomatch ->
+ start_check(Pid, Mon, StartCheckMP)
+ end;
+ {'DOWN', Mon, _, _, Reason} ->
+ ct:fail("Prog ~p start failed: ~p", [Pid, Reason])
+ end.
+
+get_program_output({Pid, Mon}) ->
+ receive
+ {Pid, _, _} = Msg ->
+ Msg;
+ {'DOWN', Mon, _, _, Reason} ->
+ ct:fail("Prog ~p crashed: ~p", [Pid, Reason])
+ end.
+
+stop_program({Pid, _} = Handle) ->
+ Pid ! {self(), stop},
+ wait_program_stop(Handle).
+
+wait_program_stop({Pid, Mon}) ->
+ receive
+ {Pid, exit, ExitStatus} ->
+ receive
+ {'DOWN', Mon, _, _, _} ->
+ ExitStatus
+ end;
+ {'DOWN', Mon, _, _, Reason} ->
+ ct:fail("Prog stop: ~p", [Reason])
+ end.
+
+run_program(Parent, StartWrapper, ProgAndArgs) ->
+ [Prog | _] = ProgAndArgs,
+ Port =
+ open_port(
+ {spawn_executable, StartWrapper},
+ [{args, ProgAndArgs}, binary, stderr_to_stdout, {line, 80},
+ exit_status]),
+ ct:pal("Prog ~p started: ~p", [Port, Prog]),
+ run_program_loop(Parent, Port, []).
+
+run_program_loop(Parent, Port, Buf) ->
+ receive
+ {Parent, stop} ->
+ true = port_command(Port, <<"stop\n">>),
+ ct:pal("Prog ~p stop", [Port]),
+ run_program_loop(Parent, Port, Buf);
+ {Port, {data, {Flag, Data}}} ->
+ case Flag of
+ eol ->
+ Line = iolist_to_binary(lists:reverse(Buf, Data)),
+ ct:pal("Prog ~p output: ~s", [Port, Line]),
+ Parent ! {self(), line, Line},
+ run_program_loop(Parent, Port, []);
+ noeol ->
+ run_program_loop(Parent, Port, [Data | Buf])
+ end;
+ {Port, {exit_status,ExitStatus}} ->
+ ct:pal("Prog ~p exit: ~p", [Port, ExitStatus]),
+ catch port_close(Port),
+ Parent ! {self(), exit, ExitStatus};
+ Unexpected ->
+ ct:pal("run_program_loop Unexpected: ~p", [Unexpected]),
+ run_program_loop(Parent, Port, Buf)
+ end.
+
+
+agent_app_env(Config) ->
+ Dir = ?config(priv_dir, Config),
+ Vsns = ?config(snmp_versions, Config),
+ [{versions, Vsns},
+ {agent_type, master},
+ {agent_verbosity, trace},
+ {db_dir, Dir},
+ {audit_trail_log, [{type, read_write},
+ {dir, Dir},
+ {size, {10240, 10}}]},
+ {config, [{dir, Dir},
+ {force_load, true},
+ {verbosity, trace}]},
+ {local_db, [{repair, true},
+ {verbosity, silence}]},
+ {mib_server, [{verbosity, silence}]},
+ {symbolic_store, [{verbosity, silence}]},
+ {note_store, [{verbosity, silence}]},
+ {net_if, [{verbosity, trace}]}].
+
+manager_app_env(Config) ->
+ Dir = ?config(priv_dir, Config),
+ Vsns = ?config(snmp_versions, Config),
+ NetIfModule = ?config(manager_net_if_module, Config),
+ [{versions, Vsns},
+ {audit_trail_log, [{type, read_write},
+ {dir, Dir},
+ {size, {10240, 10}}]},
+ {net_if, [{module, NetIfModule}]},
+ {config, [{dir, Dir},
+ {db_dir, Dir},
+ {verbosity, trace}]}
+ ].
+
+oid_str([1 | Ints]) ->
+ "iso." ++ oid_str_tl(Ints);
+oid_str(Ints) ->
+ oid_str_tl(Ints).
+
+oid_str_tl([]) ->
+ "";
+oid_str_tl([Int]) ->
+ integer_to_list(Int);
+oid_str_tl([Int | Ints]) ->
+ integer_to_list(Int) ++ "." ++ oid_str_tl(Ints).
+
+agent_config(Dir, Transports, Targets, Versions) ->
+ EngineID = ?AGENT_ENGINE_ID,
+ MMS = ?DEFAULT_MAX_MESSAGE_SIZE,
+ ok = snmp_config:write_agent_snmp_conf(Dir, Transports, EngineID, MMS),
+ ok = snmp_config:write_agent_snmp_context_conf(Dir),
+ ok = snmp_config:write_agent_snmp_community_conf(Dir),
+ ok =
+ snmp_config:write_agent_snmp_standard_conf(
+ Dir, "snmp_to_snmpnet_SUITE"),
+ ok =
+ snmp_config:write_agent_snmp_target_addr_conf(
+ Dir, Targets, Versions),
+ ok = snmp_config:write_agent_snmp_target_params_conf(Dir, Versions),
+ ok = snmp_config:write_agent_snmp_notify_conf(Dir, inform),
+ ok = snmp_config:write_agent_snmp_vacm_conf(Dir, Versions, none).
+
+manager_config(Dir, Targets) ->
+ EngineID = ?MANAGER_ENGINE_ID,
+ MMS = ?DEFAULT_MAX_MESSAGE_SIZE,
+ ok = snmp_config:write_manager_snmp_conf(Dir, Targets, MMS, EngineID).
+
+net_snmp_version([v3 | _]) ->
+ "-v3";
+net_snmp_version([v2 | _]) ->
+ "-v2c";
+net_snmp_version([v1 | _]) ->
+ "-v1".
+
+domain(inet) ->
+ transportDomainUdpIpv4;
+domain(inet6) ->
+ transportDomainUdpIpv6.
+
+net_snmp_addr_str([Target | Targets]) ->
+ net_snmp_addr_str(Target) ++
+ case Targets of
+ [] ->
+ [];
+ [_ | _] ->
+ "," ++ net_snmp_addr_str(Targets)
+ end;
+net_snmp_addr_str({transportDomainUdpIpv4, {Addr, Port}}) ->
+ "udp:" ++
+ inet_parse:ntoa(Addr) ++ ":" ++
+ integer_to_list(Port);
+net_snmp_addr_str({transportDomainUdpIpv6, {Addr, Port}}) ->
+ "udp6:[" ++
+ inet_parse:ntoa(Addr) ++ "]:" ++
+ integer_to_list(Port).
+
+domain_suffix(transportDomainUdpIpv4) ->
+ "";
+domain_suffix(transportDomainUdpIpv6) ->
+ "6".
+
+mk_port_number() ->
+ {ok, Socket} = gen_udp:open(0, [{reuseaddr, true}]),
+ {ok, PortNum} = inet:port(Socket),
+ ok = gen_udp:close(Socket),
+ PortNum.
diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE_data/TestTrapv2.bin b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/TestTrapv2.bin
new file mode 100644
index 0000000000..9d0790498d
--- /dev/null
+++ b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/TestTrapv2.bin
Binary files differ
diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE_data/TestTrapv2.mib b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/TestTrapv2.mib
new file mode 100644
index 0000000000..679ddc14b0
--- /dev/null
+++ b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/TestTrapv2.mib
@@ -0,0 +1,71 @@
+TestTrapv2 DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
+ TimeTicks, Counter32, snmpModules, mib-2, enterprises, IpAddress,
+ Integer32
+ FROM SNMPv2-SMI
+ DisplayString, TestAndIncr, TimeStamp, RowStatus, TruthValue,
+ TEXTUAL-CONVENTION
+ FROM SNMPv2-TC
+ MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP
+ FROM SNMPv2-CONF
+
+ system, snmp, ifIndex, ifAdminStatus, ifOperStatus
+ FROM RFC1213-MIB
+ snmpTraps
+ FROM SNMPv2-MIB;
+
+testTrapv2 MODULE-IDENTITY
+ LAST-UPDATED "9511090000Z"
+ ORGANIZATION "IETF SNMPv2 Working Group"
+ CONTACT-INFO
+ " Marshall T. Rose
+
+ Postal: Dover Beach Consulting, Inc.
+ 420 Whisman Court
+ Mountain View, CA 94043-2186
+ US
+
+ Tel: +1 415 968 1052
+
+ DESCRIPTION
+ "The MIB module for SNMPv2 entities."
+ REVISION "9304010000Z"
+ DESCRIPTION
+ "The initial revision of this MIB module was published as
+ RFC 1450."
+ ::= { system 100 }
+
+
+tst OBJECT IDENTIFIER ::= { system 0 }
+
+testTrapv21 NOTIFICATION-TYPE
+ STATUS current
+ DESCRIPTION
+ "This trap is exactly the v2 correspondance of testTrap1 in
+ TestTrap mib."
+ ::= { snmp 1 }
+
+testTrapv22 NOTIFICATION-TYPE
+ STATUS current
+ DESCRIPTION
+ "This trap is exactly the v2 correspondance of testTrap2 in
+ TestTrap mib."
+ ::= { system 0 1 }
+
+linkUp NOTIFICATION-TYPE
+ OBJECTS { ifIndex, ifAdminStatus, ifOperStatus }
+ STATUS current
+ DESCRIPTION
+ "A linkUp trap signifies that the SNMPv2 entity,
+ acting in an agent role, has detected that the
+ ifOperStatus object for one of its communication links
+ has transitioned out of the down state."
+ ::= { snmpTraps 4 }
+
+
+
+
+END
diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE_data/snmpd.conf b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/snmpd.conf
new file mode 100644
index 0000000000..2a5f31680f
--- /dev/null
+++ b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/snmpd.conf
@@ -0,0 +1,12 @@
+sysLocation On the lab network
+sysContact otptest <[email protected]>
+
+createUser myinternaluser SHA dropdead
+
+agentSecName myinternaluser
+
+master agentx
+
+[snmp]
+noPersistentLoad yes
+noPersistentSave yes
diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE_data/start_stop_wrapper b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/start_stop_wrapper
new file mode 100755
index 0000000000..e10507cfbd
--- /dev/null
+++ b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/start_stop_wrapper
@@ -0,0 +1,48 @@
+#! /bin/sh
+##
+## %CopyrightBegin%
+##
+## Copyright Ericsson AB 2014-2016. All Rights Reserved.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+## %CopyrightEnd%
+##
+#
+
+## Start the given executable, wait for stop command,
+## stop the running executable and wait for exit.
+
+die () {
+ r=$?
+ echo "$0:" "$*" 1>&2
+ exit $r
+}
+
+test -x "$1" || die "Not Executable: $1"
+
+# Redirect stdin to make sure the stop command is read by us below
+# and does not go to the executable
+"$@" 0< /dev/null &
+PID=$!
+
+# Wait for stop command
+while read LINE; do
+ case :"$LINE" in
+ :"stop")
+ break;;
+ esac
+done
+
+kill $PID
+wait $PID
diff --git a/lib/snmp/test/test1.erl b/lib/snmp/test/test1.erl
index 23cfaf6aaa..3337b265e6 100644
--- a/lib/snmp/test/test1.erl
+++ b/lib/snmp/test/test1.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/test/test2.erl b/lib/snmp/test/test2.erl
index a33208af7b..c73a0930d6 100644
--- a/lib/snmp/test/test2.erl
+++ b/lib/snmp/test/test2.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile
index d65bb8abe2..1e53f51b83 100644
--- a/lib/snmp/test/test_config/Makefile
+++ b/lib/snmp/test/test_config/Makefile
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk
index 3d084cef01..23475b63f8 100644
--- a/lib/snmp/test/test_config/modules.mk
+++ b/lib/snmp/test/test_config/modules.mk
@@ -2,18 +2,19 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2010. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
diff --git a/lib/snmp/test/test_config/snmp_test_config.erl b/lib/snmp/test/test_config/snmp_test_config.erl
index 550a276c4c..89246f5b02 100644
--- a/lib/snmp/test/test_config/snmp_test_config.erl
+++ b/lib/snmp/test/test_config/snmp_test_config.erl
@@ -1,18 +1,19 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk
index 8a4d9c14c0..30b8ee1124 100644
--- a/lib/snmp/vsn.mk
+++ b/lib/snmp/vsn.mk
@@ -2,22 +2,23 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2017. All Rights Reserved.
#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
# %CopyrightEnd%
APPLICATION = snmp
-SNMP_VSN = 4.22.3
+SNMP_VSN = 5.2.5
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(SNMP_VSN)$(PRE_VSN)"