檢視原始碼 snmpa_mib_storage 行為 (snmp v5.18)

SNMP agent mib 儲存的行為模組。

此模組定義 SNMP agent mib 儲存的行為。

mib 儲存由 agent 用來儲存內部與 mib 相關的資訊。mib 儲存模組由多個實體使用,而不僅僅是 mib-server。

符合 snmpa_mib_storage 的模組必須匯出以下函式:

它們的語義和確切的簽名將在下面解釋。

摘要

回呼:回呼函式

執行 mib-storage 表格的備份。

關閉 mib-storage 表格。

刪除整個 mib-storage 表格。

從 mib-storage 表格中刪除一筆記錄。

擷取實作相關的 mib-storage 表格資訊。

在 mib-storage 表格中搜尋符合指定模式的記錄,然後將其刪除。刪除的記錄也會被回傳。

在 mib-storage 表格中搜尋符合指定模式的記錄。

建立或開啟 mib 儲存表格。

從 mib-storage 表格讀取一筆記錄。

同步 mib-storage 表格。

以列表形式回傳 mib-storage 表格中的所有記錄。

將一筆記錄寫入 mib-storage 表格。

型別

連結到此類型

mib_storage_fields()

檢視原始碼 (自 OTP R16B01 起)
-type mib_storage_fields() :: [atom()].
連結到此類型

mib_storage_table_id()

檢視原始碼 (自 OTP R16B01 起)
-type mib_storage_table_id() :: term().
連結到此類型

mib_storage_table_type()

檢視原始碼 (自 OTP R16B01 起)
-type mib_storage_table_type() :: set | bag.

回呼:回呼函式

連結到此回呼

backup(TabId, Dir)

檢視原始碼 (自 OTP R16B01 起)
-callback backup(TabId :: mib_storage_table_id(), Dir :: file:filename()) -> ok | {error, Reason :: term()}.

執行 mib-storage 表格的備份。

這代表什麼,如果有的話,是取決於實作。

連結到此回呼

close(TabId)

檢視原始碼 (自 OTP R16B01 起)
-callback close(TabId :: mib_storage_table_id()) -> term().

關閉 mib-storage 表格。

連結到此回呼

delete(TabId)

檢視原始碼 (自 OTP R16B01 起)
-callback delete(TabId :: mib_storage_table_id()) -> snmp:void().

刪除整個 mib-storage 表格。

連結到此回呼

delete(TabId, Key)

檢視原始碼 (自 OTP R16B01 起)
-callback delete(TabId :: mib_storage_table_id(), Key :: term()) -> ok | {error, Reason :: term()}.

從 mib-storage 表格中刪除一筆記錄。

連結到此回呼

info(TabId)

檢視原始碼 (自 OTP R16B01 起)
-callback info(TabId :: mib_storage_table_id()) -> Info :: term().

擷取實作相關的 mib-storage 表格資訊。

連結到此回呼

info(TabId, Item)

檢視原始碼 (自 OTP R16B01 起)
-callback info(TabId :: mib_storage_table_id(), Item :: atom()) -> Info :: term().
連結到此回呼

match_delete(TabId, Pattern)

檢視原始碼 (自 OTP R16B01 起)
-callback match_delete(TabId :: mib_storage_table_id(), Pattern :: ets:match_pattern()) ->
                          Recs :: [tuple()] | {error, Reason :: term()}.

在 mib-storage 表格中搜尋符合指定模式的記錄,然後將其刪除。刪除的記錄也會被回傳。

連結到此回呼

match_object(TabId, Pattern)

檢視原始碼 (自 OTP R16B01 起)
-callback match_object(TabId :: mib_storage_table_id(), Pattern :: ets:match_pattern()) ->
                          Recs :: [tuple()] | {error, Reason :: term()}.

在 mib-storage 表格中搜尋符合指定模式的記錄。

連結到此回呼

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

檢視原始碼 (自 OTP R16B01 起)
-callback open(Name :: atom(),
               RecName :: atom(),
               Fields :: mib_storage_fields(),
               Type :: mib_storage_table_type(),
               Options :: list()) ->
                  {ok, TabId :: mib_storage_table_id()} | {error, Reason :: term()}.

建立或開啟 mib 儲存表格。

請注意,RecordNameFields 引數可能不會在所有實作中使用(它們實際上僅適用於基於 mnesia 的實作)。

另請注意,Options 引數來自 mib-storage 配置選項的 options 配置選項,並按原樣傳遞。

連結到此回呼

read(TabId, Key)

檢視原始碼 (自 OTP R16B01 起)
-callback read(TabId :: mib_storage_table_id(), Key :: term()) -> false | {value, Record :: tuple()}.

從 mib-storage 表格讀取一筆記錄。

連結到此回呼

sync(TabId)

檢視原始碼 (自 OTP R16B01 起)
-callback sync(TabId :: mib_storage_table_id()) -> snmp:void().

同步 mib-storage 表格。

這代表什麼,如果有的話,是取決於實作。

連結到此回呼

tab2list(TabId)

檢視原始碼 (自 OTP R16B01 起)
-callback tab2list(TabId :: mib_storage_table_id()) -> [tuple()].

以列表形式回傳 mib-storage 表格中的所有記錄。

連結到此回呼

write(TabId, Record)

檢視原始碼 (自 OTP R16B01 起)
-callback write(TabId :: mib_storage_table_id(), Record :: tuple()) -> ok | {error, Reason :: term()}.

將一筆記錄寫入 mib-storage 表格。