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

<erlref>
  <header>
    <copyright>
      <year>2013</year><year>2014</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      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.
    
    </legalnotice>

    <title>snmpa_mib_storage</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
    <file>snmpa_mib_storage.xml</file>
  </header>

  <module>snmpa_mib_storage</module>
  <modulesummary>
    Behaviour module for the SNMP agent mib storage. 
  </modulesummary>
  <description>
    <p>This module defines the behaviour of the SNMP agent mib storage. </p>
    <p>The mib storage is used by the agent to store internal mib-
    related information. The mib storage module is used by several entities, 
    not just the mib-server. </p>

    <p>A <c>snmpa_mib_storage</c> compliant module 
    must export the following functions: </p>
    <list type="bulleted">
      <item>
	<seealso marker="#open">open/5</seealso>
      </item>
      <item>
	<seealso marker="#close">close/1</seealso>
      </item>
      <item>
	<seealso marker="#read">read/2</seealso>
      </item>
      <item>
	<seealso marker="#write">write/2</seealso>
      </item>
      <item>
	<seealso marker="#delete1">delete/1</seealso>
      </item>
      <item>
	<seealso marker="#delete2">delete/2</seealso>
      </item>
      <item>
	<seealso marker="#match_object">match_object/2</seealso>
      </item>
      <item>
	<seealso marker="#match_delete">match_delete/2</seealso>
      </item>
      <item>
	<seealso marker="#tab2list">tab2list/1</seealso>
      </item>
      <item>
	<seealso marker="#info">info/1</seealso>
      </item>
      <item>
	<seealso marker="#sync">sync/1</seealso>
      </item>
      <item>
	<seealso marker="#backup">backup/2</seealso>
      </item>
    </list>

    <p>The semantics of them and their exact signatures are 
    explained below. </p>

  </description>

  <section>
    <title>CALLBACK FUNCTIONS</title>
    <p>The following functions must be exported from a 
    <c>mib-server</c> data callback module: </p>

    <marker id="open"></marker>
  </section>

  <funcs>
    <func>
      <name>Module:open(Name, RecordName, Fields, Type, Options) -> {ok, TabId} | {error, Reason}</name>
      <fsummary>Create new (mib-server) data instance</fsummary>
      <type>
        <v>Name = atom()</v>
        <v>RecordName = atom()</v>
        <v>Fields = [atom()]</v>
        <v>Type = set | bag()</v>
        <v>Options = list()</v>
        <v>TabId = term()</v>
        <v>Reason = term()</v>
      </type>
      <desc>
        <p>Create or open a mib storage table. </p>
	<p>Note that the <c>RecordName</c> and <c>Fields</c> arguments 
	my not be used in all implementations (they are actually only 
	needed for mnesia-based implementations). </p>

	<p>Note also that the <c>Options</c> argument comes from
	the <c>options</c> config option of the mib-storage config option, 
	and is passed on as is. </p>

        <marker id="close"></marker>
      </desc>
    </func>

    <func>
      <name>Module:close(TabId) -> void()</name>
      <fsummary>Close the mib-storage table</fsummary>
      <type>
        <v>State = term()</v>
      </type>
      <desc>
        <p>Close the mib-storage table.</p>

        <marker id="read"></marker>
      </desc>
    </func>

    <func>
      <name>Module:read(TabId, Key) -> false | {value, Record}</name>
      <fsummary>Read a record from the mib-storage table</fsummary>
      <type>
        <v>TabId = term()</v>
        <v>Key = term()</v>
        <v>Record = tuple()</v>
      </type>
      <desc>
        <p>Read a record from the mib-storage table. </p>

        <marker id="write"></marker>
      </desc>
    </func>

    <func>
      <name>Module:write(TabId, Record) -> ok | {error, Reason}</name>
      <fsummary>Write a record to the mib-storage table</fsummary>
      <type>
        <v>TabId = term()</v>
        <v>Record = tuple()</v>
        <v>Reason = term()</v>
      </type>
      <desc>
        <p>Write a record to the mib-storage table. </p>

        <marker id="delete1"></marker>
      </desc>
    </func>

    <func>
      <name>Module:delete(TabId) -> void()</name>
      <fsummary>Delete an entire mib-storage table</fsummary>
      <type>
        <v>TabId = term()</v>
      </type>
      <desc>
        <p>Delete an entire mib-storage table. </p>

        <marker id="delete2"></marker>
      </desc>
    </func>

    <func>
      <name>Module:delete(TabId, Key) -> ok | {error, Reason}</name>
      <fsummary>Delete a record from the mib-storage table</fsummary>
      <type>
        <v>TabId = term()</v>
        <v>Key = term()</v>
        <v>Reason = term()</v>
      </type>
      <desc>
        <p>Delete a record from the mib-storage table. </p>

        <marker id="match_object"></marker>
      </desc>
    </func>

    <func>
      <name>Module:match_object(TabId, Pattern) -> {ok, Recs} | {error, Reason}</name>
      <fsummary>Search the mib-storage table for record matching pattern</fsummary>
      <type>
        <v>TabId = term()</v>
        <v>Pattern = match_pattern()</v>
        <v>Recs = [tuple()]</v>
        <v>Reason = term()</v>
      </type>
      <desc>
        <p>Search the mib-storage table for record that match the
	specified pattern. </p>

        <marker id="match_delete"></marker>
      </desc>
    </func>

    <func>
      <name>Module:match_delete(TabId, Pattern) -> {ok, Recs} | {error, Reason}</name>
      <fsummary>Delete records in the mib-storage table matching pattern</fsummary>
      <type>
        <v>TabId = term()</v>
        <v>Pattern = match_pattern()</v>
        <v>Recs = [tuple()]</v>
        <v>Reason = term()</v>
      </type>
      <desc>
        <p>Search the mib-storage table for record that match the
	specified pattern and then delete them. The records deleted are
	also returned. </p>

        <marker id="tab2list"></marker>
      </desc>
    </func>

    <func>
      <name>Module:tab2list(TabId) -> Recs</name>
      <fsummary>Return all records of the mib-storage table</fsummary>
      <type>
        <v>TabId = term()</v>
        <v>Recs = [tuple()]</v>
      </type>
      <desc>
        <p>Return all records in the mib-storage table in the form 
	of a list. </p>

        <marker id="info"></marker>
      </desc>
    </func>

    <func>
      <name>Module:info(TabId) -> {ok, Info} | {error, Reason}</name>
      <fsummary>Returns information about the mib-storage table. </fsummary>
      <type>
        <v>TabId = term()</v>
        <v>Info = term()</v>
        <v>Reason = term()</v>
      </type>
      <desc>
        <p>Retrieve implementation dependent mib-storage table 
	information. </p>

        <marker id="sync"></marker>
      </desc>
    </func>

    <func>
      <name>Module:sync(TabId) -> void()</name>
      <fsummary>Synchronize mib-storage table</fsummary>
      <type>
        <v>TabId = term()</v>
      </type>
      <desc>
        <p>Synchronize the mib-storage table. </p>
	<p>What this means, if anything, is implementation dependent. </p>

        <marker id="backup"></marker>
      </desc>
    </func>

    <func>
      <name>Module:backup(TabId, BackupDir) -> ok | {error, Reason}</name>
      <fsummary>Perform a backup of the mib-storage table</fsummary>
      <type>
        <v>TabId = term()</v>
        <v>BackupDir = string()</v>
        <v>Reason = term()</v>
      </type>
      <desc>
        <p>Perform a backup of the mib-storage table. </p>
        <p>What this means, if anything, is implementation dependent. </p>

      </desc>
    </func>

  </funcs>
  
</erlref>