aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_usm.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-05-16 10:09:25 +0200
committerMicael Karlberg <[email protected]>2011-05-16 10:09:25 +0200
commit3e907e4468651206b8c6c97290e37a5a82102e2f (patch)
treeb9a39fe5fc37c32313f7ae89f2f98a4a68ccfd40 /lib/snmp/src/agent/snmpa_usm.erl
parentb19a2c6648e65b5ad1b8a0351928856fad941f99 (diff)
parentc2a1108ff4cfdb2a5763349e4f505bed49871cc8 (diff)
downloadotp-3e907e4468651206b8c6c97290e37a5a82102e2f.tar.gz
otp-3e907e4468651206b8c6c97290e37a5a82102e2f.tar.bz2
otp-3e907e4468651206b8c6c97290e37a5a82102e2f.zip
OTP-9022: Fixed endode/decode of values of type Counter32.
OTP-9088: [agent] Added support for sending traps to IPv6 targets. OTP-9119: [agent] To be able to handle multiple engine-id(s) when sending trap(s), the function snmp_community_mib:add_community/6 has been added. OTP-9162: [manager] The API for snmp requests has been augmented to allow the caller to override some configuration. OTP-9174: [manager] The old API functions (for get and set requests) are now officially deprecated. OTP-9183: [agent] Pass extra info through the agent to the net-if process when sending notifications. OTP-9208: Added type specs for functions that do not return. Kostis Sagonas Merge branch 'bmk/snmp/snmp420_integration' into dev
Diffstat (limited to 'lib/snmp/src/agent/snmpa_usm.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_usm.erl17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/snmp/src/agent/snmpa_usm.erl b/lib/snmp/src/agent/snmpa_usm.erl
index f35d1f1916..6f54307f9f 100644
--- a/lib/snmp/src/agent/snmpa_usm.erl
+++ b/lib/snmp/src/agent/snmpa_usm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -330,7 +330,6 @@ non_authoritative(SecName,
end
end.
-
is_auth(?usmNoAuthProtocol, _, _, _, SecName, _, _, _, _) -> % 3.2.5
error(usmStatsUnsupportedSecLevels,
?usmStatsUnsupportedSecLevels_instance, SecName); % OTP-5464
@@ -613,8 +612,7 @@ authenticate_outgoing(Message, UsmSecParams,
end,
?vtrace("authenticate_outgoing -> encode message only",[]),
snmp_pdus:enc_message_only(Message2).
-
-
+
%%-----------------------------------------------------------------
%% Auth and priv algorithms
@@ -753,14 +751,19 @@ set_engine_latest_time(SnmpEngineID, EngineTime) ->
%%-----------------------------------------------------------------
%% Utility functions
%%-----------------------------------------------------------------
+-spec error(term()) -> no_return().
error(Reason) ->
throw({error, Reason}).
+-spec error(term(), term()) -> no_return().
error(Reason, ErrorInfo) ->
throw({error, Reason, ErrorInfo}).
+-spec error(term(), term(), term()) -> no_return().
error(Variable, Oid, SecName) ->
error(Variable, Oid, SecName, []).
+
+-spec error(term(), term(), term(), [term()]) -> no_return().
error(Variable, Oid, SecName, Opts) ->
Val = inc(Variable),
ErrorInfo = {#varbind{oid = Oid,
@@ -772,7 +775,6 @@ error(Variable, Oid, SecName, Opts) ->
inc(Name) -> ets:update_counter(snmp_agent_table, Name, 1).
-
get_counter(Name) ->
case (catch ets:lookup(snmp_agent_table, Name)) of
[{_, Val}] ->
@@ -780,8 +782,3 @@ get_counter(Name) ->
_ ->
0
end.
-
-
-
-
-