檢視原始碼 snmp_view_based_acm_mib (snmp v5.18)

SNMP-VIEW-BASED-ACM-MIB 的檢測函式

模組 snmp_view_based_acm_mib 實作了 SNMP-VIEW-BASED-ACM-MIB 的檢測函式,以及用於設定資料庫的函式。

設定檔的說明請參閱 SNMP 使用者手冊。

摘要

類型

注意

「此物件的實例值識別出 SNMP 環境的 MIB 檢視,此概念列授權此環境的通知存取權。」

注意

「此物件的實例值識別出 SNMP 環境的 MIB 檢視,此概念列授權此環境的讀取存取權。」

注意

「此物件的實例值識別出 SNMP 環境的 MIB 檢視,此概念列授權此環境的寫入存取權。」

	  exact  - exact match of prefix and contextName
          prefix - Only match to the prefix

INTEGER { exact (1), prefix (2) }

SnmpAdminString (SIZE(0..32))

注意

「此項 (例如,securityModel 與 securityName 的組合) 所屬的群組名稱。」

注意

「主體的 securityName,以與安全模型無關的格式表示。」

位元遮罩,與 vacmViewTreeFamilySubtree 的對應實例組合使用時,會定義檢視子樹的系列。

注意

「檢視子樹系列的人類可讀名稱。」

子樹和遮罩的對應實例是否定義了包含在 MIB 檢視中或從 MIB 檢視中排除的檢視子樹系列。

函式

將存取定義新增至代理程式設定。相當於 vacm.conf 檔案中的一行 vacmAccess。

將安全至群組定義新增至代理程式設定。相當於 vacm.conf 檔案中的一行 vacmSecurityToGroup。

將檢視樹狀結構系列定義新增至代理程式設定。相當於 vacm.conf 檔案中的一行 vacmViewTreeFamily。

此函式會在系統啟動時由監督程式呼叫。

從代理程式設定中刪除存取定義。

從代理程式設定中刪除安全至群組定義。

從代理程式設定中刪除檢視樹狀結構系列定義。

將設定檔中的所有資料插入資料庫,並摧毀所有舊資料,包括具有 StorageType nonVolatile 的列。從設定檔建立的列會具有 StorageType nonVolatile

類型

此類型的連結

access_notify_view_name()

檢視原始碼
-type access_notify_view_name() :: snmp_framework_mib:admin_string().

注意

「此物件的實例值識別出 SNMP 環境的 MIB 檢視,此概念列授權此環境的通知存取權。」

SnmpAdminString (SIZE(0..32))

此類型的連結

access_read_view_name()

檢視原始碼
-type access_read_view_name() :: snmp_framework_mib:admin_string().

注意

「此物件的實例值識別出 SNMP 環境的 MIB 檢視,此概念列授權此環境的讀取存取權。」

SnmpAdminString (SIZE(0..32))

此類型的連結

access_write_view_name()

檢視原始碼
-type access_write_view_name() :: snmp_framework_mib:admin_string().

注意

「此物件的實例值識別出 SNMP 環境的 MIB 檢視,此概念列授權此環境的寫入存取權。」

SnmpAdminString (SIZE(0..32))

-type context_match() :: exact | prefix.
	  exact  - exact match of prefix and contextName
          prefix - Only match to the prefix

INTEGER { exact (1), prefix (2) }

-type context_prefix() :: snmp_framework_mib:admin_string().

SnmpAdminString (SIZE(0..32))

-type group_name() :: snmp_framework_mib:admin_string().

注意

「此項 (例如,securityModel 與 securityName 的組合) 所屬的群組名稱。」

SnmpAdminString (SIZE(1..32))

-type internal_view_mask() :: null | [internal_view_mask_element()].
此類型的連結

internal_view_mask_element()

檢視原始碼
-type internal_view_mask_element() :: 0 | 1.
-type internal_view_type() :: 1 | 2.
-type mibview() :: [{SubTree :: snmp:oid(), Mask :: internal_view_mask(), Type :: internal_view_type()}].
-type security_name() :: snmp_framework_mib:admin_string().

注意

「主體的 securityName,以與安全模型無關的格式表示。」

SnmpAdminString (SIZE(1..32))

-type view_mask() :: [0 | 1].

位元遮罩,與 vacmViewTreeFamilySubtree 的對應實例組合使用時,會定義檢視子樹的系列。

