aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-07-12 14:29:01 +0200
committerMicael Karlberg <[email protected]>2011-07-12 14:29:01 +0200
commit55d5d63357f4a4c25461aba837a8e473870062d9 (patch)
treede872823fd39419eebdf7c9348d2978ee06803fe
parent8fceb07c652025c3742b6ba604460c853f7a2ad5 (diff)
parent8c4b1a7189b918a298e81014b3309e8d129aeed9 (diff)
downloadotp-55d5d63357f4a4c25461aba837a8e473870062d9.tar.gz
otp-55d5d63357f4a4c25461aba837a8e473870062d9.tar.bz2
otp-55d5d63357f4a4c25461aba837a8e473870062d9.zip
Merge branch 'bmk/snmp/agent/wrong_default_transport_domain/OTP-9425' into bmk/snmp/manager/transport_domain/OTP-9305
Conflicts: lib/snmp/doc/src/notes.xml lib/snmp/src/agent/snmpa_mpd.erl lib/snmp/src/app/snmp.appup.src lib/snmp/vsn.mk
-rw-r--r--lib/snmp/doc/src/notes.xml85
-rw-r--r--lib/snmp/src/agent/snmp_target_mib.erl5
-rw-r--r--lib/snmp/src/agent/snmpa_mpd.erl25
-rw-r--r--lib/snmp/src/app/snmp.appup.src14
4 files changed, 101 insertions, 28 deletions
diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml
index 8e6b05bb90..facb9029f5 100644
--- a/lib/snmp/doc/src/notes.xml
+++ b/lib/snmp/doc/src/notes.xml
@@ -35,36 +35,74 @@
<section>
<title>SNMP Development Toolkit 4.21</title>
<p>Version 4.21 supports code replacement in runtime from/to
- version 4.20, 4.19 and 4.18.</p>
+ version 4.20.1, 4.20, 4.19 and 4.18.</p>
<section>
<title>Improvements and new features</title>
- <p>-</p>
<!--
+ <p>-</p>
+-->
<list type="bulleted">
<item>
- <p>[manager] 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>
+ <p>[manager] There was no way to specify transport domain.
+ The transport domains was assumed to be IPv4 (transportDomainUdpIpv4).
+ This has now been changed so that it can also be IPv6
+ (transportDomainUdpIpv6).
+ To facilitate this, the <c>transportDomain</c> is now a (new)
+ valid option when
+ <seealso marker="snmpm#register_agent">registering</seealso>
+ a new agent. </p>
+ <p>This also mean that the transport behaviour has changed. </p>
+ <p>Own Id: OTP-9305</p>
+ <p>Aux Id: Seq 11847</p>
</item>
+ </list>
+ </section>
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
<item>
- <p>[compiler] Added a MIB compiler (frontend) escript,
- <c>snmpc</c>. </p>
- <p>Own Id: OTP-9004</p>
+ <p>[agent] Did not handle transport domains properly in some
+ cases. </p>
+ <p>Own Id: OTP-9400</p>
</item>
</list>
-->
</section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+ </section>
+
+ </section> <!-- 4.21 -->
+
+
+ <section>
+ <title>SNMP Development Toolkit 4.20.1</title>
+ <p>Version 4.20.1 supports code replacement in runtime from/to
+ version 4.20, 4.19 and 4.18.</p>
+
+ <section>
+ <title>Improvements and new features</title>
+ <p>-</p>
+<!--
+ <list type="bulleted">
+ <item>
+ <p>Added type specs for functions that do not return. </p>
+ <p>Kostis Sagonas</p>
+ <p>Own Id: OTP-9208</p>
+ </item>
+ </list>
+-->
+ </section>
+
<section>
<title>Fixed Bugs and Malfunctions</title>
<!--
@@ -72,10 +110,17 @@
-->
<list type="bulleted">
<item>
- <p>[agent] Did not handle transport domains properly in some
- cases. </p>
- <p>Own Id: OTP-9400</p>
- </item>
+ <p>[agent] Did not handle transport domains properly in some cases,
+ for instance trap sending. </p>
+ <p>Own Id: OTP-9400</p>
+ </item>
+
+ <item>
+ <p>[agent] Wrong default transport domain, snmpUDPDomain, instead
+ of transportDomainUdpIpv4. </p>
+ <p>Own Id: OTP-9425</p>
+ <p>Aux Id: Seq 11874</p>
+ </item>
</list>
</section>
@@ -86,7 +131,7 @@
<p>-</p>
</section>
- </section> <!-- 4.21 -->
+ </section> <!-- 4.20.1 -->
<section>
diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl
index 77910541a2..25b3dab088 100644
--- a/lib/snmp/src/agent/snmp_target_mib.erl
+++ b/lib/snmp/src/agent/snmp_target_mib.erl
@@ -53,7 +53,7 @@
%%-----------------------------------------------------------------
default_domain() ->
- snmpUDPDomain.
+ transportDomainUdpIpv4.
%%-----------------------------------------------------------------
@@ -436,7 +436,8 @@ is_valid_tag(TDomain, TAddress, Tag, Key) ->
%% TargAddrs =
%% [{TagList, TargetAddr, TargetAddrName, TargetParams, Timeout, Retry}]
-%% TargetAddr = {TDomain, TAddr}; e.g. {?snmpUDPDomain, IpAndUdpPortAsList}
+%% TargetAddr = {TDomain, TAddr}; e.g.
+%% {?transportDomainUdpIpv4, IpAndUdpPortAsList}
get_target_addrs() ->
get_target_addrs([], db(snmpTargetAddrTable), []).
diff --git a/lib/snmp/src/agent/snmpa_mpd.erl b/lib/snmp/src/agent/snmpa_mpd.erl
index 5d276fd6de..21c333b950 100644
--- a/lib/snmp/src/agent/snmpa_mpd.erl
+++ b/lib/snmp/src/agent/snmpa_mpd.erl
@@ -1069,6 +1069,8 @@ transform_taddr(?transportDomainUdpIpv4, [A, B, C, D, P1, P2]) ->
Port = P1 bsl 8 + P2,
Address = {Addr, Port},
{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]) ->
Domain = transportDomainUdpIpv6,
@@ -1076,8 +1078,10 @@ transform_taddr(?transportDomainUdpIpv6,
Port = P1 bsl 8 + P2,
Address = {Addr, Port},
{ok, {Domain, Address}};
-transform_taddr(_TDomain, _TAddress) ->
- error.
+transform_taddr(?transportDomainUdpIpv6, BadAddr) ->
+ {error, {bad_transportDomainUdpIpv6_address, BadAddr}};
+transform_taddr(BadTDomain, BadTAddress) ->
+ {error, {bad_domain, BadTDomain, BadTAddress}}.
process_taddrs(Dests) ->
@@ -1098,21 +1102,30 @@ process_taddrs([{{TDomain, TAddress}, SecData} | T], Acc) ->
"~n SecData: ~p", [TDomain, TAddress, SecData]),
case transform_taddr(TDomain, TAddress) of
{ok, DestAddr} ->
+ ?vtrace("process_taddrs -> transformed: "
+ "~n DestAddr: ~p", [DestAddr]),
Entry = {DestAddr, SecData},
process_taddrs(T, [Entry | Acc]);
- error ->
+ {error, Reason} ->
+ ?vinfo("Failed transforming v3 domain and address"
+ "~n Reason: ~p", [Reason]),
user_err("Bad TDomain/TAddress: ~w/~w", [TDomain, TAddress]),
process_taddrs(T, Acc)
end;
%% v1 & v2
process_taddrs([{TDomain, TAddress} | T], Acc) ->
- ?vtrace("process_taddrs -> entry when v3 with"
+ ?vtrace("process_taddrs -> entry when v1/v2 with"
"~n TDomain: ~p"
"~n TAddress: ~p", [TDomain, TAddress]),
case transform_taddr(TDomain, TAddress) of
- {ok, Entry} ->
+ {ok, DestAddr} ->
+ ?vtrace("process_taddrs -> transformed: "
+ "~n DestAddr: ~p", [DestAddr]),
+ Entry = DestAddr,
process_taddrs(T, [Entry | Acc]);
- error ->
+ {error, Reason} ->
+ ?vinfo("Failed transforming v1/v2 domain and address: "
+ "~n Reason: ~p", [Reason]),
user_err("Bad TDomain/TAddress: ~w/~w", [TDomain, TAddress]),
process_taddrs(T, Acc)
end;
diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src
index edf3555b6c..3c82ad56ef 100644
--- a/lib/snmp/src/app/snmp.appup.src
+++ b/lib/snmp/src/app/snmp.appup.src
@@ -22,8 +22,15 @@
%% ----- U p g r a d e -------------------------------------------------------
[
+ {"4.20.1",
+ [
+ {load_module, snmpa_mpd, soft_purge, soft_purge, []},
+ {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]}
+ ]
+ },
{"4.20",
[
+ {load_module, snmp_target_mib, soft_purge, soft_purge, []},
{load_module, snmpa_mpd, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]}
]
@@ -115,8 +122,15 @@
%% ------D o w n g r a d e ---------------------------------------------------
[
+ {"4.20.1",
+ [
+ {load_module, snmpa_mpd, soft_purge, soft_purge, []},
+ {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]}
+ ]
+ },
{"4.20",
[
+ {load_module, snmp_target_mib, soft_purge, soft_purge, []},
{load_module, snmpa_mpd, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]}
]