aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-04-08 11:43:21 +0200
committerMicael Karlberg <[email protected]>2011-04-08 11:43:21 +0200
commit293cb2901b3f559c5cf50c1fc4798091edd540a0 (patch)
treefbe0805b21a44868f791774205a544814f006e19 /lib
parentbb6e729795ebf3dddfcfd7182384bda59e9f6a94 (diff)
parent7354ffb0e5cde599fcad776febd33cdb234f30a7 (diff)
downloadotp-293cb2901b3f559c5cf50c1fc4798091edd540a0.tar.gz
otp-293cb2901b3f559c5cf50c1fc4798091edd540a0.tar.bz2
otp-293cb2901b3f559c5cf50c1fc4798091edd540a0.zip
Merge branch 'ks/snmp-specs' into bmk/snmp/snmp420_integration
OTP-9208
Diffstat (limited to 'lib')
-rw-r--r--lib/snmp/doc/src/notes.xml6
-rw-r--r--lib/snmp/src/agent/snmpa_usm.erl17
-rw-r--r--lib/snmp/src/app/snmp.appup.src8
-rw-r--r--lib/snmp/src/manager/snmpm_usm.erl5
4 files changed, 26 insertions, 10 deletions
diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml
index f5fa7065fb..7d31b9585d 100644
--- a/lib/snmp/doc/src/notes.xml
+++ b/lib/snmp/doc/src/notes.xml
@@ -44,6 +44,12 @@
-->
<list type="bulleted">
<item>
+ <p>Added type specs for functions that do not return. </p>
+ <p>Kostis Sagonas</p>
+ <p>Own Id: OTP-9174</p>
+ </item>
+
+ <item>
<p>[agent] Added support for sending traps to IPv6 targets. </p>
<p>See the
<seealso marker="snmp_agent_config_files#target_addr">target address config file</seealso>,
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.
-
-
-
-
-
diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src
index fd9f40caa0..be3bb7dffa 100644
--- a/lib/snmp/src/app/snmp.appup.src
+++ b/lib/snmp/src/app/snmp.appup.src
@@ -25,6 +25,8 @@
{"4.19",
[
{load_module, snmpm, soft_purge, soft_purge, []},
+ {load_module, snmpa_usm, soft_purge, soft_purge, []},
+ {load_module, snmpm_usm, soft_purge, soft_purge, []},
{load_module, snmp_conf, soft_purge, soft_purge, []},
{load_module, snmpa_conf, soft_purge, soft_purge, [snmp_conf]},
{load_module, snmp_misc, soft_purge, soft_purge, []},
@@ -49,6 +51,8 @@
{"4.18",
[
{load_module, snmpm, soft_purge, soft_purge, []},
+ {load_module, snmpa_usm, soft_purge, soft_purge, []},
+ {load_module, snmpm_usm, soft_purge, soft_purge, []},
{load_module, snmp_misc, soft_purge, soft_purge, []},
{load_module, snmp_conf, soft_purge, soft_purge, []},
{load_module, snmp_config, soft_purge, soft_purge, [snmp_conf]},
@@ -96,6 +100,8 @@
{"4.19",
[
{load_module, snmpm, soft_purge, soft_purge, []},
+ {load_module, snmpa_usm, soft_purge, soft_purge, []},
+ {load_module, snmpm_usm, soft_purge, soft_purge, []},
{load_module, snmp_conf, soft_purge, soft_purge, []},
{load_module, snmpa_conf, soft_purge, soft_purge, [snmp_conf]},
{load_module, snmp_misc, soft_purge, soft_purge, []},
@@ -120,6 +126,8 @@
{"4.18",
[
{load_module, snmpm, soft_purge, soft_purge, []},
+ {load_module, snmpa_usm, soft_purge, soft_purge, []},
+ {load_module, snmpm_usm, soft_purge, soft_purge, []},
{load_module, snmp_misc, soft_purge, soft_purge, []},
{load_module, snmp_conf, soft_purge, soft_purge, []},
{load_module, snmpa_conf, soft_purge, soft_purge, [snmp_conf]},
diff --git a/lib/snmp/src/manager/snmpm_usm.erl b/lib/snmp/src/manager/snmpm_usm.erl
index 449127844a..ef2070a90e 100644
--- a/lib/snmp/src/manager/snmpm_usm.erl
+++ b/lib/snmp/src/manager/snmpm_usm.erl
@@ -476,14 +476,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,