From f907baa3d7a64436b43e404c014669bf3ee67eba Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 1 Aug 2011 18:34:36 +0200 Subject: [agent] Some very minor debugging improvements. OTP-9446 --- lib/snmp/doc/src/notes.xml | 59 ++++++++++++++++++++++++++++++++++ lib/snmp/src/agent/snmp_target_mib.erl | 23 +++++++++++-- lib/snmp/src/app/snmp.appup.src | 12 +++++++ lib/snmp/vsn.mk | 2 +- 4 files changed, 92 insertions(+), 4 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 4178192120..0d59f2e781 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -32,6 +32,65 @@ notes.xml +
+ SNMP Development Toolkit 4.21.1 +

Version 4.21.1 supports code replacement in runtime from/to + version 4.21, 4.20.1, 4.20 and 4.19.

+ +
+ Improvements and new features + + + +

[agent] Some very minor debugging improvements.

+

Own Id: OTP-9446

+
+
+ +
+ +
+ Fixed Bugs and Malfunctions + + + + +

The snmp config tool could not handle (manager) audit trail config + because the option seqno was not handled.

+

Own Id: OTP-9354

+
+ + +

[agent] The SNMP ACM cache was not properly updated when + changes where made to the VACM security-to-group, access and + view-tree-family tables.

+

Own Id: OTP-9367

+

Aux Id: Seq 11858

+
+ + +

Fixed install directory typo for man3.

+

Peter Lemenkov

+

Hans Ulrich Niedermann

+

Own Id: OTP-9442

+
+ +
+
+ + +
+ Incompatibilities +

-

+
+ +
+ +
SNMP Development Toolkit 4.21

