table of contents
- buster 1:21.2.6+dfsg-1
- testing 1:23.2.6+dfsg-1
- unstable 1:23.2.6+dfsg-1
- experimental 1:24.0.5+dfsg-1
snmpa_mib_storage(3erl) | Erlang Module Definition | snmpa_mib_storage(3erl) |
NAME¶
snmpa_mib_storage - Behaviour module for the SNMP agent mib storage.DESCRIPTION¶
This module defines the behaviour of the SNMP agent mib storage.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.
A snmpa_mib_storage compliant module must export the following functions:
- *
- open/5
- *
- close/1
- *
- read/2
- *
- write/2
- *
- delete/1
- *
- delete/2
- *
- match_object/2
- *
- match_delete/2
- *
- tab2list/1
- *
- info/1
- *
- sync/1
- *
- backup/2
The semantics of them and their exact signatures are explained below.
CALLBACK FUNCTIONS¶
The following functions must be exported from a mib-server data callback module:EXPORTS¶
Module:open(Name, RecordName, Fields, Type, Options) -> {ok, TabId} | {error, Reason}Types:
RecordName = atom()
Fields = [atom()]
Type = set | bag()
Options = list()
TabId = term()
Reason = term()
Create or open a mib storage table.
Note that the RecordName and Fields arguments my not be used in all implementations (they are actually only needed for mnesia-based implementations).
Note also that the Options argument comes from the options config option of the mib-storage config option, and is passed on as is.
Module:close(TabId) -> void()
Types:
Close the mib-storage table.
Module:read(TabId, Key) -> false | {value, Record}
Types:
Key = term()
Record = tuple()
Read a record from the mib-storage table.
Module:write(TabId, Record) -> ok | {error, Reason}
Types:
Record = tuple()
Reason = term()
Write a record to the mib-storage table.
Module:delete(TabId) -> void()
Types:
Delete an entire mib-storage table.
Module:delete(TabId, Key) -> ok | {error, Reason}
Types:
Key = term()
Reason = term()
Delete a record from the mib-storage table.
Module:match_object(TabId, Pattern) -> {ok, Recs} | {error,
Reason}
Types:
Pattern = match_pattern()
Recs = [tuple()]
Reason = term()
Search the mib-storage table for record that match the specified pattern.
Module:match_delete(TabId, Pattern) -> {ok, Recs} | {error,
Reason}
Types:
Pattern = match_pattern()
Recs = [tuple()]
Reason = term()
Search the mib-storage table for record that match the specified pattern and then delete them. The records deleted are also returned.
Module:tab2list(TabId) -> Recs
Types:
Recs = [tuple()]
Return all records in the mib-storage table in the form of a list.
Module:info(TabId) -> {ok, Info} | {error, Reason}
Types:
Info = term()
Reason = term()
Retrieve implementation dependent mib-storage table information.
Module:sync(TabId) -> void()
Types:
Synchronize the mib-storage table.
What this means, if anything, is implementation dependent.
Module:backup(TabId, BackupDir) -> ok | {error, Reason}
Types:
BackupDir = string()
Reason = term()
Perform a backup of the mib-storage table.
What this means, if anything, is implementation dependent.
snmp 5.2.12 | Ericsson AB |