snmp_view_based_acm_mib — snmp v5.18

Search documentation of snmp

# View Source snmp_view_based_acm_mib (snmp v5.18)

Instrumentation Functions for SNMP-VIEW-BASED-ACM-MIB

The module `snmp_view_based_acm_mib` implements the instrumentation functions for the SNMP-VIEW-BASED-ACM-MIB, and functions for configuring the database.

The configuration files are described in the SNMP User's Manual.

# Summary

## Types

access_notify_view_name()

> #### Note

> "The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes access for notifications."

access_read_view_name()

> #### Note

> "The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes read access."

access_write_view_name()

> #### Note

> "The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes write access."

context_match()

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

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

context_prefix()

`SnmpAdminString (SIZE(0..32))`

group_name()

> #### Note

> "The name of the group to which this entry (e.g., the combination of securityModel and securityName) belongs."

internal_view_mask()
internal_view_mask_element()
internal_view_type()
mibview()
security_name()

> #### Note

> "The securityName for the principal, represented in a Security Model independent format."

view_mask()

The bit mask which, in combination with the corresponding instance of vacmViewTreeFamilySubtree, defines a family of view subtrees.

view_name()

> #### Note

> "The human readable name for a family of view subtrees."

view_type()

Does the corresponding instances of subtree and mask define a family of view subtrees which are included in or excluded from the MIB view.

## Functions

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

Adds a access definition to the agent config. Equivalent to one vacmAccess-line in the `vacm.conf` file.

add_sec2group(SecModel, SecName, GroupName)

Adds a security to group definition to the agent config. Equivalent to one vacmSecurityToGroup-line in the `vacm.conf` file.

add_view_tree_fam(ViewName, SubTree, Status, Mask)

Adds a view tree family definition to the agent config. Equivalent to one vacmViewTreeFamily-line in the `vacm.conf` file.

configure(ConfDir)

This function is called from the supervisor at system start-up.

delete_access(Key)

Delete a access definition from the agent config.

delete_sec2group(Key)

Delete a security to group definition from the agent config.

delete_view_tree_fam(Key)

Delete a view tree family definition from the agent config.

reconfigure(ConfDir)

Inserts all data in the configuration files into the database and destroys all old data, including the rows with StorageType `nonVolatile`. The rows created from the configuration file will have StorageType `nonVolatile`.

# Types

Link to this type

# access_notify_view_name()

View Source

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

> #### Note

> "The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes access for notifications."

`SnmpAdminString (SIZE(0..32))`

Link to this type

# access_read_view_name()

View Source

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

> #### Note

> "The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes read access."

`SnmpAdminString (SIZE(0..32))`

Link to this type

# access_write_view_name()

View Source

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

> #### Note

> "The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes write access."

`SnmpAdminString (SIZE(0..32))`

Link to this type

# context_match()

View Source

    -type context_match() :: exact | prefix.

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

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

Link to this type

# context_prefix()

View Source

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

`SnmpAdminString (SIZE(0..32))`

Link to this type

# group_name()

View Source

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

> #### Note

> "The name of the group to which this entry (e.g., the combination of securityModel and securityName) belongs."

`SnmpAdminString (SIZE(1..32))`

Link to this type

# internal_view_mask()

View Source

    -type internal_view_mask() :: null | [internal_view_mask_element()].

Link to this type

# internal_view_mask_element()

View Source

    -type internal_view_mask_element() :: 0 | 1.

Link to this type

# internal_view_type()

View Source

    -type internal_view_type() :: 1 | 2.

Link to this type

# mibview()

View Source

    -type mibview() :: [{SubTree :: snmp:oid(), Mask :: internal_view_mask(), Type :: internal_view_type()}].

Link to this type

# security_name()

View Source

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

> #### Note

> "The securityName for the principal, represented in a Security Model independent format."

`SnmpAdminString (SIZE(1..32))`

Link to this type

# view_mask()

View Source

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

The bit mask which, in combination with the corresponding instance of vacmViewTreeFamilySubtree, defines a family of view subtrees.

A '1' indicates that an exact match must occur, a '0' indicates 'wild card' (any sub-identifier value matches).

> #### Note

> Note that in the "external" format, each bit of each octet is represented by a "bit" in this list. That is, each octet "contains" 8 bits; so at most 8*16 = 128 bits in total.

`OCTET STRING (SIZE (0..16))`

Link to this type

# view_name()

View Source

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

> #### Note

> "The human readable name for a family of view subtrees."

`SnmpAdminString (SIZE(1..32))`

Link to this type

# view_type()

View Source

    -type view_type() :: included | excluded.

Does the corresponding instances of subtree and mask define a family of view subtrees which are included in or excluded from the MIB view.

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

# Functions

Link to this function

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

View Source

    -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().

Adds a access definition to the agent config. Equivalent to one vacmAccess-line in the `vacm.conf` file.

Link to this function

# add_sec2group(SecModel, SecName, GroupName)

View Source

    -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().

Adds a security to group definition to the agent config. Equivalent to one vacmSecurityToGroup-line in the `vacm.conf` file.

Link to this function

# add_view_tree_fam(ViewName, SubTree, Status, Mask)

View Source

    -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().

Adds a view tree family definition to the agent config. Equivalent to one vacmViewTreeFamily-line in the `vacm.conf` file.

Link to this function

# configure(ConfDir)

View Source

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

This function is called from the supervisor at system start-up.

Inserts all data in the configuration files into the database and destroys all old rows with StorageType `volatile`. The rows created from the configuration file will have StorageType `nonVolatile`.

All `snmp` counters are set to zero.

If an error is found in the configuration file, it is reported using the function `config_err/2` of the error report module, and the function fails with the reason `configuration_error`.

`ConfDir` is a string which points to the directory where the configuration files are found.

The configuration file read is: `vacm.conf`.

Link to this function

# delete_access(Key)

View Source

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

Delete a access definition from the agent config.

Link to this function

# delete_sec2group(Key)

View Source

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

Delete a security to group definition from the agent config.

Link to this function

# delete_view_tree_fam(Key)

View Source

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

Delete a view tree family definition from the agent config.

Link to this function

# reconfigure(ConfDir)

View Source

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

Inserts all data in the configuration files into the database and destroys all old data, including the rows with StorageType `nonVolatile`. The rows created from the configuration file will have StorageType `nonVolatile`.

Thus, the data in the SNMP-VIEW-BASED-ACM-MIB, after this function has been called, is the data from the configuration files.

All `snmp` counters are set to zero.

If an error is found in the configuration file, it is reported using the function config_err/2 of the error report module, and the function fails with the reason `configuration_error`.

`ConfDir` is a string which points to the directory where the configuration files are found.

The configuration file read is: `vacm.conf`.