aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/manager/snmpm_usm.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snmp/src/manager/snmpm_usm.erl')
-rw-r--r--lib/snmp/src/manager/snmpm_usm.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/snmp/src/manager/snmpm_usm.erl b/lib/snmp/src/manager/snmpm_usm.erl
index 8cb3062d4b..497d6d6102 100644
--- a/lib/snmp/src/manager/snmpm_usm.erl
+++ b/lib/snmp/src/manager/snmpm_usm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-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
@@ -23,6 +23,10 @@
-module(snmpm_usm).
+%% Avoid warning for local function error/1 clashing with autoimported BIF.
+-compile({no_auto_import,[error/1]}).
+%% Avoid warning for local function error/2 clashing with autoimported BIF.
+-compile({no_auto_import,[error/2]}).
-export([init/0,
reset/0,
process_incoming_msg/4, generate_outgoing_msg/5]).
@@ -472,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,