diff options
author | Micael Karlberg <[email protected]> | 2011-07-19 15:14:14 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-07-19 15:14:14 +0200 |
commit | 3a03d66e816a7a9b4779717266bb2166869989b0 (patch) | |
tree | e0a9f96e839f13b517ce4841e47791111cbbd4a0 /lib/snmp/src/agent/snmpa_mpd.erl | |
parent | 9e2b8f8ab28cb74be951945ac4ea1df1f8bb0960 (diff) | |
parent | d42a28e0837209b90cfc4855ff554fdc18d6af3f (diff) | |
download | otp-3a03d66e816a7a9b4779717266bb2166869989b0.tar.gz otp-3a03d66e816a7a9b4779717266bb2166869989b0.tar.bz2 otp-3a03d66e816a7a9b4779717266bb2166869989b0.zip |
[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 transport domain, tdomain,
is now a (new) valid option when registering (snmpm#register_agent)
a new agent (and updating (snmpm#update_agent_info) agent info).
This also mean that the transport behaviour has changed.
OTP-9305
Merge branch 'bmk/snmp/manager/transport_domain/OTP-9305' into bmk/snmp/snmp421_integration
Diffstat (limited to 'lib/snmp/src/agent/snmpa_mpd.erl')
-rw-r--r-- | lib/snmp/src/agent/snmpa_mpd.erl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/snmp/src/agent/snmpa_mpd.erl b/lib/snmp/src/agent/snmpa_mpd.erl index d71786b4a7..4f50b1a674 100644 --- a/lib/snmp/src/agent/snmpa_mpd.erl +++ b/lib/snmp/src/agent/snmpa_mpd.erl @@ -990,7 +990,7 @@ generate_discovery_msg(NoteStore, {TDomain, TAddress}, ContextName, Timeout) -> {ok, {_Domain, Address}} = transform_taddr(TDomain, TAddress), - + %% 7.1.7 ?vdebug("generate_discovery_msg -> 7.1.7 (~w)", [ManagerEngineID]), MsgID = generate_msg_id(), @@ -1080,8 +1080,13 @@ transform_taddr(?transportDomainUdpIpv6, {ok, {Domain, Address}}; transform_taddr(?transportDomainUdpIpv6, BadAddr) -> {error, {bad_transportDomainUdpIpv6_address, BadAddr}}; -transform_taddr(BadTDomain, BadTAddress) -> - {error, {bad_domain, BadTDomain, BadTAddress}}. +transform_taddr(BadTDomain, TAddress) -> + case lists:member(BadTDomain, snmp_conf:all_tdomains()) of + true -> + {error, {unsupported_tdomain, BadTDomain, TAddress}}; + false -> + {error, {unknown_tdomain, BadTDomain, TAddress}} + end. process_taddrs(Dests) -> @@ -1093,7 +1098,7 @@ process_taddrs([], Acc) -> ?vtrace("process_taddrs -> entry when done with" "~n Acc: ~p", [Acc]), lists:reverse(Acc); - + %% v3 process_taddrs([{{TDomain, TAddress}, SecData} | T], Acc) -> ?vtrace("process_taddrs -> entry when v3 with" @@ -1130,7 +1135,7 @@ process_taddrs([{TDomain, TAddress} | T], Acc) -> process_taddrs(T, Acc) end; process_taddrs(Crap, Acc) -> - throw({error, {taddrs_crap, Crap, Acc}}). + throw({error, {bad_taddrs, Crap, Acc}}). mk_v1_v2_packet_list(To, Packet, Len, Pdu) -> |