「1」表示必須進行完全符合,「0」表示「萬用字元」(任何子識別碼值皆符合)。

注意

請注意,「外部」格式中,每個八位元組的每個位元都由此清單中的「位元」表示。也就是說,每個八位元組「包含」8 個位元;因此總共最多 8*16 = 128 個位元。

OCTET STRING (SIZE (0..16))

-type view_name() :: snmp_framework_mib:admin_string().

注意

「檢視子樹系列的人類可讀名稱。」

SnmpAdminString (SIZE(1..32))

-type view_type() :: included | excluded.

子樹和遮罩的對應實例是否定義了包含在 MIB 檢視中或從 MIB 檢視中排除的檢視子樹系列。

INTEGER { included(1), excluded(2) }

函式

此函式的連結

add_access(GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV)

檢視原始碼
-spec add_access(GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV) ->
                    {ok, Key} | {error, Reason}
                    when
                        GroupName :: group_name(),
                        Prefix :: context_prefix(),
                        SecModel :: snmp_framework_mib:security_model(),
                        SecLevel :: snmp_framework_mib:security_level(),
                        Match :: context_match(),
                        RV :: access_read_view_name(),
                        WV :: access_write_view_name(),
                        NV :: access_notify_view_name(),
                        Key :: term(),
                        Reason :: term().

將存取定義新增至代理程式設定。相當於 vacm.conf 檔案中的一行 vacmAccess。

此函式的連結

add_sec2group(SecModel, SecName, GroupName)

檢視原始碼
-spec add_sec2group(SecModel, SecName, GroupName) -> {ok, Key} | {error, Reason}
                       when
                           SecModel :: snmp_framework_mib:security_model(),
                           SecName :: security_name(),
                           GroupName :: group_name(),
                           Key :: term(),
                           Reason :: term().

將安全至群組定義新增至代理程式設定。相當於 vacm.conf 檔案中的一行 vacmSecurityToGroup。

此函式的連結

add_view_tree_fam(ViewName, SubTree, Status, Mask)

檢視原始碼
-spec add_view_tree_fam(ViewName, SubTree, Status, Mask) -> {ok, Key} | {error, Reason}
                           when
                               ViewName :: view_name(),
                               SubTree :: snmp:oid(),
                               Status :: view_type(),
                               Mask :: null | view_mask(),
                               Key :: term(),
                               Reason :: term().

將檢視樹狀結構系列定義新增至代理程式設定。相當於 vacm.conf 檔案中的一行 vacmViewTreeFamily。

-spec configure(ConfDir) -> snmp:void() when ConfDir :: string().

此函式會在系統啟動時由監督程式呼叫。

將設定檔中的所有資料插入資料庫,並摧毀所有具有 StorageType volatile 的舊列。從設定檔建立的列會具有 StorageType nonVolatile

所有 snmp 計數器都會設為零。

如果在設定檔中找到錯誤,則會使用錯誤報告模組的 config_err/2 函式回報,且此函式會因 configuration_error 原因而失敗。

ConfDir 是一個字串,指向設定檔所在的目錄。

讀取的設定檔為:vacm.conf

-spec delete_access(Key) -> ok | {error, Reason} when Key :: term(), Reason :: term().

從代理程式設定中刪除存取定義。

-spec delete_sec2group(Key) -> ok | {error, Reason} when Key :: term(), Reason :: term().

從代理程式設定中刪除安全至群組定義。

此函式的連結

delete_view_tree_fam(Key)

檢視原始碼
-spec delete_view_tree_fam(Key) -> ok | {error, Reason} when Key :: term(), Reason :: term().

從代理程式設定中刪除檢視樹狀結構系列定義。

-spec reconfigure(ConfDir) -> snmp:void() when ConfDir :: string().

將設定檔中的所有資料插入資料庫,並摧毀所有舊資料,包括具有 StorageType nonVolatile 的列。從設定檔建立的列會具有 StorageType nonVolatile

因此,呼叫此函式後,SNMP-VIEW-BASED-ACM-MIB 中的資料即為設定檔中的資料。

所有 snmp 計數器都會設為零。

如果在設定檔中發現錯誤,會使用錯誤報告模組的 config_err/2 函式回報,且此函式會因 configuration_error 原因而失敗。

ConfDir 是一個字串,指向設定檔所在的目錄。

讀取的設定檔為:vacm.conf