File: snmpm_user.html

package info (click to toggle)
erlang-doc-html 1%3A11.b.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 23,284 kB
  • ctags: 10,724
  • sloc: erlang: 505; ansic: 323; makefile: 62; perl: 61; sh: 45
file content (294 lines) | stat: -rw-r--r-- 9,749 bytes parent folder | download
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
  <TITLE>snmpm_user</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
  <STYLE TYPE="text/css">
<!--
    .REFBODY     { margin-left: 13mm }
    .REFTYPES    { margin-left: 8mm }
-->
  </STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
  <IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>snmpm_user</H1>
</CENTER>

<H3>MODULE</H3>
<DIV CLASS=REFBODY>
snmpm_user
</DIV>

<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
 Behaviour module for the SNMP manager user.

</DIV>

<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>

<P> This module defines the behaviour of the manager user. 
A <CODE>snmpm_user</CODE> compliant module 
must export the following functions: 
<P>
<UL>

<LI>
handle_error/3<BR>

</LI>


<LI>
handle_agent/4<BR>

</LI>


<LI>
handle_pdu/5<BR>

</LI>


<LI>
handle_trap/4<BR>

</LI>


<LI>
handle_inform/4<BR>

</LI>


<LI>
handle_report/4<BR>

</LI>


</UL>

<P>The semantics of them and their exact signatures are explained
below. <A NAME="handle_error"><!-- Empty --></A>
</DIV>

<H3>EXPORTS</H3>

<P><A NAME="handle_error/3"><STRONG><CODE>handle_error(ReqId, Reason, UserData) -&#62; Reply</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>ReqId = integer()</CODE></STRONG><BR>
<STRONG><CODE>Reason = {unexpected_pdu, SnmpInfo} | {invalid_sec_info, SecInfo, SnmpInfo} | {empty_message, Addr, Port} | term()</CODE></STRONG><BR>
<STRONG><CODE>Addr = ip_address()</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>UserData = term()</CODE></STRONG><BR>
<STRONG><CODE>Reply = ignore</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function is called when the manager needs to
         communicate an &#34;asynchronous&#34; error, to the user:
         e.g. failure to send an asynchroneous message (i.e. encoding
         error), a received message was discarded due to security
         error, the manager failed to generate a response message to
         a received inform-request, or when receiving an unexpected
         PDU from an agent (could be an expired async request). 
<P>If <CODE>ReqId</CODE> is less then 0, it means that this
         information was not available to the manager (that info was
         never retrieved before the message was discarded). 


<P>For <CODE>SnmpInfo</CODE> see handle_agent below.<A NAME="handle_agent"><!-- Empty --></A>
</DIV>

<P><A NAME="handle_agent/4"><STRONG><CODE>handle_agent(Addr, Port, SnmpInfo, UserData) -&#62; Reply</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Addr = ip_address()</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>SnmpInfo = {ErrorStatus, ErrorIndex, Varbinds}</CODE></STRONG><BR>
<STRONG><CODE>ErrorStatus = atom()</CODE></STRONG><BR>
<STRONG><CODE>ErrorIndex = integer()</CODE></STRONG><BR>
<STRONG><CODE>Varbinds = [varbind()]</CODE></STRONG><BR>
<STRONG><CODE>varbind() = #varbind</CODE></STRONG><BR>
<STRONG><CODE>UserData = term()</CODE></STRONG><BR>
<STRONG><CODE>Reply = ignore | {register, UserId, agent_info()}</CODE></STRONG><BR>
<STRONG><CODE>UserId = term()</CODE></STRONG><BR>
<STRONG><CODE>agent_info() = [{agent_info_item(), agent_info_value()}]</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function is called when a message is received from an 
         unknown agent.
<P>Note that this will always be the default user that is called.
<P>For more info about the <CODE>agent_info()</CODE>, see 
         <A HREF="snmpm.html#register_agent">register_agent</A>.
<P>The only user which would return 
         <CODE>{register, UserId, agent_info()}</CODE> is the 
         <STRONG>default user</STRONG>.<A NAME="handle_pdu"><!-- Empty --></A>
</DIV>

<P><A NAME="handle_pdu/5"><STRONG><CODE>handle_pdu(Addr, Port, ReqId, SnmpResponse, UserData) -&#62; Reply</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Addr = ip_address()</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>ReqId = term()</CODE></STRONG><BR>
<STRONG><CODE>SnmpResponse = {ErrorStatus, ErrorIndex, Varbinds}</CODE></STRONG><BR>
<STRONG><CODE>ErrorStatus = atom()</CODE></STRONG><BR>
<STRONG><CODE>ErrorIndex = integer()</CODE></STRONG><BR>
<STRONG><CODE>Varbinds = [varbind()]</CODE></STRONG><BR>
<STRONG><CODE>varbind() = #varbind</CODE></STRONG><BR>
<STRONG><CODE>UserData = term()</CODE></STRONG><BR>
<STRONG><CODE>Reply = ignore</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>Handle the reply to an asynchroneous request, such as 
         <A HREF="snmpm.html#ag">ag</A>, 
         <A HREF="snmpm.html#agn">agn</A> or 
         <A HREF="snmpm.html#as">as</A>.
