diff options
author | Raimo Niskanen <[email protected]> | 2014-05-07 08:43:07 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2014-07-25 12:15:14 +0200 |
commit | 382e91a930b3d20d4e4cce14ea6c3cbc7e4397d7 (patch) | |
tree | 5dfcd9909a5024315b8010d41e1b7309a50b5328 /lib/snmp/src/manager | |
parent | 89ca2960d421a43bced0a9f228a62b8ab3089663 (diff) | |
download | otp-382e91a930b3d20d4e4cce14ea6c3cbc7e4397d7.tar.gz otp-382e91a930b3d20d4e4cce14ea6c3cbc7e4397d7.tar.bz2 otp-382e91a930b3d20d4e4cce14ea6c3cbc7e4397d7.zip |
Rewrite agent to use {Domain,Address} tuples as far as possible
Diffstat (limited to 'lib/snmp/src/manager')
-rw-r--r-- | lib/snmp/src/manager/snmpm_config.erl | 6 | ||||
-rw-r--r-- | lib/snmp/src/manager/snmpm_net_if.erl | 2 | ||||
-rw-r--r-- | lib/snmp/src/manager/snmpm_net_if_mt.erl | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/snmp/src/manager/snmpm_config.erl b/lib/snmp/src/manager/snmpm_config.erl index 088f0c7fc8..69a6b4a3a9 100644 --- a/lib/snmp/src/manager/snmpm_config.erl +++ b/lib/snmp/src/manager/snmpm_config.erl @@ -313,7 +313,7 @@ mk_target_name(Domain, Address, Config) end; mk_target_name(Ip, Port, Config) when is_integer(Port), is_list(Config) -> - {Domain, Address} = snmp_conf:fix_domain_address(Ip, Port), + {Domain, Address} = snmp_conf:ip_port_to_domaddr(Ip, Port), mk_target_name(Domain, Address, Config). select_lowest_supported_version() -> @@ -403,7 +403,7 @@ unregister_agent(UserId, Domain, Address) when is_atom(Domain) -> {error, not_found} end; unregister_agent(UserId, Ip, Port) when is_integer(Port) -> - try snmp_conf:fix_domain_address(Ip, Port) of + try snmp_conf:ip_port_to_domaddr(Ip, Port) of {Domain, Address} -> do_unregister_agent(UserId, Domain, Address) catch @@ -448,7 +448,7 @@ agent_info(Domain, Address, Item) when is_atom(Domain) -> {error, not_found} end; agent_info(Ip, Port, Item) -> - try snmp_conf:fix_domain_address(Ip, Port) of + try snmp_conf:ip_port_to_domaddr(Ip, Port) of {Domain, Address} -> do_agent_info(Domain, Address, Item) catch diff --git a/lib/snmp/src/manager/snmpm_net_if.erl b/lib/snmp/src/manager/snmpm_net_if.erl index 39e239f2a2..e7167cdb6b 100644 --- a/lib/snmp/src/manager/snmpm_net_if.erl +++ b/lib/snmp/src/manager/snmpm_net_if.erl @@ -425,7 +425,7 @@ handle_cast(Msg, State) -> %%-------------------------------------------------------------------- handle_info({udp, Sock, Ip, Port, Bytes}, #state{sock = Sock} = State) -> ?vlog("received ~w bytes from ~p:~p [~w]", [size(Bytes), Ip, Port, Sock]), - {Domain, Address} = snmp_conf:fix_domain_address(Ip, Port), + {Domain, Address} = snmp_conf:ip_port_to_domaddr(Ip, Port), maybe_handle_recv_msg(Domain, Address, Bytes, State), {noreply, State}; diff --git a/lib/snmp/src/manager/snmpm_net_if_mt.erl b/lib/snmp/src/manager/snmpm_net_if_mt.erl index a04cfba2c1..594bc44474 100644 --- a/lib/snmp/src/manager/snmpm_net_if_mt.erl +++ b/lib/snmp/src/manager/snmpm_net_if_mt.erl @@ -435,7 +435,7 @@ handle_cast(Msg, State) -> %%-------------------------------------------------------------------- handle_info({udp, Sock, Ip, Port, Bytes}, #state{sock = Sock} = State) -> ?vlog("received ~w bytes from ~p:~p", [size(Bytes), Ip, Port]), - {Domain, Address} = snmp_conf:fix_domain_address(Ip, Port), + {Domain, Address} = snmp_conf:ip_port_to_domaddr(Ip, Port), handle_udp(Domain, Address, Bytes, State), {noreply, State}; |