aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmp_target_mib.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-03-03 14:27:32 +0100
committerMicael Karlberg <[email protected]>2011-03-03 14:27:32 +0100
commit4526ec71fc913993ec6c5f0a9c0e11192240a60a (patch)
treea77f5209a2fc5459805836121d76cd883915aa09 /lib/snmp/src/agent/snmp_target_mib.erl
parentd711ad48d29ea87398880e2655db72455334bf07 (diff)
downloadotp-4526ec71fc913993ec6c5f0a9c0e11192240a60a.tar.gz
otp-4526ec71fc913993ec6c5f0a9c0e11192240a60a.tar.bz2
otp-4526ec71fc913993ec6c5f0a9c0e11192240a60a.zip
Handling target address configuration files (with new Domain).
Also added some proper documentation.
Diffstat (limited to 'lib/snmp/src/agent/snmp_target_mib.erl')
-rw-r--r--lib/snmp/src/agent/snmp_target_mib.erl21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl
index c76e4bb173..c7fc449bd2 100644
--- a/lib/snmp/src/agent/snmp_target_mib.erl
+++ b/lib/snmp/src/agent/snmp_target_mib.erl
@@ -29,6 +29,7 @@
-export([add_addr/10, delete_addr/1,
add_params/5, delete_params/1]).
-export([check_target_addr/1, check_target_params/1]).
+-export([default_domain/0]).
-include_lib("snmp/include/snmp_types.hrl").
-include_lib("snmp/include/snmp_tables.hrl").
@@ -50,6 +51,12 @@
%%-----------------------------------------------------------------
+
+default_domain() ->
+ snmpUDPDomain.
+
+
+%%-----------------------------------------------------------------
%% Func: configure/1
%% Args: Dir is the directory where the configuration files are found.
%% Purpose: If the tables doesn't exist, this function reads
@@ -140,8 +147,6 @@ read_target_config_files(Dir) ->
%% {Name, Ip, Udp, Timeout, RetryCount, TagList, Params, EngineId,
%% TMask, MMS}
%%-----------------------------------------------------------------
-default_domain() ->
- snmpUDPDomain.
check_target_addr({Name, Domain, Ip, Udp, Timeout, RetryCount, TagList,
Params, EngineId, TMask, MMS}) ->
@@ -172,7 +177,7 @@ check_target_addr({Name, Domain, Ip, Udp, Timeout, RetryCount, TagList,
check_engine_id(EngineId),
TAddress = snmp_conf:mk_taddress(Domain, Ip, Udp),
TDomain = snmp_conf:mk_tdomain(Domain),
- check_mask(TDomain, TMask, TAddress),
+ check_tmask(TDomain, TMask, TAddress),
snmp_conf:check_packet_size(MMS),
?vtrace("check target address done",[]),
Addr = {Name, TDomain, TAddress, Timeout,
@@ -210,12 +215,12 @@ check_engine_id(EngineId) ->
snmp_conf:check_string(EngineId).
-check_mask(_TDomain, [], _TAddress) ->
+check_tmask(_TDomain, [], _TAddress) ->
ok;
-check_mask(TDomain, TMask, TAddress) when length(TMask) =:= length(TAddress) ->
+check_tmask(TDomain, TMask, TAddress) when length(TMask) =:= length(TAddress) ->
snmp_conf:check_taddress(TDomain, TMask);
-check_mask(_TDomain, TMask, _TAddr) ->
- throw({error, {invalid_mask, TMask}}).
+check_tmask(_TDomain, TMask, _TAddr) ->
+ throw({error, {invalid_tmask, TMask}}).
%%-----------------------------------------------------------------
@@ -637,7 +642,7 @@ snmpTargetAddrTable(get, RowIndex, Cols) ->
snmpTargetAddrTable(get_next, RowIndex, Cols) ->
next(snmpTargetAddrTable, RowIndex, Cols);
snmpTargetAddrTable(set, RowIndex, Cols0) ->
- %% BMK BMK BMK
+ %% BMK BMK
case (catch verify_targetAddrTable_cols(Cols0)) of
{ok, Cols} ->
snmp_notification_mib:invalidate_cache(),