Version 4.21 supports code replacement in runtime from/to diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl index 77910541a2..60bd3e0912 100644 --- a/lib/snmp/src/agent/snmp_target_mib.erl +++ b/lib/snmp/src/agent/snmp_target_mib.erl @@ -383,10 +383,18 @@ is_valid_tag(Tag, TDomain, TAddress) -> is_valid_tag(TDomain, TAddress, Tag, []). is_valid_tag(TDomain, TAddress, Tag, Key) -> + ?vtrace("is_valid_tag -> entry with" + "~n TDomain: ~p" + "~n TAddress: ~p" + "~n Tag: ~p" + "~n Key: ~p", [TDomain, TAddress, Tag, Key]), case table_next(snmpTargetAddrTable, Key) of endOfTable -> + ?vtrace("is_valid_tag -> endOfTable", []), false; NextKey -> + ?vtrace("is_valid_tag -> next key found" + "~n NextKey: ~p", [NextKey]), case get(snmpTargetAddrTable, NextKey, [?snmpTargetAddrTDomain, ?snmpTargetAddrTAddress, ?snmpTargetAddrTagList, @@ -395,6 +403,8 @@ is_valid_tag(TDomain, TAddress, Tag, Key) -> {value, TAddress}, % RFC2576: chapters 5.2.1 & 5.3 {value, TagList}, {value, []}] -> + ?vtrace("is_valid_tag -> found with exact match" + "~n TagList: ~p", [TagList]), case snmp_misc:is_tag_member(Tag, TagList) of true -> ?vtrace("is_valid_tag -> exact: " @@ -410,9 +420,14 @@ is_valid_tag(TDomain, TAddress, Tag, Key) -> {value, TAddress2}, {value, TagList}, {value, TMask}] when TMask =/= [] -> + ?vtrace("is_valid_tag -> found with exact match" + "~n TagList: ~p" + "~n TMask: ~p", [TagList, TMask]), case snmp_misc:is_tmask_match(TAddress, TAddress2, TMask) of true -> + ?vtrace("is_valid_tag -> " + "tmask match - now check tag member", []), case snmp_misc:is_tag_member(Tag, TagList) of true -> ?vtrace("is_valid_tag -> masked: " @@ -425,10 +440,12 @@ is_valid_tag(TDomain, TAddress, Tag, Key) -> Tag, NextKey) end; false -> + ?vtrace("is_valid_tag -> tmask NO match", []), is_valid_tag(TDomain, TAddress, Tag, NextKey) end; _ -> + ?vtrace("is_valid_tag -> not found - try next", []), is_valid_tag(TDomain, TAddress, Tag, NextKey) end end. @@ -591,9 +608,9 @@ snmpTargetAddrTable(print) -> [Prefix, element(?snmpTargetAddrName, Row), Prefix, element(?snmpTargetAddrTDomain, Row), case element(?snmpTargetAddrTDomain, Row) of - ?snmpUDPDomain -> udp; - ?transportDomainUdpIpv4 -> udpIpv4; - ?transportDomainUdpIpv6 -> udpIpv6; + ?snmpUDPDomain -> snmpUDPDomain; + ?transportDomainUdpIpv4 -> transportDomainUdpIpv4; + ?transportDomainUdpIpv6 -> transportDomainUdpIpv6; _ -> undefined end, Prefix, element(?snmpTargetAddrTAddress, Row), diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 8e1855b4df..0b6ea93231 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,8 +22,14 @@ %% ----- U p g r a d e ------------------------------------------------------- [ + {"4.21", + [ + {load_module, snmp_target_mib, soft_purge, soft_purge, []} + ] + }, {"4.20.1", [ + {load_module, snmp_target_mib, soft_purge, soft_purge, []}, {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, {load_module, snmpm, soft_purge, soft_purge, [snmpm_server, snmpm_config, snmp_config]}, @@ -109,8 +115,14 @@ %% ------D o w n g r a d e --------------------------------------------------- [ + {"4.21", + [ + {load_module, snmp_target_mib, soft_purge, soft_purge, []} + ] + }, {"4.20.1", [ + {load_module, snmp_target_mib, soft_purge, soft_purge, []}, {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, {load_module, snmpm, soft_purge, soft_purge, [snmpm_server, snmpm_config, snmp_config]}, diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 08251ab9ea..c95e0a22d1 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -17,6 +17,6 @@ # # %CopyrightEnd% -SNMP_VSN = 4.21 +SNMP_VSN = 4.21.1 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From 08eaf2c5353b07368b2de3a178a1e987a534f87d Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 2 Aug 2011 11:24:55 +0200 Subject: [compiler] Used wrong variable name (for warnings-as-errors variable), which caused the compiler to crash when using the snmpc script. Also added the option --Werror for the SNMP MIB compiler (escript) frontend (to mimic erlc), which specifies whether warnings should be treated as errors. OTP-9447 --- lib/snmp/doc/src/notes.xml | 48 +++++++++++++++++++++++++++++++++ lib/snmp/doc/src/snmpc_cmd.xml | 5 ++-- lib/snmp/src/compile/snmpc.src | 61 +++++++++++++++++++++++------------------- lib/snmp/vsn.mk | 2 +- 4 files changed, 86 insertions(+), 30 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 4178192120..504b801fd3 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -32,6 +32,54 @@ notes.xml +

+ SNMP Development Toolkit 4.21 +

Version 4.21 supports code replacement in runtime from/to + version 4.20.1, 4.20 and 4.19.

+ +
+ Improvements and new features + + + +

[compiler] Added the option + --Werror + for the SNMP MIB compiler (escript) frontend (to mimic + erlc), + which specifies whether warnings should be treated as errors.

+

Own Id: OTP-9447

+
+
+ +
+ +
+ Fixed Bugs and Malfunctions +

-

+ + +
+ + +
+ Incompatibilities +

-

+
+ +
+ +
SNMP Development Toolkit 4.21

Version 4.21 supports code replacement in runtime from/to diff --git a/lib/snmp/doc/src/snmpc_cmd.xml b/lib/snmp/doc/src/snmpc_cmd.xml index 72116f8981..dda8f017dc 100644 --- a/lib/snmp/doc/src/snmpc_cmd.xml +++ b/lib/snmp/doc/src/snmpc_cmd.xml @@ -86,9 +86,10 @@

Print warning messages.

+ - --wae + --wae | --Werror

Warnings as errors. Indicates that warnings shall be treated as errors.

@@ -211,7 +212,7 @@
SEE ALSO -

erlc(1), +

erlc(1), compile(3), snmpc(3)

diff --git a/lib/snmp/src/compile/snmpc.src b/lib/snmp/src/compile/snmpc.src index 4e91ae9a03..b069dbe8fa 100644 --- a/lib/snmp/src/compile/snmpc.src +++ b/lib/snmp/src/compile/snmpc.src @@ -46,7 +46,7 @@ agent_capabilities = false, module, no_defaults = false, - relaxed_row_name_assigne_check = false, + relaxed_row_name_assign_check = false, %% The default verbosity (silence) will be filled in %% during argument processing. verbosity, @@ -75,7 +75,7 @@ %% --version %% --verbosity V %% --warnings -%% --wae +%% --wae | --warnings_as_errors main(Args) when is_list(Args) -> case (catch process_args(Args)) of ok -> @@ -154,7 +154,7 @@ mk_mib_options(#state{outdir = OutDir, agent_capabilities = AC, module = Mod, no_defaults = ND, - relaxed_row_name_assigne_check = RRNAC, + relaxed_row_name_assign_check = RRNAC, %% The default verbosity (silence) will be filled in %% during argument processing. verbosity = V, @@ -182,7 +182,7 @@ mk_mib_options(#state{outdir = OutDir, maybe_option(MI, module_identity) ++ maybe_option(MC, module_compliance) ++ maybe_option(AC, agent_capabilities) ++ - maybe_option(WE, warnings_as_errors). + maybe_option(WAE, warnings_as_errors). maybe_option(true, Opt) -> [Opt]; maybe_option(_, _) -> []. @@ -295,9 +295,11 @@ process_args(["--mod"|_Args], #state{module = M}) process_args(["--nd"|Args], State) -> process_args(Args, State#state{no_defaults = true}); process_args(["--rrnac"|Args], State) -> - process_args(Args, State#state{relaxed_row_name_assigne_check = true}); + process_args(Args, State#state{relaxed_row_name_assign_check = true}); process_args(["--wae"|Args], State) -> process_args(Args, State#state{warnings_as_errors = true}); +process_args(["--warnings_as_errors"|Args], State) -> + process_args(Args, State#state{warnings_as_errors = true}); process_args([MIB], State) -> Ext = filename:extension(MIB), if @@ -340,16 +342,19 @@ usage() -> "~n The current workin dir will always be included. " "~n --il - Add this dir to the list of dirs that will be" "~n searched for imported (compiled) MIB files." - "~n It assumes that the first element in the dir name" - "~n correspond to an OTP application. For example snmp/mibs/" - "~n The current workin dir and the /priv/mibs " + "~n It assumes that the first element in the dir " + "~n name correspond to an OTP application. " + "~n For example snmp/mibs/ " + "~n The current workin dir and the " + "~n /priv/mibs " "~n are always listed last the includ path. " "~n --db - Database to used for the default instrumentation." "~n Defaults to volatile." - "~n --sgc - This option (skip group check), if present, disables " - "~n the \"group check\" of the mib compiler. " - "~n That is, should the OBJECT-GROUP and the NOTIFICATION-GROUP " - "~n macro(s) be checked for correctness or not. " + "~n --sgc - This option (skip group check), if present, " + "~n disables the \"group check\" of the mib compiler. " + "~n That is, should the OBJECT-GROUP and the " + "~n NOTIFICATION-GROUP macro(s) be checked for " + "~n correctness or not. " "~n By default the check is done. " "~n --dep - Keep deprecated definition(s)." "~n If not specified the compiler will ignore" @@ -360,25 +365,27 @@ usage() -> "~n --mi - The MODULE-IDENTITY field will be included." "~n --mc - The MODULE-COMPLIANCE field will be included." "~n --ac - The AGENT-CAPABILITIES field will be included." - "~n --mod - The module which implements all the instrumentation" - "~n functions. " + "~n --mod - The module which implements all the " + "~n instrumentation functions. " "~n The name of all instrumentation functions must" "~n be the same as the corresponding managed object" "~n it implements." - "~n --nd - The default instrumentation functions will *not* be used" - "~n if a managed object have no instrumentation function. " - "~n Instead this will be reported as an error, and the " - "~n compilation aborts. " - "~n --rrnac - This option, if present, specifies that the row name " - "~n assign check shall not be done strictly according to" - "~n the SMI (which allows only the value 1). " - "~n With this option, all values greater than zero is allowed" - "~n (>= 1). This means that the error will be converted to " + "~n --nd - The default instrumentation functions will *not* " + "~n be used if a managed object have no " + "~n instrumentation function. Instead this will be " + "~n reported as an error, and the compilation aborts. " + "~n --rrnac - This option, if present, specifies that the row " + "~n name assign check shall not be done strictly " + "~n according to the SMI (which allows only the " + "~n value 1). With this option, all values greater " + "~n than zero is allowed (>= 1). " + "~n This means that the error will be converted to " "~n a warning. " - "~n By default it is not included, but if this option is " - "~n present it will be. " - "~n --wae - Warnings as errors. " - "~n Indicates that warnings shall be treated as errors. " + "~n By default it is not included, but if this " + "~n option is present it will be. " + "~n --wae | --Werror - Warnings as errors. " + "~n Indicates that warnings shall be treated as " + "~n errors. " "~n " "~n", []), halt(1). diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 08251ab9ea..c95e0a22d1 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -17,6 +17,6 @@ # # %CopyrightEnd% -SNMP_VSN = 4.21 +SNMP_VSN = 4.21.1 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From b00b2d56e5b7e2d59aebb8b020d8c30064050413 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 2 Aug 2011 11:54:48 +0200 Subject: Fixed release notes entry. --- lib/snmp/doc/src/notes.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 504b801fd3..e55f58c659 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -44,7 +44,10 @@ --> -

[compiler] Added the option +

[compiler] Used wrong variable name (for + warnings-as-errors variable), which caused the + compiler to crash when using the snmpc script.

+

Also added the option --Werror for the SNMP MIB compiler (escript) frontend (to mimic erlc), -- cgit v1.2.3 From aca631f40850fabbbc9c0d26b04c550d62b7f09e Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 2 Aug 2011 13:56:49 +0200 Subject: Also added handling option "--W" in the snmpc(command), for completion. --- lib/snmp/doc/src/snmpc_cmd.xml | 3 ++- lib/snmp/src/compile/snmpc.src | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/snmp/doc/src/snmpc_cmd.xml b/lib/snmp/doc/src/snmpc_cmd.xml index dda8f017dc..971f8a3cff 100644 --- a/lib/snmp/doc/src/snmpc_cmd.xml +++ b/lib/snmp/doc/src/snmpc_cmd.xml @@ -79,10 +79,11 @@

Print debug info.

verbosity = trace | debug | log | info | silence

Defaults to silence.

+
- --warnings + --warnings | --W

Print warning messages.

diff --git a/lib/snmp/src/compile/snmpc.src b/lib/snmp/src/compile/snmpc.src index b069dbe8fa..ee65129437 100644 --- a/lib/snmp/src/compile/snmpc.src +++ b/lib/snmp/src/compile/snmpc.src @@ -234,6 +234,8 @@ process_args(["--verbosity", Verbosity0|Args], #state{verbosity = V} = State) process_args(["--verbosity"|_Args], #state{verbosity = V}) when (V =/= undefined) -> e(lists:flatten(io_lib:format("Verbosity already set to ~w", [V]))); +process_args(["--w"|Args], State) -> + process_args(Args, State#state{warnings = true}); process_args(["--warnings"|Args], State) -> process_args(Args, State#state{warnings = true}); process_args(["--o", Dir|Args], State) -> @@ -334,7 +336,7 @@ usage() -> "~n --verbosity - Print debug info." "~n verbosity = trace | debug | log | info | silence" "~n Defaults to silence." - "~n --warnings - Print warning messages." + "~n --warnings | --W - Print warning messages." "~n --o - The output dir." "~n Defaults to current working dir." "~n --i - Add this dir to the list of dirs that will be" -- cgit v1.2.3 From 67803978db45ac5ba9a23aa6ec2a5aaac396ec3d Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 5 Sep 2011 11:28:46 +0200 Subject: Wrapper (e)script did not handle (new) option --Werror. Also removed the "Error : " prefix for error printouts. --- lib/snmp/src/compile/snmpc.src | 4 +++- lib/snmp/src/compile/snmpc_lib.erl | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/snmp/src/compile/snmpc.src b/lib/snmp/src/compile/snmpc.src index ee65129437..f993335b89 100644 --- a/lib/snmp/src/compile/snmpc.src +++ b/lib/snmp/src/compile/snmpc.src @@ -75,7 +75,7 @@ %% --version %% --verbosity V %% --warnings -%% --wae | --warnings_as_errors +%% --Werror | --wae | --warnings_as_errors main(Args) when is_list(Args) -> case (catch process_args(Args)) of ok -> @@ -298,6 +298,8 @@ process_args(["--nd"|Args], State) -> process_args(Args, State#state{no_defaults = true}); process_args(["--rrnac"|Args], State) -> process_args(Args, State#state{relaxed_row_name_assign_check = true}); +process_args(["--Werror"|Args], State) -> + process_args(Args, State#state{warnings_as_errors = true}); process_args(["--wae"|Args], State) -> process_args(Args, State#state{warnings_as_errors = true}); process_args(["--warnings_as_errors"|Args], State) -> diff --git a/lib/snmp/src/compile/snmpc_lib.erl b/lib/snmp/src/compile/snmpc_lib.erl index 4f71c47bfa..a0a35e91c4 100644 --- a/lib/snmp/src/compile/snmpc_lib.erl +++ b/lib/snmp/src/compile/snmpc_lib.erl @@ -1754,12 +1754,12 @@ error(FormatStr, Data, Line) when is_list(FormatStr) -> exit(error). print_error(FormatStr, Data) when is_list(FormatStr) -> - ok = io:format("~s: Error: " ++ FormatStr,[get(filename)|Data]), + ok = io:format("~s: " ++ FormatStr,[get(filename)|Data]), put(errors,yes), io:format("~n"). print_error(FormatStr, Data,Line) when is_list(FormatStr) -> - ok = io:format("~s: ~w: Error: " ++ FormatStr,[get(filename), Line |Data]), + ok = io:format("~s: ~w: " ++ FormatStr,[get(filename), Line |Data]), put(errors,yes), io:format("~n"). -- cgit v1.2.3 From 0e44fc144f109c6f7da5b9416809be2d2d425a3e Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 5 Sep 2011 11:36:07 +0200 Subject: Release notes "fixed"... --- lib/snmp/doc/src/notes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index e55f58c659..4272e02b45 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -46,7 +46,7 @@

[compiler] Used wrong variable name (for warnings-as-errors variable), which caused the - compiler to crash when using the snmpc script.

+ compiler to crash when using the snmpc (e)script.

Also added the option --Werror for the SNMP MIB compiler (escript) frontend (to mimic -- cgit v1.2.3 From 5f2fbdd95ed577b50f1d14ed490c1f2417350d69 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 5 Sep 2011 11:37:26 +0200 Subject: Added entry in the appup file (for 4.21). --- lib/snmp/src/app/snmp.appup.src | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 8e1855b4df..22817bc21d 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,6 +22,10 @@ %% ----- U p g r a d e ------------------------------------------------------- [ + {"4.21", + [ + ] + }, {"4.20.1", [ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, @@ -109,6 +113,10 @@ %% ------D o w n g r a d e --------------------------------------------------- [ + {"4.21", + [ + ] + }, {"4.20.1", [ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, -- cgit v1.2.3