From 8fceb07c652025c3742b6ba604460c853f7a2ad5 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 12 Jul 2011 09:58:56 +0200 Subject: [manager] No way to specify transport domain. Transport domains was assumed to be IPv4. This has now been changed so that it can also be IPv6. To facilitate this, the transportDomain is now a (new) valid option. This also mean that the transport behaviour has changed. OTP-9305 [agent] A temporary fix for transport domain, specifically regarding trap sending. This is done in order to make testing possible, pending merge from topic branch. OTP-9400 --- lib/snmp/src/manager/snmpm.erl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'lib/snmp/src/manager/snmpm.erl') diff --git a/lib/snmp/src/manager/snmpm.erl b/lib/snmp/src/manager/snmpm.erl index 0d084332de..67e3673b74 100644 --- a/lib/snmp/src/manager/snmpm.erl +++ b/lib/snmp/src/manager/snmpm.erl @@ -50,7 +50,7 @@ register_agent/2, register_agent/3, register_agent/4, unregister_agent/2, unregister_agent/3, which_agents/0, which_agents/1, - agent_info/2, update_agent_info/4, + agent_info/2, update_agent_info/3, update_agent_info/4, register_usm_user/3, unregister_usm_user/2, which_usm_users/0, which_usm_users/1, @@ -167,6 +167,7 @@ -include_lib("snmp/include/snmp_types.hrl"). -include("snmpm_atl.hrl"). -include("snmpm_internal.hrl"). +-include("snmp_verbosity.hrl"). -define(DEFAULT_AGENT_PORT, 161). @@ -379,6 +380,11 @@ which_users() -> %% Config -> Agent configuration: [config()] do_register_agent(UserId, TargetName, Config) -> + io:format("do_register_agent -> entry with" + "~n UserId: ~p" + "~n TargetName: ~p" + "~n Config: ~p" + "~n", [UserId, TargetName, Config]), snmpm_config:register_agent(UserId, TargetName, Config). register_agent(UserId, TargetName, Config) @@ -405,13 +411,21 @@ register_agent(UserId, Addr) -> %% Backward compatibility register_agent(UserId, Addr, Port, Config0) -> + io:format("register_agent -> entry with" + "~n UserId: ~p" + "~n Addr: ~p" + "~n Port: ~p" + "~n Config0: ~p" + "~n", [UserId, Addr, Port, Config0]), case lists:keymember(target_name, 1, Config0) of false -> + io:format("register_agent -> no target_name~n", []), TargetName = mk_target_name(Addr, Port, Config0), Config = [{reg_type, addr_port}, {address, Addr}, {port, Port} | Config0], do_register_agent(UserId, TargetName, ensure_engine_id(Config)); true -> + io:format("register_agent -> target_name~n", []), {value, {_, TargetName}} = lists:keysearch(target_name, 1, Config0), Config1 = lists:keydelete(target_name, 1, Config0), @@ -447,8 +461,11 @@ agent_info(Addr, Port, Item) -> 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) -> - snmpm_config: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) -> -- cgit v1.2.3 From 8b4f1eca4ba0c776549e1598d24716804376e060 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 12 Jul 2011 16:02:00 +0200 Subject: transport domain config option named tdomain. Removed debug printouts. transport domain error detection. --- lib/snmp/src/manager/snmpm.erl | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'lib/snmp/src/manager/snmpm.erl') diff --git a/lib/snmp/src/manager/snmpm.erl b/lib/snmp/src/manager/snmpm.erl index 67e3673b74..6d2ac8d747 100644 --- a/lib/snmp/src/manager/snmpm.erl +++ b/lib/snmp/src/manager/snmpm.erl @@ -380,11 +380,6 @@ which_users() -> %% Config -> Agent configuration: [config()] do_register_agent(UserId, TargetName, Config) -> - io:format("do_register_agent -> entry with" - "~n UserId: ~p" - "~n TargetName: ~p" - "~n Config: ~p" - "~n", [UserId, TargetName, Config]), snmpm_config:register_agent(UserId, TargetName, Config). register_agent(UserId, TargetName, Config) @@ -411,21 +406,13 @@ register_agent(UserId, Addr) -> %% Backward compatibility register_agent(UserId, Addr, Port, Config0) -> - io:format("register_agent -> entry with" - "~n UserId: ~p" - "~n Addr: ~p" - "~n Port: ~p" - "~n Config0: ~p" - "~n", [UserId, Addr, Port, Config0]), case lists:keymember(target_name, 1, Config0) of false -> - io:format("register_agent -> no target_name~n", []), TargetName = mk_target_name(Addr, Port, Config0), Config = [{reg_type, addr_port}, {address, Addr}, {port, Port} | Config0], do_register_agent(UserId, TargetName, ensure_engine_id(Config)); true -> - io:format("register_agent -> target_name~n", []), {value, {_, TargetName}} = lists:keysearch(target_name, 1, Config0), Config1 = lists:keydelete(target_name, 1, Config0), -- cgit v1.2.3