aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/manager/snmpm_user.erl
blob: 78aa560b2e10a72bac85dad3056cac248a9a2056 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
%% 
%% %CopyrightBegin%
%% 
%% Copyright Ericsson AB 2004-2009. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
%% 
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
%% 
%% %CopyrightEnd%
%% 

-module(snmpm_user).

-export([behaviour_info/1]).

behaviour_info(callbacks) ->
    [{handle_error,    3}, 
     {handle_agent,    5}, 
     {handle_pdu,      4},
     {handle_trap,     3},
     {handle_inform,   3},
     {handle_report,   3}];
behaviour_info(_) ->
    undefined.


%% handle_error(ReqId, Reason, UserData) -> Reply
%% ReqId       -> integer()
%% Reason      -> term()
%% UserData    -> term()     (supplied when the user register)
%% Reply       -> ignore 

%% handle_agent(Addr, Port, Type, SnmpInfo, UserData) -> Reply
%% Addr        -> term()
%% Port        -> integer()
%% Type        -> pdu | trap | inform | report
%% SnmpInfo    -> {ErrorStatus, ErrorIndex, Varbinds}
%% UserId      -> term()
%% ErrorStatus -> atom()
%% ErrorIndex  -> integer()
%% Varbinds    -> [varbind()]
%% UserData    -> term()     (supplied when the user register)
%% Reply       -> ignore | {register, UserId, agent_info()}
%% agent_info() -> [{agent_info_item(), agent_info_value()}]
%%                 This is the same info as in update_agent_info/4

%% handle_pdu(TargetName, ReqId, SnmpResponse, UserData) -> Reply
%% TargetName   -> target_name()
%% ReqId        -> term() (returned when calling ag(...), ...)
%% SnmpResponse -> {ErrorStatus, ErrorIndex, Varbinds}
%% ErrorStatus  -> atom()
%% ErrorIndex   -> integer()
%% Varbinds     -> [varbind()]
%% UserData     -> term()     (supplied when the user register)
%% Reply        -> ignore 

%% handle_trap(TargetName, SnmpTrapInfo, UserData) -> Reply
%% TargetName   -> target_name()
%% SnmpTrapInfo -> {Enteprise, Generic, Spec, Timestamp, Varbinds} |
%%                 {ErrorStatus, ErrorIndex, Varbinds}
%% Enteprise    -> oid()
%% Generic      -> integer() 
%% Spec         -> integer() 
%% Timestamp    -> integer() 
%% ErrorStatus  -> atom()
%% ErrorIndex   -> integer()
%% Varbinds     -> [varbind()]
%% UserData     -> term()     (supplied when the user register)
%% Reply        -> ignore | unregister | {register, UserId, agent_info()}

%% handle_inform(TargetName, SnmpInform, UserData) -> Reply
%% TargetName  -> target_name()
%% SnmpInform  -> {ErrorStatus, ErrorIndex, Varbinds}
%% ErrorStatus -> atom()
%% ErrorIndex  -> integer()
%% Varbinds    -> [varbind()]
%% UserData    -> term()     (supplied when the user register)
%% Reply       -> ignore | unregister | {register, UserId, agent_info()}
%%          

%% handle_report(TargetName, SnmpReport, UserData) -> Reply
%% TargetName  -> target_name()
%% SnmpReport  -> {ErrorStatus, ErrorIndex, Varbinds}
%% ErrorStatus -> integer()
%% ErrorIndex  -> integer()
%% Varbinds    -> [varbind()]
%% UserData    -> term()     (supplied when the user register)
%% Reply       -> ignore | unregister | {register, UserId, agent_info()}