<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2006</year><year>2021</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>snmpm_conf</title>
    <prepared></prepared>
    <responsible></responsible>
    <docno></docno>
    <approved></approved>
    <checked></checked>
    <date></date>
    <rev></rev>
    <file>snmpm_conf.xml</file>
  </header>
  <module since="">snmpm_conf</module>
  <modulesummary>Utility functions for handling the manager config files.</modulesummary>
  <description>
    <p>The module <c>snmpm_conf</c> contains various utility functions to 
      used for manipulating (write/append/read) the config files of the
      SNMP manager. </p>
    <marker id="manager_entry"></marker>
  </description>
  <funcs>
    <func>
      <name since="">manager_entry(Tag, Val) -> manager_entry()</name>
      <fsummary>Create an manager entry</fsummary>
      <type>
        <v>Tag = address | port | engine_id | max_message_size</v>
        <v>Val = term()</v>
        <v>manager_entry() = term()</v>
      </type>
      <desc>
        <p>Create an entry for the manager config file, 
          <c>manager.conf</c>. </p>
        <p>The type of <c>Val</c> depends on the value of <c>Tag</c>, 
          see 
          <seeguide marker="snmp_manager_config_files#manager_information">Manager Information</seeguide> 
          for more info. </p>
        <marker id="write_manager_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">write_manager_config(Dir, Conf) -> ok</name>
      <name since="">write_manager_config(Dir, Hdr, Conf) -> ok</name>
      <fsummary>Write the manager config to the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Hdr = string()</v>
        <v>Conf = [manager_entry()]</v>
      </type>
      <desc>
        <p>Write the manager config to the manager config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p><c>Hdr</c> is an optional file header (note that this text is
          written to the file as is). </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#manager_information">Manager Information</seeguide> 
          for more info. </p>
        <marker id="append_manager_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">append_manager_config(Dir, Conf) -> ok</name>
      <fsummary>Append the manager config to the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Conf = [manager_entry()]</v>
      </type>
      <desc>
        <p>Append the config to the current manager config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#manager_information">Manager Information</seeguide> 
          for more info. </p>
        <marker id="read_manager_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">read_manager_config(Dir) -> Conf</name>
      <fsummary>Read the manager config from the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Conf = [manager_entry()]</v>
      </type>
      <desc>
        <p>Read the current manager config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#manager_information">Manager Information</seeguide> 
          for more info. </p>
        <marker id="users_entry"></marker>
      </desc>
    </func>
    <func>
      <name since="">users_entry(UserId) -> users_entry()</name>
      <name since="">users_entry(UserId, UserMod) -> users_entry()</name>
      <name since="">users_entry(UserId, UserMod, UserData) -> users_entry()</name>
      <fsummary>Create an users entry</fsummary>
      <type>
        <v>UserId = term()</v>
        <v>UserMod = atom()</v>
        <v>UserData = term()</v>
        <v>standard_entry() = term()</v>
      </type>
      <desc>
        <p>Create an entry for the manager users config file, 
          <c>users.conf</c>. </p>
        <p><c>users_entry(UserId)</c> translates to the following call:
          <c>users_entry(UserId, snmpm_user_default)</c>. </p>
        <p><c>users_entry(UserId, UserMod)</c> translates to the following 
          call: <c>users_entry(UserId, UserMod, undefined)</c>. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#users">Users</seeguide> 
          for more info. </p>
        <marker id="write_users_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">write_users_config(Dir, Conf) -> ok</name>
      <name since="">write_users_config(Dir, Hdr, Conf) -> ok</name>
      <fsummary>Write the manager users config to the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Hdr = string()</v>
        <v>Conf = [users_entry()]</v>
      </type>
      <desc>
        <p>Write the manager users config to the manager users 
          config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p><c>Hdr</c> is an optional file header (note that this text is
          written to the file as is). </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#users">Users</seeguide> 
          for more info. </p>
        <marker id="append_users_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">append_users_config(Dir, Conf) -> ok</name>
      <fsummary>Append the manager users config to the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Conf = [users_entry()]</v>
      </type>
      <desc>
        <p>Append the users config to the current manager users  
          config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#users">Users</seeguide> 
          for more info. </p>
        <marker id="read_users_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">read_users_config(Dir) -> Conf</name>
      <fsummary>Read the manager users config from the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Conf = [users_entry()]</v>
      </type>
      <desc>
        <p>Read the current manager users config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#users">Users</seeguide> 
          for more info. </p>
        <marker id="agents_entry"></marker>
      </desc>
    </func>
    <func>
      <name since="">agents_entry(UserId, TargetName, Comm, Domain, Addr, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel) -> agents_entry()</name>
      <fsummary>Create an agents entry</fsummary>
      <type>
        <v>UserId = term()</v>
        <v>TargetName = string()</v>
        <v>Comm = string()</v>
	<v>Domain = transportDomain()</v>
	<v>Addr = transportAddress()</v>
        <v>EngineID = string()</v>
        <v>Timeout = integer()</v>
        <v>MaxMessageSize = integer()</v>
        <v>Version = v1 | v2 | v3</v>
        <v>SecModel = v1 | v2c | usm</v>
        <v>SecName = string()</v>
        <v>SecLevel = noAuthNoPriv | authNoPriv | authPriv</v>
        <v>agents_entry() = term()</v>
      </type>
      <desc>
        <p>Create an entry for the manager agents config file, 
          <c>agents.conf</c>. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#agents">Agents</seeguide> 
          for more info. </p>
        <marker id="write_agents_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">write_agents_config(Dir, Conf) -> ok</name>
      <name since="">write_agents_config(Dir, Hdr, Conf) -> ok</name>
      <fsummary>Write the manager agents to the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Hdr = string()</v>
        <v>Conf = [_entry()]</v>
      </type>
      <desc>
        <p>Write the manager agents config to the manager agents 
          config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p><c>Hdr</c> is an optional file header (note that this text is
          written to the file as is). </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#agents">Agents</seeguide> 
          for more info. </p>
        <marker id="append_agents_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">append_agents_config(Dir, Conf) -> ok</name>
      <fsummary>Append the manager agents to the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Conf = [agents_entry()]</v>
      </type>
      <desc>
        <p>Append the agents config to the current manager agents 
          config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#agents">Agents</seeguide> 
          for more info. </p>
        <marker id="read_agents_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">read_agents_config(Dir) -> Conf</name>
      <fsummary>Read the manager agents config from the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Conf = [agents_entry()]</v>
      </type>
      <desc>
        <p>Read the current manager agents config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#agents">Agents</seeguide> 
          for more info. </p>
        <marker id="usm_entry"></marker>
      </desc>
    </func>
    <func>
      <name since="">usm_entry(EngineID, UserName, AuthP, AuthKey, PrivP, PrivKey) -> usm_entry()</name>
      <name since="">usm_entry(EngineID, UserName, SecName, AuthP, AuthKey, PrivP, PrivKey) -> usm_entry()</name>
      <fsummary>Create an usm entry</fsummary>
      <type>
        <v>EngineID = string()</v>
        <v>UserName = string()</v>
        <v>SecName = string()</v>
        <v>AuthP = usmNoAuthProtocol | usmHMACMD5AuthProtocol | usmHMACSHAAuthProtocol | usmHMAC128SHA224AuthProtocol | usmHMAC192SH256AuthProtocol | usmHMAC256SHA384AuthProtocol | usmHMAC384SHA512AuthProtocol</v>
        <v>AuthKey = [integer()]</v>
        <v>PrivP = usmNoPrivProtocol | usmDESPrivProtocol | usmAesCfb128Protocol</v>
        <v>PrivKey = [integer()]</v>
        <v>usm_entry() = term()</v>
      </type>
      <desc>
        <p>Create an entry for the agent community config file, 
          <c>community.conf</c>. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#usm">Security data for USM</seeguide> 
          for more info. </p>
        <marker id="write_usm_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">write_usm_config(Dir, Conf) -> ok</name>
      <name since="">write_usm_config(Dir, Hdr, Conf) -> ok</name>
      <fsummary>Write the manager usm config to the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Hdr = string()</v>
        <v>Conf = [usm_entry()]</v>
      </type>
      <desc>
        <p>Write the manager usm config to the manager usm 
          config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p><c>Hdr</c> is an optional file header (note that this text is
          written to the file as is). </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#usm">Security data for USM</seeguide> 
          for more info. </p>
        <marker id="append_usm_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">append_usm_config(Dir, Conf) -> ok</name>
      <fsummary>Append the manager usm  config to the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Conf = [usm_entry()]</v>
      </type>
      <desc>
        <p>Append the usm config to the current manager usm 
          config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#usm">Security data for USM</seeguide> 
          for more info. </p>
        <marker id="read_usm_config"></marker>
      </desc>
    </func>
    <func>
      <name since="">read_usm_config(Dir) -> Conf</name>
      <fsummary>Read the manager usm config from the config file</fsummary>
      <type>
        <v>Dir = string()</v>
        <v>Conf = [usm_entry()]</v>
      </type>
      <desc>
        <p>Read the current manager usm config file. </p>
        <p><c>Dir</c> is the path to the directory where to store the 
          config file. </p>
        <p>See 
          <seeguide marker="snmp_manager_config_files#usm">Security data for USM</seeguide> 
          for more info. </p>
        <marker id="end"></marker>
      </desc>
    </func>
  </funcs>
  
</erlref>

