~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/snmp/doc/src/snmp_agent_netif.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-05-07 15:07:37 UTC
  • mfrom: (1.2.1 upstream) (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090507150737-i4yb5elwinm7r0hc
Tags: 1:13.b-dfsg1-1
* Removed another bunch of non-free RFCs from original tarball
  (closes: #527053).
* Fixed build-dependencies list by adding missing comma. This requires
  libsctp-dev again. Also, added libsctp1 dependency to erlang-base and
  erlang-base-hipe packages because the shared library is loaded via
  dlopen now and cannot be added using dh_slibdeps (closes: #526682).
* Weakened dependency of erlang-webtool on erlang-observer to recommends
  to avoid circular dependencies (closes: #526627).
* Added solaris-i386 to HiPE enabled architectures.
* Made script sources in /usr/lib/erlang/erts-*/bin directory executable,
  which is more convenient if a user wants to create a target Erlang system.
* Shortened extended description line for erlang-dev package to make it
  fit 80x25 terminals.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE chapter SYSTEM "chapter.dtd">
 
3
 
 
4
<chapter>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>1997</year><year>2009</year>
 
8
      <holder>Ericsson AB. All Rights Reserved.</holder>
 
9
    </copyright>
 
10
    <legalnotice>
 
11
      The contents of this file are subject to the Erlang Public License,
 
12
      Version 1.1, (the "License"); you may not use this file except in
 
13
      compliance with the License. You should have received a copy of the
 
14
      Erlang Public License along with this software. If not, it can be
 
15
      retrieved online at http://www.erlang.org/.
 
16
    
 
17
      Software distributed under the License is distributed on an "AS IS"
 
18
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
19
      the License for the specific language governing rights and limitations
 
20
      under the License.
 
21
    
 
22
    </legalnotice>
 
23
 
 
24
    <title>Definition of Agent Net if</title>
 
25
    <prepared></prepared>
 
26
    <responsible></responsible>
 
27
    <docno></docno>
 
28
    <approved></approved>
 
29
    <checked></checked>
 
30
    <date></date>
 
31
    <rev></rev>
 
32
    <file>snmp_agent_netif.xml</file>
 
33
  </header>
 
34
  <p></p>
 
35
  <image file="snmp_agent_netif_1">
 
36
    <icaption>The Purpose of Agent Net if</icaption>
 
37
  </image>
 
38
  <p>The Network Interface (Net if) process delivers SNMP PDUs to a
 
39
    master agent, and receives SNMP PDUs from the master agent. The most
 
40
    common behaviour of a Net if process is that is receives bytes from
 
41
    a network, decodes them into an SNMP PDU, which it sends to a master
 
42
    agent. When the master agent has processed the PDU, it sends a
 
43
    response PDU to the Net if process, which encodes the PDU into bytes
 
44
    and transmits the bytes onto the network.
 
45
    </p>
 
46
  <p>However, that simple behaviour can be modified in numerous
 
47
    ways. For example, the Net if process can apply some kind of
 
48
    encrypting/decrypting scheme on the bytes or
 
49
    act as a proxy filter, which sends some packets to a proxy agent and
 
50
    some packets to the master agent.
 
51
    </p>
 
52
  <p>It is also possible to write your own Net if process. The default
 
53
    Net if process is implemented in the module <c>snmpa_net_if</c> and
 
54
    it uses UDP as the transport protocol.
 
55
    </p>
 
56
  <p>This section describes how to write a Net if process.
 
57
    </p>
 
58
 
 
59
  <section>
 
60
    <marker id="mandatory_functions"></marker>
 
61
    <title>Mandatory Functions</title>
 
62
    <p>A Net if process must implement the SNMP agent 
 
63
      <seealso marker="snmpa_network_interface">network interface behaviour</seealso>.
 
64
      </p>
 
65
  </section>
 
66
 
 
67
  <section>
 
68
    <title>Messages</title>
 
69
    <p>The section <em>Messages</em> describes mandatory messages, which
 
70
      Net if must send and be able to receive.     
 
71
      </p>
 
72
 
 
73
    <section>
 
74
      <title>Outgoing Messages</title>
 
75
      <p>Net if must send the following message when it receives an
 
76
        SNMP PDU from the network that is aimed for the MasterAgent:
 
77
        </p>
 
78
      <pre>
 
79
MasterAgent ! {snmp_pdu, Vsn, Pdu, PduMS, ACMData, From, Extra}
 
80
      </pre>
 
81
      <list type="bulleted">
 
82
        <item><c>Vsn</c> is either <c>'version-1'</c>,
 
83
        <c>'version-2'</c>, or <c>'version-3'</c>.
 
84
        </item>
 
85
        <item><c>Pdu</c> is an SNMP PDU record, as defined in
 
86
        <c>snmp_types.hrl</c>, with the SNMP request.
 
87
        </item>
 
88
        <item><c>PduMS</c> is the Maximum Size of the response Pdu
 
89
         allowed.  Normally this is returned from
 
90
        <c>snmpa_mpd:process_packet</c> (see Reference Manual).
 
91
        </item>
 
92
        <item><c>ACMData</c> is data used by the Access Control Module
 
93
         in use.  Normally this is returned from
 
94
        <c>snmpa_mpd:process_packet</c> (see Reference Manual).
 
95
        </item>
 
96
        <item><c>From</c> is the source address. If UDP over IP is
 
97
         used, this should be a 2-tuple <c>{IP, UDPport}</c>, where
 
98
        <c>IP</c> is a 4-tuple with the IP address, and <c>UDPport</c>
 
99
         is an integer.
 
100
        </item>
 
101
        <item><c>Extra</c> is any term the Net if process wishes to
 
102
         send to the agent. This term can be retrieved by the
 
103
         instrumentation functions by calling
 
104
        <c>snmp:current_net_if_data()</c>. This data is also sent back
 
105
         to the Net if process when the agent generates a response to
 
106
         the request.</item>
 
107
      </list>
 
108
      <p>The following message is used to report that a response to a
 
109
        request has been received.  The only request an agent can send
 
110
        is an Inform-Request.
 
111
        </p>
 
112
      <pre>
 
113
Pid ! {snmp_response_received, Vsn, Pdu, From}
 
114
      </pre>
 
115
      <list type="bulleted">
 
116
        <item><c>Pid</c> is the Process that waits for the response
 
117
         for the request.  The Pid was specified in the
 
118
        <c>send_pdu_req</c> message <seealso marker="#message">(see below)</seealso>.
 
119
        </item>
 
120
        <item><c>Vsn</c> is either <c>'version-1'</c>, <c>'version-2'</c>, or
 
121
        <c>'version-3'</c>.
 
122
        </item>
 
123
        <item><c>Pdu</c> is the SNMP Pdu received
 
124
        </item>
 
125
        <item><c>From</c> is the source address. If UDP over IP is
 
126
         used, this should be a 2-tuple <c>{IP, UDPport}</c>, where
 
127
        <c>IP</c> is a 4-tuple with the IP address, and <c>UDPport</c>
 
128
         is an integer.
 
129
        </item>
 
130
      </list>
 
131
    </section>
 
132
 
 
133
    <section>
 
134
      <title>Incoming Messages</title>
 
135
      <p>This section describes the incoming messages which a Net if
 
136
        process must be able to receive.
 
137
        </p>
 
138
      <list type="bulleted">
 
139
        <item>
 
140
          <p><c>{snmp_response, Vsn, Pdu, Type, ACMData, To, Extra}</c></p>
 
141
          <p>This message is sent to the Net if process from a master
 
142
            agent as a response to a previously received request.
 
143
            </p>
 
144
          <list type="bulleted">
 
145
            <item><c>Vsn</c> is either <c>'version-1'</c>,
 
146
            <c>'version-2'</c>, or <c>'version-3'</c>.
 
147
            </item>
 
148
            <item><c>Pdu</c> is an SNMP PDU record (as defined in
 
149
             snmp_types.hrl) with the SNMP response.
 
150
            </item>
 
151
            <item><c>Type</c> is the <c>#pdu.type</c> of the original
 
152
             request.
 
153
            </item>
 
154
            <item><c>ACMData</c> is data used by the Access Control
 
155
             Module in use.  Normally this is just sent to
 
156
            <c>snmpa_mpd:generate_response_message</c> (see Reference Manual).
 
157
            </item>
 
158
            <item><c>To</c> is the destination address. If UDP over IP
 
159
             is used, this should be a 2-tuple <c>{IP, UDPport}</c>,
 
160
             where <c>IP</c> is a 4-tuple with the IP address, and
 
161
            <c>UDPport</c> is an integer.
 
162
            </item>
 
163
            <item><c>Extra</c> is the term that the Net if process
 
164
             sent to the agent when the request was sent to the agent.
 
165
            </item>
 
166
          </list>
 
167
        </item>
 
168
        <item>
 
169
          <p><c>{discarded_pdu, Vsn, ReqId, ACMData, Variable, Extra}</c></p>
 
170
          <p>This message is sent from a master agent if it for some
 
171
            reason decided to discard the pdu.
 
172
            </p>
 
173
          <list type="bulleted">
 
174
            <item><c>Vsn</c> is either <c>'version-1'</c>,
 
175
            <c>'version-2'</c>, or <c>'version-3'</c>.
 
176
            </item>
 
177
            <item><c>ReqId</c> is the request id of the original
 
178
             request.
 
179
            </item>
 
180
            <item><c>ACMData</c> is data used by the Access Control
 
181
             Module in use.  Normally this is just sent to
 
182
            <c>snmpa_mpd:generate_response_message</c> (see Reference Manual).
 
183
            </item>
 
184
            <item><c>Variable</c> is the name of an snmp counter that
 
185
             represents the error, e.g. <c>snmpInBadCommunityUses</c>.
 
186
            </item>
 
187
            <item><c>Extra</c> is the term that the Net if process
 
188
             sent to the agent when the request was sent to the agent.
 
189
            </item>
 
190
          </list>
 
191
        </item>
 
192
        <item>
 
193
          <p><c>{send_pdu, Vsn, Pdu, MsgData, To}</c></p>
 
194
          <p>This message is sent from a master agent when a trap is
 
195
            to be sent.
 
196
            </p>
 
197
          <list type="bulleted">
 
198
            <item><c>Vsn</c> is either <c>'version-1'</c>,
 
199
            <c>'version-2'</c>, or <c>'version-3'</c>.
 
200
            </item>
 
201
            <item><c>Pdu</c> is an SNMP PDU record (as defined in
 
202
             snmp_types.hrl) with the SNMP response.
 
203
            </item>
 
204
            <item><c>MsgData</c> is the message specific data used in
 
205
             the SNMP message.  This value is normally sent to
 
206
            <c>snmpa_mpd:generate_message/4</c>.  In SNMPv1 and
 
207
             SNMPv2c, this message data is the community string.  In
 
208
             SNMPv3, it is the context information.
 
209
            </item>
 
210
            <item><c>To</c> is a list of the destination addresses and
 
211
             their corresponding security parameters.  This value is
 
212
             normally sent to <c>snmpa_mpd:generate_message/4</c>.  
 
213
            </item>
 
214
          </list>
 
215
        </item>
 
216
        <item>
 
217
          <p><c>{send_pdu_req, Vsn, Pdu, MsgData, To, Pid}</c></p>
 
218
          <p>This            <marker id="message"></marker>
 
219
 message is sent from a master 
 
220
            agent when a request is
 
221
            to be sent.  The only request an agent can send is
 
222
            Inform-Request.  The net if process needs to remember the
 
223
            request id and the Pid, and when a response is received for
 
224
            the request id, send it to Pid, using a
 
225
            <c>snmp_response_received</c> message.
 
226
            </p>
 
227
          <list type="bulleted">
 
228
            <item><c>Vsn</c> is either <c>'version-1'</c>,
 
229
            <c>'version-2'</c>,  or <c>'version-3'</c>.
 
230
            </item>
 
231
            <item><c>Pdu</c> is an SNMP PDU record (as defined in
 
232
             snmp_types.hrl) with the SNMP response.
 
233
            </item>
 
234
            <item><c>MsgData</c> is the message specific data used in
 
235
             the SNMP message.  This value is normally sent to
 
236
            <c>snmpa_mpd:generate_message/4</c>.  In SNMPv1 and
 
237
             SNMPv2c, this message data is the community string.  In
 
238
             SNMPv3, it is the context information.
 
239
            </item>
 
240
            <item><c>To</c> is a list of the destination addresses and
 
241
             their corresponding security parameters.  This value is
 
242
             normally sent to <c>snmpa_mpd:generate_message/4</c>.  
 
243
            </item>
 
244
            <item><c>Pid</c> is a process identifier.
 
245
            </item>
 
246
          </list>
 
247
        </item>
 
248
      </list>
 
249
    </section>
 
250
 
 
251
    <section>
 
252
      <title>Notes</title>
 
253
      <p>Since the Net if process is responsible for encoding and
 
254
        decoding of SNMP messages, it must also update the relevant
 
255
        counters in the SNMP group in MIB-II. It can use the functions
 
256
        in the module <c>snmpa_mpd</c> for this purpose (refer to the 
 
257
        Reference Manual, section <c>snmp</c>, 
 
258
        module <seealso marker="snmp_pdus">snmpa_mpd</seealso>
 
259
        for more details.)
 
260
        </p>
 
261
      <p>There are also some useful functions for encoding and
 
262
        decoding of SNMP messages in the module 
 
263
        <seealso marker="snmp_pdus">snmp_pdus</seealso>.
 
264
        </p>
 
265
    </section>
 
266
  </section>
 
267
</chapter>
 
268