From 04b795f59e678e550fb8c7650952c5ded1096cef Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 14 Jun 2019 11:13:34 +0200 Subject: [snmp|agent] Dialyzer related changes Changes to satisfy dialyzer. Including changing the definition of some of the behaviours (use the '-callback' attribute instead of an explicit behaviour_info/1 function). Also found and corrected some (apparently minor) bugs. OTP-15932 --- lib/snmp/src/agent/snmpa_set_mechanism.erl | 37 ++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'lib/snmp/src/agent/snmpa_set_mechanism.erl') diff --git a/lib/snmp/src/agent/snmpa_set_mechanism.erl b/lib/snmp/src/agent/snmpa_set_mechanism.erl index 2f24f38092..4eee7d7257 100644 --- a/lib/snmp/src/agent/snmpa_set_mechanism.erl +++ b/lib/snmp/src/agent/snmpa_set_mechanism.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2016. All Rights Reserved. +%% Copyright Ericsson AB 2004-2019. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -19,18 +19,26 @@ %% -module(snmpa_set_mechanism). --export([behaviour_info/1]). - -behaviour_info(callbacks) -> - [{do_set, 2}, {do_subagent_set, 1}]; -behaviour_info(_) -> - undefined. +%% -export([behaviour_info/1]). +%% behaviour_info(callbacks) -> +%% [{do_set, 2}, {do_subagent_set, 1}]; +%% behaviour_info(_) -> +%% undefined. + %%----------------------------------------------------------------- %% do_set(MibView, UnsortedVarbinds) %%----------------------------------------------------------------- +-callback do_set(MibView, UnsortedVBs) -> + {noError, 0} | {ErrStatus, ErrIndex} when + MibView :: snmp_view_based_acm_mib:mibview(), + UnsortedVBs :: [snmp:varbind()], + ErrStatus :: snmp:error_status(), + ErrIndex :: snmp:error_index(). + + %%----------------------------------------------------------------- %% do_subagent_set(Args) %% @@ -41,3 +49,18 @@ behaviour_info(_) -> %% [phase_two, set, UnsortedVarbinds] %% [phase_two, undo, UnsortedVarbinds] %%----------------------------------------------------------------- + +%% -callback do_subagent_set(Args) -> +%% {noError, 0} | {ErrStatus, ErrIndex} when +%% Args :: [phase_one, UnsortedVBs] | +%% [phase_two, set, UnsortedVBs] | +%% [phase_two, undo, UnsortedVBs], +%% ErrStatus :: snmp:error_status(), +%% ErrIndex :: snmp:error_index(), +%% UnsortedVBs :: [snmp:varbind()]. + +-callback do_subagent_set(Args) -> + {noError, 0} | {ErrStatus, ErrIndex} when + Args :: list(), + ErrStatus :: snmp:error_status(), + ErrIndex :: snmp:error_index(). -- cgit v1.2.3