File: snmp_manager_netif.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 (253 lines) | stat: -rw-r--r-- 5,399 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
  <TITLE>Definition of Manager Net if</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<CENTER>
<A HREF="http://www.erlang.se"><IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif"></A>
</CENTER>
<A NAME="13"><!-- Empty --></A>
<H2>13 Definition of Manager Net if</H2>

<P>
<P>
<CENTER>
<IMG ALT="snmp_manager_netif_1" SRC="snmp_manager_netif_1.gif"><BR>
<EM>The Purpose of Manager Net if</EM>

</CENTER>

<P>The Network Interface (Net if) process delivers SNMP PDUs to the
manager server, and receives SNMP PDUs from the manager server. 
The most common behaviour of a Net if process is that is receives 
request PDU from the manager server, encodes the PDU into bytes
and transmits the bytes onto the network to an agent. When the 
reply from the agent is received by the Net if process, which it
decodes into an SNMP PDU, which it sends to the manager server.


<P>However, that simple behaviour can be modified in numerous
ways. For example, the Net if process can apply some kind of
encrypting/decrypting scheme on the bytes.


<P>It is also possible to write your own Net if process. The default
Net if process is implemented in the module <CODE>snmpm_net_if</CODE> and
it uses UDP as the transport protocol.


<P>This section describes how to write a Net if process.

<A NAME="mandatory_functions"><!-- Empty --></A><A NAME="13.1"><!-- Empty --></A>
<H3>13.1 Mandatory Functions</H3>

<P>A Net if process must implement the SNMP manager 
<A HREF="snmpm_network_interface.html">network interface behaviour</A>.

<A NAME="13.2"><!-- Empty --></A>
<H3>13.2 Messages</H3>

<P>The section <STRONG>Messages</STRONG> describes mandatory messages, which
Net if must send to the manager server process. 


<P>Net if must send the following message when it receives an
SNMP PDU from the network that is aimed for the MasterAgent:


<PRE>
Server ! {snmp_pdu, Pdu, Addr, Port}
    
</PRE>

<P>
<UL>

<LI>
        <CODE>Pdu</CODE> is an SNMP PDU record, as defined in
         <CODE>snmp_types.hrl</CODE>, with the SNMP request.
<BR>

</LI>


<LI>
        <CODE>Addr</CODE> is the source address. 
<BR>

</LI>


<LI>
        <CODE>Port</CODE> is port number of the sender.
<BR>

</LI>


</UL>

<PRE>
Server ! {snmp_trap, Trap, Addr, Port}
    
</PRE>

<P>
<UL>

<LI>
        <CODE>Trap</CODE> is aither an SNMP pdu record or an trappdu record, 
         as defined in <CODE>snmp_types.hrl</CODE>, with the SNMP request.
<BR>

</LI>


<LI>
        <CODE>Addr</CODE> is the source address. 
<BR>

</LI>


<LI>
        <CODE>Port</CODE> is port number of the sender.
<BR>

</LI>


</UL>

<PRE>
Server ! {snmp_inform, Ref, Pdu, PduMS, Addr, Port}
    
</PRE>

<P>
<UL>

<LI>
        <CODE>Ref</CODE> is either the atom <CODE>ignore</CODE> or something
         that can be used to identify the inform-request (e.g. request-id).
         <CODE>ignore</CODE> is used if the response (acknowledgement) to the
inform-request has already been sent (this means that the server 
will not make the call to the 
<A HREF="snmpm_network_interface.html#inform_response">inform_response</A> 
function). See the 
<A HREF="snmp_app.html">inform request behaviour</A> 
configuration option for more info.
<BR>

</LI>


<LI>
        <CODE>Pdu</CODE> is an SNMP PDU record, as defined in
         <CODE>snmp_types.hrl</CODE>, with the SNMP request.
<BR>

</LI>


<LI>
        <CODE>Addr</CODE> is the source address. 
<BR>

</LI>


<LI>
        <CODE>Port</CODE> is port number of the sender.
<BR>

</LI>


</UL>

<PRE>
Server ! {snmp_report, Data, Addr, Port}
    
</PRE>

<P>
<UL>

<LI>
        <CODE>Data</CODE> is either <CODE>{ok, Pdu}</CODE> or 
         <CODE>{error, ReqId, ReasonInfo, Pdu}</CODE>. Which one is used depends 
         on the return value from the MPD 
         <A HREF="snmpm_mpd.html#process_msg">   process_msg</A> function. If the MsgData is <CODE>ok</CODE>, 
         the first is used, and if it is <CODE>{error, ReqId, Reason}</CODE>
         the latter is used.
<BR>

</LI>


<LI>
        <CODE>Pdu</CODE> is an SNMP PDU record, as defined in
         <CODE>snmp_types.hrl</CODE>, with the SNMP request.
<BR>

</LI>


<LI>
        <CODE>ReqId</CODE> is an integer.
<BR>

</LI>


<LI>
        <CODE>ReasonInfo</CODE> is a term().
<BR>

</LI>


<LI>
        <CODE>Addr</CODE> is the source address. 
<BR>

</LI>


<LI>
        <CODE>Port</CODE> is port number of the sender.
<BR>

</LI>


</UL>
<A NAME="13.2.1"><!-- Empty --></A>
<H4>13.2.1 Notes</H4>

<P>Since the Net if process is responsible for encoding and
        decoding of SNMP messages, it must also update the relevant
        counters in the SNMP group in MIB-II. It can use the functions
        in the module <CODE>snmpm_mpd</CODE> for this purpose (refer to the 
        Reference Manual, section <CODE>snmp</CODE>, module <CODE>snmpm_mpd</CODE>
        for more details).
        

<P>There are also some useful functions for encoding and
        decoding of SNMP messages in the module <CODE>snmp_pdus</CODE>.

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