<P>It could also be a late reply to a synchroneous request.
<P><CODE>ReqId</CODE> is returned by the asynchroneous request function.<A NAME="handle_trap"><!-- Empty --></A>
</DIV>

<P><A NAME="handle_trap/4"><STRONG><CODE>handle_trap(Addr, Port, SnmpTrapInfo, UserData) -&#62; Reply</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Addr = ip_address()</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>SnmpTrapInfo = {Enteprise, Generic, Spec, Timestamp, Varbinds} | {ErrorStatus, ErrorIndex, Varbinds}</CODE></STRONG><BR>
<STRONG><CODE>Enterprise = oid()</CODE></STRONG><BR>
<STRONG><CODE>Generic = integer()</CODE></STRONG><BR>
<STRONG><CODE>Spec = integer()</CODE></STRONG><BR>
<STRONG><CODE>Timestamp = integer()</CODE></STRONG><BR>
<STRONG><CODE>ErrorStatus = atom()</CODE></STRONG><BR>
<STRONG><CODE>ErrorIndex = integer()</CODE></STRONG><BR>
<STRONG><CODE>Varbinds = [varbind()]</CODE></STRONG><BR>
<STRONG><CODE>varbind() = #varbind</CODE></STRONG><BR>
<STRONG><CODE>UserData = term()</CODE></STRONG><BR>
<STRONG><CODE>Reply = ignore | unregister | {register, UserId, agent_info()}</CODE></STRONG><BR>
<STRONG><CODE>UserId = term()</CODE></STRONG><BR>
<STRONG><CODE>agent_info() = [{agent_info_item(), agent_info_value()}]</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>Handle a trap/notification message from an agent.
<P>For more info about the <CODE>agent_info()</CODE>, see 
         <A HREF="snmpm.html#register_agent">register_agent</A>
<P>The only user which would return 
         <CODE>{register, UserId, agent_info()}</CODE> is the 
         <STRONG>default user</STRONG>.<A NAME="handle_inform"><!-- Empty --></A>
</DIV>

<P><A NAME="handle_inform/4"><STRONG><CODE>handle_inform(Addr, Port, SnmpInfo, UserData) -&#62; Reply</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Addr = ip_address()</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>SnmpInfo = {ErrorStatus, ErrorIndex, Varbinds}</CODE></STRONG><BR>
<STRONG><CODE>ErrorStatus = atom()</CODE></STRONG><BR>
<STRONG><CODE>ErrorIndex = integer()</CODE></STRONG><BR>
<STRONG><CODE>Varbinds = [varbind()]</CODE></STRONG><BR>
<STRONG><CODE>varbind() = #varbind</CODE></STRONG><BR>
<STRONG><CODE>UserData = term()</CODE></STRONG><BR>
<STRONG><CODE>Reply = ignore | unregister | {register, UserId, agent_info()}</CODE></STRONG><BR>
<STRONG><CODE>UserId = term()</CODE></STRONG><BR>
<STRONG><CODE>agent_info() = [{agent_info_item(), agent_info_value()}]</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>Handle a inform message.
<P>For more info about the <CODE>agent_info()</CODE>, see 
         <A HREF="snmpm.html#register_agent">register_agent</A>
<P>The only user which would return 
         <CODE>{register, UserId, agent_info()}</CODE> is the 
         <STRONG>default user</STRONG>.
<P>If the 
<A HREF="snmp_app.html">inform request behaviour</A> 
configuration option is set to <CODE>user</CODE> or 
<CODE>{user, integer()}</CODE>, the response (acknowledgement) to this 
inform-request will be sent when this function returnes.<A NAME="handle_report"><!-- Empty --></A>
</DIV>

<P><A NAME="handle_report/4"><STRONG><CODE>handle_report(Addr, Port, SnmpInfo, UserData) -&#62; Reply</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Addr = ip_address()</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>SnmpInfo = {ErrorStatus, ErrorIndex, Varbinds}</CODE></STRONG><BR>
<STRONG><CODE>ErrorStatus = atom()</CODE></STRONG><BR>
<STRONG><CODE>ErrorIndex = integer()</CODE></STRONG><BR>
<STRONG><CODE>Varbinds = [varbind()]</CODE></STRONG><BR>
<STRONG><CODE>varbind() = #varbind</CODE></STRONG><BR>
<STRONG><CODE>UserData = term()</CODE></STRONG><BR>
<STRONG><CODE>Reply = ignore | unregister | {register, UserId, agent_info()}</CODE></STRONG><BR>
<STRONG><CODE>UserId = term()</CODE></STRONG><BR>
<STRONG><CODE>agent_info() = [{agent_info_item(), agent_info_value()}]</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>Handle a report message.
<P>For more info about the <CODE>agent_info()</CODE>, see 
         <A HREF="snmpm.html#register_agent">register_agent</A>
<P>The only user which would return 
         <CODE>{register, UserId, agent_info()}</CODE> is the 
         <STRONG>default user</STRONG>.
</DIV>

<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Micael Karlberg - support@erlang.ericsson.se<BR>

</DIV>
<CENTER>
<HR>
<SMALL>snmp 4.8.2<BR>
Copyright &copy; 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>