aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/doc/src/snmpa_network_interface_filter.xml
blob: 02c7d291dd5862e2598eb3c630ce227a98a018ca (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
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
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2007</year><year>2016</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

    </legalnotice>

    <title>snmpa_network_interface_filter</title>
    <prepared></prepared>
    <responsible></responsible>
    <docno></docno>
    <approved></approved>
    <checked></checked>
    <date></date>
    <rev></rev>
    <file>snmpa_network_interface_filter.xml</file>
  </header>
  <module since="">snmpa_network_interface_filter</module>
  <modulesummary>Behaviour module for the SNMP agent network-interface filter.</modulesummary>
  <description>
    <p>This module defines the behaviour of the agent network interface
      filter. A <c>snmpa_network_interface_filter</c> compliant module 
      must export the following functions: </p>
    <list type="bulleted">
      <item>
        <p><seealso marker="#accept_recv">accept_recv/2</seealso></p>
      </item>
      <item>
        <p><seealso marker="#accept_send">accept_send/2</seealso></p>
      </item>
      <item>
        <p><seealso marker="#accept_recv_pdu">accept_recv_pdu/3</seealso></p>
      </item>
      <item>
        <p><seealso marker="#accept_send_pdu">accept_send_pdu/2</seealso></p>
      </item>
    </list>
    <p>The semantics of them and their exact signatures are explained
      below. </p>
    <p>The purpose of the network interface filter is to allow for filtering
      of messages (accept or reject) receive and send. This is done 
      on two levels: </p>
    <list type="bulleted">
      <item>
        <p>The first level is at the transport entry / exit point, i.e.
          immediately after the receipt of the message before any message
          processing is done (accept_recv) and 
          immediately before sending the message after all message
          processing is done (accept_send).</p>
      </item>
      <item>
        <p>The second level is at the MPD entry / exit point, i.e.
          immediately after the basic message processing (accept_recv_pdu) / 
          immediately before the basic message processing (accept_send_pdu).</p>
      </item>
    </list>
    <p>Note that the network interface filter is something which is used 
      by the network interface implementation provided by the application 
      (<c>snmpa_net_if</c>). The default filter accepts all messages.</p>
    <p>A network interface filter can e.g. be used during testing or for load 
      regulation. If the intended use is load regulation, see also 
      <seealso marker="snmp_app#configuration_params">req_limit</seealso> and 
      the function 
      <seealso marker="snmpa#register_notification_filter">register_notification_filter</seealso>. </p>
    <p>Legacy network interface filter modules used arguments on the form
      <c>(IpAddr, PortNumber,...)</c> instead of
      <c>(Domain, Addr, ...)</c>, and if the SNMP agent is run without
      changing the configuration to use transport domains
      the network interface filter will still get
      the old arguments and work as before.</p>
  </description>

  <section>
    <title>DATA TYPES</title>
    <code type="none">
port() = integer() > 0
pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | 
             'set-request' | trap | 'get-bulk-request' | 'inform-request' | 
             report
    </code>
    <p>See also the <seealso marker="snmpa_conf#types">
    data types in <c>snmpa_conf</c></seealso>.</p>
    <marker id="accept_recv"></marker>
  </section>
  <funcs>
    <func>
      <name since="">accept_recv(Domain, Addr) -> boolean()</name>
      <fsummary>Shall the received message be accepted</fsummary>
      <type>
	<v>Domain = transportDomain()</v>
	<v>Addr = transportAddressWithPort()</v>
      </type>
      <desc>
        <p>Called at the reception of a message (before <em>any</em> processing 
          has been done).</p>
        <p>For the message to be discarded, the function <em>must</em> return
          <em>false</em>. </p>
        <marker id="accept_send"></marker>
      </desc>
    </func>
    <func>
      <name since="">accept_send(Domain, Addr) -> boolean()</name>
      <fsummary>Shall the message be sent</fsummary>
      <type>
	<v>Domain = transportDomain()</v>
	<v>Addr = transportAddressWithPort()</v>
      </type>
      <desc>
        <p>Called before the sending of a message (after <em>all</em> processing 
          has been done).</p>
        <p>For the message to be discarded, the function <em>must</em> return
          <em>false</em>. </p>
        <marker id="accept_recv_pdu"></marker>
      </desc>
    </func>
    <func>
      <name since="">accept_recv_pdu(Domain, Addr, PduType) -> boolean()</name>
      <fsummary>Shall the received pdu be accepted</fsummary>
      <type>
	<v>Domain = transportDomain()</v>
	<v>Addr = transportAddressWithPort()</v>
        <v>PduType = pdu_type()</v>
      </type>
      <desc>
        <p>Called after the basic message processing (MPD) has been done, 
          but before the pdu is handed over to the master-agent for 
          primary processing.</p>
        <p>For the pdu to be discarded, the function <em>must</em> return
          <em>false</em>. </p>
        <marker id="accept_send_pdu"></marker>
      </desc>
    </func>
    <func>
      <name since="">accept_send_pdu(Targets, PduType) -> Reply</name>
      <fsummary>Shall the pdu be sent</fsummary>
      <type>
        <v>Targets = targets()</v>
        <v>targets() = [target()]</v>
        <v>target() = {Domain, Addr}</v>
	<v>Domain = transportDomain()</v>
	<v>Addr = transportAddressWithPort()</v>
        <v>PduType = pdu_type() > 0</v>
        <v>Reply = boolean() | NewTargets</v>
        <v>NewTargets = targets()</v>
      </type>
      <desc>
        <p>Called before the basic message processing (MPD) is done, 
          when a pdu has been received from the master-agent.</p>
        <p>For the message to be discarded all together, the function 
          <em>must</em> return <em>false</em>. </p>
        <p>Note that it is possible for this function to filter out targets
          (but <em>not</em> to add its own) by returning an updated
          <c>Targets</c> list (<c>NewTargets</c>). </p>
      </desc>
    </func>
  </funcs>
  
</erlref>