1snmpa_mib_storage(3)       Erlang Module Definition       snmpa_mib_storage(3)
2
3
4

NAME

6       snmpa_mib_storage -
7           Behaviour module for the SNMP agent mib storage.
8
9

DESCRIPTION

11       This module defines the behaviour of the SNMP agent mib storage.
12
13       The  mib  storage  is  used by the agent to store internal mib- related
14       information. The mib storage module is used by  several  entities,  not
15       just the mib-server.
16
17       A  snmpa_mib_storage  compliant  module must export the following func‐
18       tions:
19
20         * open/5
21
22         * close/1
23
24         * read/2
25
26         * write/2
27
28         * delete/1
29
30         * delete/2
31
32         * match_object/2
33
34         * match_delete/2
35
36         * tab2list/1
37
38         * info/1
39
40         * sync/1
41
42         * backup/2
43
44       The semantics of them and their exact signatures are explained below.
45

CALLBACK FUNCTIONS

47       The following functions must be exported from a mib-server  data  call‐
48       back module:
49

EXPORTS

51       Module:open(Name,  RecordName,  Fields, Type, Options) -> {ok, TabId} |
52       {error, Reason}
53
54              Types:
55
56                 Name = atom()
57                 RecordName = atom()
58                 Fields = [atom()]
59                 Type = set | bag()
60                 Options = list()
61                 TabId = term()
62                 Reason = term()
63
64              Create or open a mib storage table.
65
66              Note that the RecordName and Fields arguments my not be used  in
67              all  implementations  (they are actually only needed for mnesia-
68              based implementations).
69
70              Note also that the Options argument comes from the options  con‐
71              fig option of the mib-storage config option, and is passed on as
72              is.
73
74       Module:close(TabId) -> void()
75
76              Types:
77
78                 State = term()
79
80              Close the mib-storage table.
81
82       Module:read(TabId, Key) -> false | {value, Record}
83
84              Types:
85
86                 TabId = term()
87                 Key = term()
88                 Record = tuple()
89
90              Read a record from the mib-storage table.
91
92       Module:write(TabId, Record) -> ok | {error, Reason}
93
94              Types:
95
96                 TabId = term()
97                 Record = tuple()
98                 Reason = term()
99
100              Write a record to the mib-storage table.
101
102       Module:delete(TabId) -> void()
103
104              Types:
105
106                 TabId = term()
107
108              Delete an entire mib-storage table.
109
110       Module:delete(TabId, Key) -> ok | {error, Reason}
111
112              Types:
113
114                 TabId = term()
115                 Key = term()
116                 Reason = term()
117
118              Delete a record from the mib-storage table.
119
120       Module:match_object(TabId, Pattern) -> {ok, Recs} | {error, Reason}
121
122              Types:
123
124                 TabId = term()
125                 Pattern = match_pattern()
126                 Recs = [tuple()]
127                 Reason = term()
128
129              Search the mib-storage table for record that match the specified
130              pattern.
131
132       Module:match_delete(TabId, Pattern) -> {ok, Recs} | {error, Reason}
133
134              Types:
135
136                 TabId = term()
137                 Pattern = match_pattern()
138                 Recs = [tuple()]
139                 Reason = term()
140
141              Search the mib-storage table for record that match the specified
142              pattern and then delete  them.  The  records  deleted  are  also
143              returned.
144
145       Module:tab2list(TabId) -> Recs
146
147              Types:
148
149                 TabId = term()
150                 Recs = [tuple()]
151
152              Return  all  records  in  the mib-storage table in the form of a
153              list.
154
155       Module:info(TabId) -> {ok, Info} | {error, Reason}
156
157              Types:
158
159                 TabId = term()
160                 Info = term()
161                 Reason = term()
162
163              Retrieve implementation dependent mib-storage table information.
164
165       Module:sync(TabId) -> void()
166
167              Types:
168
169                 TabId = term()
170
171              Synchronize the mib-storage table.
172
173              What this means, if anything, is implementation dependent.
174
175       Module:backup(TabId, BackupDir) -> ok | {error, Reason}
176
177              Types:
178
179                 TabId = term()
180                 BackupDir = string()
181                 Reason = term()
182
183              Perform a backup of the mib-storage table.
184
185              What this means, if anything, is implementation dependent.
186
187
188
189Ericsson AB                       snmp 5.2.12             snmpa_mib_storage(3)
Impressum