snmpa_mib_storage(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

🌸 snmpa_mib_storage β€” the Erlang module definition, bestie edition 🌸

okay so this is snmpa_mib_storage, a module from the snmp application (that's the Erlang SNMP toolkit, iykyk). it's a behaviour module for the SNMP agent's mib storage. yes, british spelling, we're fancy πŸ’…


✨ NAME ✨

snmpa_mib_storage β€” behaviour module for the SNMP agent mib storage. periodt.


πŸ¦‹ DESCRIPTION πŸ¦‹

This module defines the behaviour of the SNMP agent mib storage.

The mib storage is what the agent uses to keep all its internal mib-related info. and like, plot twist: the mib storage module isn't only used by the mib-server β€” several entities are in there using it too. it's giving main character with a whole ensemble cast πŸŽ€

So if you wanna be a snmpa_mib_storage compliant module, you must export all of these, no skipping, no exceptions bestie:

  • open/5
  • close/1
  • read/2
  • write/2
  • delete/1
  • delete/2
  • match_object/2
  • match_delete/2
  • tab2list/1
  • info/1
  • info/2
  • sync/1
  • backup/2

The semantics of them and their exact signatures are explained below. ⬇️


πŸ’œ DATA TYPES πŸ’œ

mib_storage_fields() :: [atom()].
mib_storage_table_id() :: term().
mib_storage_table_type() :: set | bag.

🌈 CALLBACKS 🌈

backup(TabId, Dir)

Perform a backup of the mib-storage table. 🫢

What this means, if anything, is implementation dependent. (iconic non-answer, honestly)

close(TabId)

Close the mib-storage table. bye bestie πŸ‘‹

delete(TabId)

Delete an entire mib-storage table. the whole thing. gone. πŸ’€

delete(TabId, Key)

Delete a record from the mib-storage table. just the one, we're being surgical.

info(TabId)

Retrieve implementation dependent mib-storage table information.

match_delete(TabId, Pattern)

Search the mib-storage table for record that match the specified pattern and then delete them. The records deleted are also returned. so it's delete-but-tell-me-what-you-deleted, which is honestly so valid ✨

match_object(TabId, Pattern)

Search the mib-storage table for record that match the specified pattern.

open(Name, RecName, Fields, Type, Options)

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.

read(TabId, Key)

Read a record from the mib-storage table. πŸ‘‘

sync(TabId)

Synchronize the mib-storage table.

What this means, if anything, is implementation dependent. (again!! love that for us 😭)

tab2list(TabId)

Return all records in the mib-storage table in the form of a list. dump it all out, no cap.

write(TabId, Record)

Write a record to the mib-storage table. slay. πŸ’…


lowkey reminder: a compliant module exports open/5, close/1, read/2, write/2, delete/1, delete/2, match_object/2, match_delete/2, tab2list/1, info/1, info/2, sync/1 and backup/2. that's the whole vibe check, fr fr.

that's the page bestie! 🧚

Ericsson AB Β· snmp 5.20.5 Β· snmpa_mib_storage(3) β€” written and shipped, mwah πŸ’–

πŸ“¦ where this page comes from