aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_network_interface.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snmp/src/agent/snmpa_network_interface.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_network_interface.erl78
1 files changed, 53 insertions, 25 deletions
diff --git a/lib/snmp/src/agent/snmpa_network_interface.erl b/lib/snmp/src/agent/snmpa_network_interface.erl
index 699fbde671..24985c113e 100644
--- a/lib/snmp/src/agent/snmpa_network_interface.erl
+++ b/lib/snmp/src/agent/snmpa_network_interface.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,28 +19,56 @@
%%
-module(snmpa_network_interface).
--export([behaviour_info/1]).
-
-behaviour_info(callbacks) ->
- [{start_link, 4},
- {get_log_type, 1},
- {set_log_type, 2},
- {get_request_limit, 1},
- {set_request_limit, 2},
- {info, 1},
- {verbosity, 2}];
-behaviour_info(_) ->
- undefined.
-
-
-%% behaviour_info(callbacks) ->
-%% [{start_link, 4},
-%% {send_pdu, 5},
-%% {send_response_pdu, 6},
-%% {discard_pdu, 6},
-%% {send_pdu_req, 6},
-%% {verbosity, 2},
-%% {change_log_type, 2}];
-%% behaviour_info(_) ->
-%% undefined.
+%% Note that this behaviour is not enough!
+%% There is also a set of mandatory messages which the
+%% network interface entity must be able to receive and
+%% be able to send. See the documentation for more info.
+
+-callback start_link(Prio, NoteStore, MasterAgent, Opts) ->
+ {ok, Pid} | {error, Reason} when
+ Prio :: low | normal | high, % priority_level(),
+ NoteStore :: pid(),
+ MasterAgent :: pid(),
+ Opts :: [Option],
+ Option :: {verbosity, snmp:verbosity()} |
+ {versions, [snmp:version()]} |
+ term(),
+ Pid :: pid(),
+ Reason :: term().
+
+-callback info(Pid) ->
+ Info when
+ Pid :: pid(),
+ Info :: [{Key, Value}],
+ Key :: term(),
+ Value :: term().
+
+-callback verbosity(Pid, Verbosity) ->
+ snmp:void() when
+ Pid :: pid(),
+ Verbosity :: snmp:verbosity().
+
+-callback get_log_type(Pid) ->
+ {ok, LogType} | {error, Reason} when
+ Pid :: pid(),
+ LogType :: snmp:atl_type(),
+ Reason :: term().
+
+-callback set_log_type(Pid, NewType) ->
+ {ok, OldType} | {error, Reason} when
+ Pid :: pid(),
+ NewType :: snmp:atl_type(),
+ OldType :: snmp:atl_type(),
+ Reason :: term().
+
+-callback get_request_limit(Pid) ->
+ {ok, Limit} when
+ Pid :: pid(),
+ Limit :: non_neg_integer() | infinity.
+
+-callback set_request_limit(Pid, NewLimit) ->
+ {ok, OldLimit} when
+ Pid :: pid(),
+ NewLimit :: non_neg_integer() | infinity,
+ OldLimit :: non_neg_integer() | infinity.