aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/app
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2013-09-10 10:18:53 +0200
committerMicael Karlberg <[email protected]>2013-10-09 10:37:43 +0200
commit7558861af77de9405decc8d88b2c799e15f266da (patch)
tree05cebcea60b2e73a1f72577e7a130f93f7b9ee29 /lib/snmp/src/app
parenta49cb1b7492b4c34f5887eaa0cb7774c693a524d (diff)
downloadotp-7558861af77de9405decc8d88b2c799e15f266da.tar.gz
otp-7558861af77de9405decc8d88b2c799e15f266da.tar.bz2
otp-7558861af77de9405decc8d88b2c799e15f266da.zip
[snmp/manager] Improve handling of unexpected/invalid snmpm_user callbacks
Improved handling of unexpected return values from snmpm_user callback functions. Violations of the documented API (crashes or invalid return values) will now result in an error message. Updated doc for snmpm_user bahaviour and some other stuff. Add more (common) type defs. Update manager example. Fixed manager test(s). Fixed unused vars in (manager) test suite. Make test user follow defined behaviour.
Diffstat (limited to 'lib/snmp/src/app')
-rw-r--r--lib/snmp/src/app/snmp.appup.src42
-rw-r--r--lib/snmp/src/app/snmp.erl52
-rw-r--r--lib/snmp/src/app/snmp_internal.hrl4
3 files changed, 94 insertions, 4 deletions
diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src
index 16b626111b..7bd50c2c4d 100644
--- a/lib/snmp/src/app/snmp.appup.src
+++ b/lib/snmp/src/app/snmp.appup.src
@@ -29,11 +29,32 @@
%% {add_module, snmpm_net_if_mt}
[
+ {"4.24.2",
+ [
+ {load_module, snmp, soft_purge, soft_purge, []},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmpm_user, soft_purge, soft_purge, [snmp, snmpm]},
+ {load_module, snmpm_user_default, soft_purge, soft_purge, [snmpm_user]},
+ {update, snmpm_server, soft, soft_purge, soft_purge, [snmpm_user]}
+ ]
+ },
+ {"4.24.1",
+ [
+ {load_module, snmpa, soft_purge, soft_purge, [snmpa_agent]},
+ {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_agent]},
+ {update, snmpa_mib, soft, soft_purge, soft_purge, []}
+ ]
+ },
{"4.24",
[
+ {load_module, snmp, soft_purge, soft_purge, []},
{load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmpm_user, soft_purge, soft_purge, [snmp, snmpm]},
+ {load_module, snmpm_user_default, soft_purge, soft_purge, [snmpm_user]},
{load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
[snmp_conf]},
+ {update, snmpm_server, soft, soft_purge, soft_purge, [snmpm_user]},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []}
]
},
@@ -47,11 +68,32 @@
%% {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
[
+ {"4.24.2",
+ [
+ {load_module, snmp, soft_purge, soft_purge, []},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmpm_user, soft_purge, soft_purge, [snmp, snmpm]},
+ {load_module, snmpm_user_default, soft_purge, soft_purge, [snmpm_user]},
+ {update, snmpm_server, soft, soft_purge, soft_purge, [snmpm_user]}
+ ]
+ },
+ {"4.24.1",
+ [
+ {load_module, snmpa, soft_purge, soft_purge, [snmpa_agent]},
+ {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_agent]},
+ {update, snmpa_mib, soft, soft_purge, soft_purge, []}
+ ]
+ },
{"4.24",
[
+ {load_module, snmp, soft_purge, soft_purge, []},
{load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmpm_user, soft_purge, soft_purge, [snmp, snmpm]},
+ {load_module, snmpm_user_default, soft_purge, soft_purge, [snmpm_user]},
{load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
[snmp_conf]},
+ {update, snmpm_server, soft, soft_purge, soft_purge, [snmpm_user]},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []}
]
},
diff --git a/lib/snmp/src/app/snmp.erl b/lib/snmp/src/app/snmp.erl
index 1bb562654a..a37979f5eb 100644
--- a/lib/snmp/src/app/snmp.erl
+++ b/lib/snmp/src/app/snmp.erl
@@ -91,8 +91,30 @@
]).
-export_type([
+ snmp_timer/0,
+
+ engine_id/0,
+ tdomain/0,
+ community/0,
+ mms/0,
+ version/0,
+ sec_model/0,
+ sec_name/0,
+ sec_level/0,
+
oid/0,
-
+ varbind/0,
+ ivarbind/0,
+ asn1_type/0,
+ table_info/0,
+ variable_info/0,
+ me/0,
+ trap/0,
+ notification/0,
+ pdu/0,
+ trappdu/0,
+ mib/0,
+
void/0
]).
@@ -149,14 +171,38 @@
-define(APPLICATION, snmp).
+-include_lib("snmp/include/snmp_types.hrl").
%%-----------------------------------------------------------------
%% Types
%%-----------------------------------------------------------------
--type oid() :: [non_neg_integer()].
--type void() :: term().
+-type snmp_timer() :: #snmp_incr_timer{}.
+
+-type engine_id() :: string().
+-type tdomain() :: transportDomainUdpIpv4 | transportDomainUdpIpv6.
+-type community() :: string().
+-type mms() :: non_neg_integer().
+-type version() :: v1 | v2 | v3.
+-type sec_model() :: any | v1 | v2c | usm.
+-type sec_name() :: string().
+-type sec_level() :: noAuthNoPriv | authNoPriv | authPriv.
+
+-type oid() :: [non_neg_integer()].
+-type varbind() :: #varbind{}.
+-type ivarbind() :: #ivarbind{}.
+-type asn1_type() :: #asn1_type{}.
+-type table_info() :: #table_info{}.
+-type variable_info() :: #variable_info{}.
+-type me() :: #me{}.
+-type trap() :: #trap{}.
+-type notification() :: #notification{}.
+-type mib() :: #mib{}.
+-type pdu() :: #pdu{}.
+-type trappdu() :: #trappdu{}.
+
+-type void() :: term().
%%-----------------------------------------------------------------
diff --git a/lib/snmp/src/app/snmp_internal.hrl b/lib/snmp/src/app/snmp_internal.hrl
index 5ff715e0b7..f04fa4dd53 100644
--- a/lib/snmp/src/app/snmp_internal.hrl
+++ b/lib/snmp/src/app/snmp_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2013. 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
@@ -24,6 +24,8 @@
-define(APPLICATION, snmp).
-endif.
+-define(STACK(), erlang:get_stacktrace()).
+
-define(snmp_info(C, F, A), ?snmp_msg(info_msg, C, F, A)).
-define(snmp_warning(C, F, A), ?snmp_msg(warning_msg, C, F, A)).
-define(snmp_error(C, F, A), ?snmp_msg(error_msg, C, F, A)).