From fcc898b0b296376167a2a2094d0a822090cfb20e Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Fri, 29 Aug 2014 16:41:44 +0200 Subject: Update documentation --- lib/snmp/doc/src/snmp_agent_config_files.xml | 56 +++++++++++++----- lib/snmp/doc/src/snmp_agent_netif.xml | 34 +++++------ lib/snmp/doc/src/snmp_manager_config_files.xml | 63 ++++++++++++++++---- lib/snmp/doc/src/snmp_manager_netif.xml | 45 +++++++++------ lib/snmp/doc/src/snmp_target_mib.xml | 22 ++++--- lib/snmp/doc/src/snmpa_conf.xml | 66 +++++++++++++++------ lib/snmp/doc/src/snmpa_mpd.xml | 67 +++++++++++++++++----- .../doc/src/snmpa_network_interface_filter.xml | 40 ++++++++----- .../snmpa_notification_delivery_info_receiver.xml | 32 ++++++----- lib/snmp/doc/src/snmpm.xml | 14 +++-- lib/snmp/doc/src/snmpm_conf.xml | 8 +-- lib/snmp/doc/src/snmpm_mpd.xml | 14 +++-- lib/snmp/doc/src/snmpm_network_interface.xml | 12 ++-- .../doc/src/snmpm_network_interface_filter.xml | 34 ++++++----- lib/snmp/doc/src/snmpm_user.xml | 15 +++-- 15 files changed, 355 insertions(+), 167 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/snmp_agent_config_files.xml b/lib/snmp/doc/src/snmp_agent_config_files.xml index 1e8e879814..1e938c0dc8 100644 --- a/lib/snmp/doc/src/snmp_agent_config_files.xml +++ b/lib/snmp/doc/src/snmp_agent_config_files.xml @@ -4,7 +4,7 @@
- 19972013 + 19972014 Ericsson AB. All Rights Reserved. @@ -102,20 +102,41 @@

AgentVariable is one of the variables is SNMP-FRAMEWORK-MIB or one of the internal variables intAgentUDPPort, which defines which UDP port the agent - listens to, or intAgentIpAddress, which defines the IP - address of the agent.

+ listens to, or intAgentTransports, which defines the + transport domains and addresses of the agent.

Value is the value for the variable.

-

The following example shows a agent.conf file:

+

The following example shows an agent.conf file:

 {intAgentUDPPort, 4000}.
-{intAgentIpAddress,[141,213,11,24]}.
+{intAgentTransports,
+ [{transportDomainUdpIpv4, {141,213,11,24}},
+  {transportDomainUdpIpv6, {0,0,0,0,0,0,0,1}}]}.
 {snmpEngineID, "mbj's engine"}.
 {snmpEngineMaxPacketSize, 484}.
     
+

The value of intAgentTransports is a list of + {Domain, Addr} tuples, where Domain + is either transportDomainUdpIpv4 or transportDomainUdpIpv6, + and Addr is the address in the domain. + Addr can be specified either as an + IpAddr or as an {IpAddr, IpPort} tuple. + IpAddr is either a regular Erlang/OTP + ip_address() + or a traditional SNMP integer list and IpPort is an integer. +

+ +

When the Addr value does not contain a port number, + the value of intAgentUDPPort is used.

+ +

The legacy and intermediate variables intAgentIpAddress + and intAgentTransportDomain are still supported so old + agent.conf files will work. +

+

The value of snmpEngineID is a string, which for a deployed agent should have a very specific structure. See RFC 2271/2571 for details.

@@ -362,9 +383,9 @@ SNMP-TARGET-MIB and snmpTargetAddrExtTable in the SNMP-COMMUNITY-MIB.

Each entry is a term:

-

{TargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId}.

or

-{TargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize}.

or

-{TargetName, Domain, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize}.

+

{TargetName, Domain, Addr, Timeout, RetryCount, TagList, ParamsName, EngineId}. +

or

+ {TargetName, Domain, Addr, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize}.

TargetName is a unique non-empty string.

@@ -374,11 +395,14 @@ transportDomainUdpIpv4 | transportDomainUdpIpv6.

-

Ip is a list of four or eight integers.

-
- -

Udp is an integer.

+

Addr is either an IpAddr or + an {IpAddr, IpPort} tuple. IpAddr is either + a regular Erlang/OTP + ip_address() + or a traditional SNMP integer list, and IpPort is an integer.

+

If IpPort is omitted 162 is used.

+

Timeout is an integer.

@@ -395,13 +419,17 @@

EngineId is a string or the atom discovery.

-

TMask is a list of integer() of size 0, - size 6 or size 10 (default: []).

+

TMask is specified just as Addr or as []. + Note in particular that using a list of 6 bytes for IPv4 + or 8 words plus 2 bytes for IPv6 are still valid address formats + so old configurations will work.

MaxMessageSize is an integer (default: 2048).

+

The old tuple formats with Ip address and Udp + port number found in old configurations still work.

Note that if EngineId has the value discovery, the agent cannot send inform messages to that manager until it has performed the diff --git a/lib/snmp/doc/src/snmp_agent_netif.xml b/lib/snmp/doc/src/snmp_agent_netif.xml index fccfc8857a..a9ce05e757 100644 --- a/lib/snmp/doc/src/snmp_agent_netif.xml +++ b/lib/snmp/doc/src/snmp_agent_netif.xml @@ -4,7 +4,7 @@

- 19972013 + 19972014 Ericsson AB. All Rights Reserved. @@ -51,7 +51,8 @@

It is also possible to write your own Net if process. The default Net if process is implemented in the module snmpa_net_if and - it uses UDP as the transport protocol. + it uses UDP as the transport protocol i.e the transport domains + transportDomainUdpIpv4 and/or transportDomainUdpIpv6.

This section describes how to write a Net if process.

@@ -70,6 +71,12 @@

The section Messages describes mandatory messages, which Net if must send and be able to receive.

+

In this section an Address field is a + {Domain, Addr} tuple where Domain is + transportDomainUdpIpv4 or transportDomainUdpIpv4, + and Addr is an + {IpAddr, + IpPort} tuple.

@@ -96,10 +103,7 @@ MasterAgent ! {snmp_pdu, Vsn, Pdu, PduMS, ACMData, From, Extra} in use. Normally this is returned from snmpa_mpd:process_packet (see Reference Manual). - From is the source address. If UDP over IP is - used, this should be a 2-tuple {IP, UDPport}, where - IP is a 4-tuple with the IP address, and UDPport - is an integer. + From is the source Address. Extra is any term the Net if process wishes to send to the agent. This term can be retrieved by the @@ -127,10 +131,7 @@ Pid ! {snmp_response_received, Vsn, Pdu, From} Pdu is the SNMP Pdu received - From is the source address. If UDP over IP is - used, this should be a 2-tuple {IP, UDPport}, where - IP is a 4-tuple with the IP address, and UDPport - is an integer. + From is the source Address.
@@ -168,10 +169,9 @@ Pid ! {snmp_response_received, Vsn, Pdu, From} (see Reference Manual).

-

To is the destination address. If UDP over IP - is used, this should be a 2-tuple {IP, UDPport}, - where IP is a 4-tuple with the IP address, and - UDPport is an integer.

+

To is the destination Address that comes + from the From field in the corresponding snmp_pdu + message previously sent to the MasterAgent.

Extra is the term that the Net if process @@ -230,7 +230,8 @@ Pid ! {snmp_response_received, Vsn, Pdu, From} SNMPv3, it is the context information.

-

To is a list of the destination addresses and +

To is a list of {Address, SecData} + tuples i.e the destination addresses and their corresponding security parameters. This value is normally sent to snmpa_mpd:generate_message/4.

@@ -268,7 +269,8 @@ Pid ! {snmp_response_received, Vsn, Pdu, From} SNMPv3, it is the context information.

-

To is a list of the destination addresses and +

To is a list of {Address, SecData} + tuples i.e the destination addresses and their corresponding security parameters. This value is normally sent to snmpa_mpd:generate_message/4.

diff --git a/lib/snmp/doc/src/snmp_manager_config_files.xml b/lib/snmp/doc/src/snmp_manager_config_files.xml index 486ef7c170..d8bd4b0f3a 100644 --- a/lib/snmp/doc/src/snmp_manager_config_files.xml +++ b/lib/snmp/doc/src/snmp_manager_config_files.xml @@ -4,7 +4,7 @@
- 20042013 + 20042014 Ericsson AB. All Rights Reserved. @@ -64,13 +64,42 @@

Variable is one of the following:

- -

address - which defines the IP address of the - manager. Default is local host.

-
+ +

transports - which defines the transport domains + and their addresses for the manager. Mandatory +

+

Value is a list of {Domain, Addr} tuples + or Domain atoms. +

+ + +

Domain is one of transportDomainUdpIpv4 + or transportDomainUdpIpv6.

+
+ +

Addr is for the currently supported domains + either an IpAddr or an {IpAddr, IpPort} + tuple.IpAddr is either a regular Erlang/OTP + + ip_address() or a traditional SNMP integer list + and IpPort is an integer. +

+

When Addr does not contain a port number, + the value of port is used. +

+

When a Addr is not specified i.e by + using only a Domain atom, the host's name + is resolved to find the IP address, and the value of + port is used. +

+
+
+

port - which defines which UDP port the manager uses - for communicating with agents. Mandatory.

+ for communicating with agents. + Mandatory if transports does not define + a port number for every transport.

engine_id - The SnmpEngineID as defined in @@ -87,11 +116,13 @@

+

The legacy and intermediate variables address and domain + are still supported so old configurations will work.

The following example shows a manager.conf file:

-{address,          [141,213,11,24]}.
-{port,             5000}.
+{transports,       [{transportDomainUdpIpv4, {{141,213,11,24}, 5000}},
+                    {transportDomainUdpIpv6, {{0,0,0,0,0,0,0,1}, 5000}}]}.
 {engine_id,        "mgrEngine"}.
 {max_message_size, 484}.
     
@@ -146,7 +177,7 @@

Each entry is a tuple:

-

{UserId, TargetName, Comm, Ip, Port, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel}.

+

{UserId, TargetName, Comm, Domain, Addr, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel}.

UserId is the identity of the manager user @@ -160,10 +191,17 @@

Comm is the community string (string).

-

Ip is the ip address of the agent (a list of four integers).

+

Domain is the transport domain, either + transportDomainUdpIpv4 or transportDomainUdpIpv6.

-

Port is the port number of the agent (integer).

+

Addr is the address in the transport domain, + either an {IpAddr, IpPort} tuple or a traditional SNMP + integer list containing port number. IpAddr is either + a regular Erlang/OTP + ip_address() + or a traditional SNMP integer list not containing port number, + and IpPort is an integer.

EngineID is the engine-id of the agent (string).

@@ -190,6 +228,9 @@ authPriv).

+

Legacy configurations using tuples without Domain element, + as well as with all TDomain, Ip and Port elements + still work.

diff --git a/lib/snmp/doc/src/snmp_manager_netif.xml b/lib/snmp/doc/src/snmp_manager_netif.xml index 757ed32880..97cedf00c0 100644 --- a/lib/snmp/doc/src/snmp_manager_netif.xml +++ b/lib/snmp/doc/src/snmp_manager_netif.xml @@ -4,7 +4,7 @@
- 20042013 + 20042014 Ericsson AB. All Rights Reserved. @@ -50,13 +50,14 @@

The snmp application provides two different modules, snmpm_net_if (the default) and snmpm_net_if_mt, - both uses the UDP as the transport protocol. The difference - between the two modules is that the latter is "multi-threaded", - i.e. for each message/request a new process is created that - process the message/request and then exits.

+ both uses UDP as the transport protocol i.e the transport domains + transportDomainUdpIpv4 and/or transportDomainUdpIpv6. + The difference between the two modules is that the latter is + "multi-threaded", i.e. for each message/request a new process + is created that processes the message/request and then exits.

-

It is also possible to write your own Net if process, - this section describes how to write a Net if processdo that.

+

It is also possible to write your own Net if process and + this section describes how to do that.

@@ -70,11 +71,17 @@

The section Messages describes mandatory messages, which Net if must send to the manager server process.

+

In this section a Domain field is the transport domain i.e + one of transportDomainUdpIpv4 or transportDomainUdpIpv6, + and an Addr field is an + {IpAddr, + IpPort} tuple.

+

Net if must send the following message when it receives an SNMP PDU from the network that is aimed for the MasterAgent:

-Server ! {snmp_pdu, Pdu, Addr, Port}
+Server ! {snmp_pdu, Pdu, Domain, Addr}
     
@@ -82,14 +89,14 @@ Server ! {snmp_pdu, Pdu, Addr, Port} snmp_types.hrl, with the SNMP request.

-

Addr is the source address.

+

Domain is the source transport domain.

-

Port is port number of the sender.

+

Addr is the source address.

-Server ! {snmp_trap, Trap, Addr, Port}
+Server ! {snmp_trap, Trap, Domain, Addr}
     
@@ -97,14 +104,14 @@ Server ! {snmp_trap, Trap, Addr, Port} as defined in snmp_types.hrl, with the SNMP request.

-

Addr is the source address.

+

Domain is the source transport domain.

-

Port is port number of the sender.

+

Addr is the source address.

-Server ! {snmp_inform, Ref, Pdu, PduMS, Addr, Port}
+Server ! {snmp_inform, Ref, Pdu, PduMS, Domain, Addr}
     
@@ -123,14 +130,14 @@ Server ! {snmp_inform, Ref, Pdu, PduMS, Addr, Port} snmp_types.hrl, with the SNMP request.

-

Addr is the source address.

+

Domain is the source transport domain.

-

Port is port number of the sender.

+

Addr is the source address.

-Server ! {snmp_report, Data, Addr, Port}
+Server ! {snmp_report, Data, Domain, Addr}
     
@@ -152,10 +159,10 @@ Server ! {snmp_report, Data, Addr, Port}

ReasonInfo is a term().

-

Addr is the source address.

+

Domain is the source transport domain.

-

Port is port number of the sender.

+

Addr is the source address.

diff --git a/lib/snmp/doc/src/snmp_target_mib.xml b/lib/snmp/doc/src/snmp_target_mib.xml index be6fa15c73..a076ff2d8e 100644 --- a/lib/snmp/doc/src/snmp_target_mib.xml +++ b/lib/snmp/doc/src/snmp_target_mib.xml @@ -4,7 +4,7 @@
- 19982013 + 19982014 Ericsson AB. All Rights Reserved. @@ -38,18 +38,18 @@ functions for the SNMP-TARGET-MIB, and functions for configuring the database.

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

+

Legacy API functions add_addr/10 that does not specify + transport domain, and add_addr/11 that has got separate + IpAddr and PortNumber arguments still work as before + for backwards compatibility reasons.

DATA TYPES - +

See the + data types in snmpa_conf.

@@ -129,20 +129,18 @@ transportAddressMask() = [integer()], length 0 (default), 6 (IPv4) or 10 (IPv6) - add_addr(Name, Ip, Port, Timeout, Retry, TagList, Params, EngineId, TMask, MMS) -> Ret - add_addr(Name, Domain, Ip, Port, Timeout, Retry, TagList, Params, EngineId, TMask, MMS) -> Ret + add_addr(Name, Domain, Addr, Timeout, Retry, TagList, Params, EngineId, TMask, MMS) -> Ret Add one target address definition Name = string() Domain = transportDomain() - Ip = transportAddressIPv4() | transportAddressIPv6() (depends on the value of Domain) - Port = integer() + Addr = transportAddress() % Default port is 162 Timeout = integer() Retry = integer() TagList = string() ParamsName = string() EngineId = string() - TMask = transportAddressMask() (depends on Domain) + TMask = transportAddressMask() % Depends on Domain MMS = integer() Ret = {ok, Key} | {error, Reason} Key = term() diff --git a/lib/snmp/doc/src/snmpa_conf.xml b/lib/snmp/doc/src/snmpa_conf.xml index 99a56cd601..2780cec156 100644 --- a/lib/snmp/doc/src/snmpa_conf.xml +++ b/lib/snmp/doc/src/snmpa_conf.xml @@ -4,7 +4,7 @@
- 20062013 + 20062014 Ericsson AB. All Rights Reserved. @@ -45,20 +45,56 @@ DATA TYPES +

For inet:ip4_address(), inet:ip6_address() + and inet:port_number(), see also + + inet:ip_address()

+ + agent_entry(Tag, Val) -> agent_entry() Create an agent entry - Tag = intAgentIpAddress | intAgentUDPPort | intAgentMaxPacketSize | snmpEngineMaxMessageSize | snmpEngineID + Tag = intAgentTransports | intAgentUDPPort | intAgentMaxPacketSize | snmpEngineMaxMessageSize | snmpEngineID Val = term() agent_entry() = term() @@ -390,17 +426,15 @@ transportAddressMask() = [integer()], length 0 (default), 6 (IPv4) or 10 (IPv6) - target_addr_entry(Name, Ip, TagList, ParamsName, EngineId) -> target_addr_entry() - target_addr_entry(Name, Ip, TagList, ParamsName, EngineId, TMask) -> target_addr_entry() - target_addr_entry(Name, Ip, Udp, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry() - target_addr_entry(Name, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry() - target_addr_entry(Name, Domain, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry() + target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId) -> target_addr_entry() + target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask) -> target_addr_entry() + target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry() + target_addr_entry(Name, Domain, Addr, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry() Create an target_addr entry Name = string() Domain = transportDomain() - Ip = transportAddressIPv4() | transportAddressIPv6() (depends on Domain) - Udp = integer() + Ip = transportAddress() (depends on Domain) Timeout = integer() RetryCount = integer() TagList = string() @@ -414,12 +448,12 @@ transportAddressMask() = [integer()], length 0 (default), 6 (IPv4) or 10 (IPv6)

Create an entry for the agent target_addr config file, target_addr.conf.

Name must be a non-empty string.

-

target_addr_entry/5 translates to the following call: - target_addr_entry(Name, Ip, TagList, ParamsName, EngineId).

target_addr_entry/6 translates to the following call: - target_addr_entry(Name, Ip, 162, TagList, ParamsName, EngineId, TMask, 2048).

+ target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, []).

+

target_addr_entry/7 translates to the following call: + target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask, 2048).

target_addr_entry/8 translates to the following call: - target_addr_entry(Name, Ip, Udp, 1500, 3, TagList, ParamsName, EngineId, TMask, MaxMessageSize).

+ target_addr_entry(Name, Domain, Addr, 1500, 3, TagList, ParamsName, EngineId, TMask, MaxMessageSize).

See Target Address Definitions for more info.

diff --git a/lib/snmp/doc/src/snmpa_mpd.xml b/lib/snmp/doc/src/snmpa_mpd.xml index c5ab0a0520..518100d30c 100644 --- a/lib/snmp/doc/src/snmpa_mpd.xml +++ b/lib/snmp/doc/src/snmpa_mpd.xml @@ -4,7 +4,7 @@
- 19992013 + 19992014 Ericsson AB. All Rights Reserved. @@ -43,6 +43,12 @@ +
+ DATA TYPES +

See the + data types in snmpa_conf.

+
+ init(Vsns) -> mpd_state() @@ -63,16 +69,17 @@ - process_packet(Packet, TDomain, TAddress, State, NoteStore, Log) -> {ok, Vsn, Pdu, PduMS, ACMData} | {discarded, Reason} | {discovery, DiscoPacket} - process_packet(Packet, TDomain, TAddress, LocalEngineID, State, NoteStore, Log) -> {ok, Vsn, Pdu, PduMS, ACMData} | {discarded, Reason} | {discovery, DiscoPacket} + process_packet(Packet, From, State, NoteStore, Log) -> {ok, Vsn, Pdu, PduMS, ACMData} | {discarded, Reason} | {discovery, DiscoPacket} + process_packet(Packet, From, LocalEngineID, State, NoteStore, Log) -> {ok, Vsn, Pdu, PduMS, ACMData} | {discarded, Reason} | {discovery, DiscoPacket} Process a packet received from the network Packet = binary() - TDomain = snmpUDPDomain - TAddress = {Ip, Udp} + From = {TDomain, TAddr} + TDomain = transportDomainUdpIpv4 | transportDomainUdpIpv6 + TAddr = {IpAddr, IpPort} LocalEngineID = string() - Ip = {integer(), integer(), integer(), integer()} - Udp = integer() + IpAddr = inet:ip_address() + IpPort = inet:port_number() State = mpd_state() NoteStore = pid() Log = snmp_log() @@ -85,7 +92,7 @@

Processes an incoming packet. Performs authentication and - decryption as necessary. The return values should be passed the + decryption as necessary. The return values should be passed to the agent.

@@ -150,14 +157,20 @@ network.

MsgData is the message specific data used in - the SNMP message. This value is received in a send_pdu - or send_pdu_req message from the agent. In SNMPv1 and + the SNMP message. This value is received in a + send_pdu + or + + send_pdu_req + message from the agent. In SNMPv1 and SNMPv2c, this message data is the community string. In - SNMPv3, it is the context information. - To is a list of the destination addresses and + SNMPv3, it is the context information.

+

+ To is a list of destination addresses and their corresponding security parameters. This value is - also received from the requests mentioned above. -

+ received in the same message from the agent and then transformed + trough process_taddrs + before passed to this function.

Note that the use of the LocalEngineID argument is only intended @@ -166,6 +179,32 @@ (see SNMP-FRAMEWORK-MIB).

+ +
+
+ + + process_taddrs(TDests) -> Dests + Transform addresses from internal MIB format to a less internal + + + TDests = [TDest] + TDest = {{TDomain, TAddr}, SecData} | {TDomain, TAddr} + TDomain = term() % Not at tuple + TAddr = term() + SecData = term() + Dests = [Dest] + Dest = {{Domain, Addr}, SecData} | {Domain, Addr} + Domain = transportDomain() + Addr = transportAddress() % Depends on Domain + + +

Transforms addresses from internal MIB format to one + more useful to Agent Net if. +

+

See also generate_msg. +

+
diff --git a/lib/snmp/doc/src/snmpa_network_interface_filter.xml b/lib/snmp/doc/src/snmpa_network_interface_filter.xml index e08a26ed92..eb640e1bc3 100644 --- a/lib/snmp/doc/src/snmpa_network_interface_filter.xml +++ b/lib/snmp/doc/src/snmpa_network_interface_filter.xml @@ -4,7 +4,7 @@
- 20072013 + 20072014 Ericsson AB. All Rights Reserved. @@ -58,10 +58,10 @@ on two levels:

-

The first level is at the UDP entry / exit point, i.e. - immediately after the receipt of the message, before any message +

The first level is at the transport entry / exit point, i.e. + immediately after the receipt of the message before any message processing is done (accept_recv) and - immediately before sending the message, after all message + immediately before sending the message after all message processing is done (accept_send).

@@ -78,6 +78,12 @@ req_limit and the function register_notification_filter.

+

Legacy network interface filter modules used arguments on the form + (IpAddr, PortNumber,...) instead of + (Domain, Addr, ...), and if the SNMP agent is run without + changing the configuration to use transport domains + the network interface filter will still get + the old arguments and work as before.

@@ -88,15 +94,17 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | 'set-request' | trap | 'get-bulk-request' | 'inform-request' | report +

See also the + data types in snmpa_conf.

- accept_recv(Ip, Port) -> boolean() + accept_recv(Domain, Addr) -> boolean() Shall the received message be accepted - Ip = ip_address() - Port = port() + Domain = transportDomain() + Addr = transportAddressWithPort()

Called at the reception of a message (before any processing @@ -107,11 +115,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | - accept_send(Ip, Port) -> boolean() + accept_send(Domain, Addr) -> boolean() Shall the message be sent - Ip = ip_address() - Port = port() + Domain = transportDomain() + Addr = transportAddressWithPort()

Called before the sending of a message (after all processing @@ -122,11 +130,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | - accept_recv_pdu(Ip, Port, PduType) -> boolean() + accept_recv_pdu(Domain, Addr, PduType) -> boolean() Shall the received pdu be accepted - Ip = ip_address() - Port = port() + Domain = transportDomain() + Addr = transportAddressWithPort() PduType = pdu_type() @@ -144,7 +152,9 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | Targets = targets() targets() = [target()] - target() = {ip_address(), port()} + target() = {Domain, Addr} + Domain = transportDomain() + Addr = transportAddressWithPort() PduType = pdu_type() > 0 Reply = boolean() | NewTargets NewTargets = targets() @@ -155,7 +165,7 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |

For the message to be discarded all together, the function must return false.

Note that it is possible for this function to filter out targets - (but not add its own) by returning an updated + (but not to add its own) by returning an updated Targets list (NewTargets).

diff --git a/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml b/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml index aff71688b6..814f02a14c 100644 --- a/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml +++ b/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml @@ -5,7 +5,7 @@
2008 - 2013 + 2014 Ericsson AB, All Rights Reserved @@ -45,22 +45,30 @@ must export the following functions:

-

delivery_targets/3

+

delivery_targets/3

-

delivery_info/4

+

delivery_info/4

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

+

Legacy notification delivery information receiver modules + used a target argument on the form + {IpAddr, PortNumber} instead of + {Domain, Addr}, and if the SNMP Agent is run without + changing the configuration to use transport domains + the notification delivery information receiver will still get + the old arguments and work as before.

+
DATA TYPES - +

See the + data types in snmpa_conf.

+
@@ -71,10 +79,8 @@ address() = A 4-tuple Inform about target addresses Tag = term() - Targets = [target()] - target() = {Address, Port} - Address = address() - Port = integer() + Targets = [Target] + Target = {transportDomain(), transportAddressWithPort() Extra = term() @@ -94,10 +100,8 @@ address() = A 4-tuple Inform about delivery result Tag = term() - Target = target() - target() = {Address, Port} - Address = address() - Port = integer() + Targets = [Target] + Target = {transportDomain(), transportAddressWithPort() DeliveryResult = delivery_result() delivery_result() = no_response | got_response Extra = term() diff --git a/lib/snmp/doc/src/snmpm.xml b/lib/snmp/doc/src/snmpm.xml index dc8226bb87..ff90e49968 100644 --- a/lib/snmp/doc/src/snmpm.xml +++ b/lib/snmp/doc/src/snmpm.xml @@ -4,7 +4,7 @@
- 20042013 + 20042014 Ericsson AB. All Rights Reserved. @@ -69,6 +69,9 @@ sec_name() = string() sec_level() = noAuthNoPriv | authNoPriv | authPriv ]]> +

See also the + data types in snmpa_conf.

+
@@ -300,9 +303,9 @@ sec_level = noAuthNoPriv | authNoPriv | authPriv

The type of Val depends on Item:

Note that if no tdomain is given, the default value, transportDomainUdpIpv4, is used.

-

Note that if no port is given, the default value is used.

+

Note that if no port is given and if taddress does not + contain a port number, the default value is used.

diff --git a/lib/snmp/doc/src/snmpm_conf.xml b/lib/snmp/doc/src/snmpm_conf.xml index 0cc9ff3379..8635fb705b 100644 --- a/lib/snmp/doc/src/snmpm_conf.xml +++ b/lib/snmp/doc/src/snmpm_conf.xml @@ -4,7 +4,7 @@
- 20062013 + 20062014 Ericsson AB. All Rights Reserved. @@ -195,14 +195,14 @@ - agents_entry(UserId, TargetName, Comm, Ip, Port, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel) -> agents_entry() + agents_entry(UserId, TargetName, Comm, Domain, Addr, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel) -> agents_entry() Create an agents entry UserId = term() TargetName = string() Comm = string() - Ip = string() - Port = integer() + Domain = transportDomain() + Addr = transportAddress() EngineID = string() Timeout = integer() MaxMessageSize = integer() diff --git a/lib/snmp/doc/src/snmpm_mpd.xml b/lib/snmp/doc/src/snmpm_mpd.xml index ad72fd7bc0..c23b2b6833 100644 --- a/lib/snmp/doc/src/snmpm_mpd.xml +++ b/lib/snmp/doc/src/snmpm_mpd.xml @@ -4,7 +4,7 @@
- 20042013 + 20042014 Ericsson AB. All Rights Reserved. @@ -39,7 +39,12 @@ It is supposed to be used from a Network Interface process (Definition of Manager Net if).

+ +

Legacy API function process_msg/7 that has got separate + IpAddr and PortNumber arguments still works as before + for backwards compatibility reasons.

+ init_mpd(Vsns) -> mpd_state() @@ -58,13 +63,12 @@ - process_msg(Msg, TDomain, Addr, Port, State, NoteStore, Logger) -> {ok, Vsn, Pdu, PduMS, MsgData} | {discarded, Reason} + process_msg(Msg, Domain, Addr, State, NoteStore, Logger) -> {ok, Vsn, Pdu, PduMS, MsgData} | {discarded, Reason} Process a message received from the network Msg = binary() - TDomain = snmpUDPDomain - Addr = {integer(), integer(), integer(), integer()} - Port = integer() + Domain = transportDomainUdpIpv4 | transportDomainUdpIpv6 + Addr = {inet:ip_address(), inet:port_number()} State = mpd_state() NoteStore = pid() Logger = function() diff --git a/lib/snmp/doc/src/snmpm_network_interface.xml b/lib/snmp/doc/src/snmpm_network_interface.xml index 6cf7bd6ed7..bea6b46dc7 100644 --- a/lib/snmp/doc/src/snmpm_network_interface.xml +++ b/lib/snmp/doc/src/snmpm_network_interface.xml @@ -4,7 +4,7 @@
- 20042013 + 20042014 Ericsson AB. All Rights Reserved. @@ -69,6 +69,10 @@

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

+

Legacy API function send_pdu/7 that has got separate + IpAddr and PortNumber arguments still works as before + for backwards compatibility reasons.

+ @@ -103,15 +107,15 @@ - send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port, ExtraInfo) -> void() + send_pdu(Pid, Pdu, Vsn, MsgData, Domain, Addr, ExtraInfo) -> void() Request the network interface process to send this pdu Pid = pid() Pdu = pdu() Vsn = 'version-1' | 'version-2' | 'version-3' MsgData = term() - Addr = address() - Port = integer() + Domain = transportDomainUdpIpv4 | transportDomainUdpIpv6 + Addr = {inet:ip_address(), inet:port_number()} ExtraInfo = term() diff --git a/lib/snmp/doc/src/snmpm_network_interface_filter.xml b/lib/snmp/doc/src/snmpm_network_interface_filter.xml index f0526269b3..1ef4f29c0f 100644 --- a/lib/snmp/doc/src/snmpm_network_interface_filter.xml +++ b/lib/snmp/doc/src/snmpm_network_interface_filter.xml @@ -4,7 +4,7 @@
- 20072013 + 20072014 Ericsson AB. All Rights Reserved. @@ -76,6 +76,12 @@ The default filter accepts all messages.

A network interface filter can e.g. be used during testing or for load regulation.

+

Legacy network interface filter modules used arguments on the form + (IpAddr, PortNumber,...) instead of + (Domain, Addr, ...), and if the SNMP manager is run without + changing the configuration to use transport domains + the network interface filter will still get + the old arguments and work as before.

@@ -86,16 +92,18 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | 'set-request' | trap | 'get-bulk-request' | 'inform-request' | report | trappdu +

See also the + data types in snmpa_conf.

- accept_recv(Addr, Port) -> boolean() + accept_recv(Domain, Addr) -> boolean() Shall the received message be accepted - Addr = ip_address() - Port = port() + Domain = transportDomain() + Addr = transportAddressWithPort()

Called at the reception of a message (before any processing @@ -107,11 +115,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | - accept_send(Addr, Port) -> boolean() + accept_send(Domain, Addr) -> boolean() Shall the message be sent - Addr = ip_address() - Port = port() + Domain = transportDomain() + Addr = transportAddressWithPort()

Called before the sending of a message (after all processing @@ -123,11 +131,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | - accept_recv_pdu(Addr, Port, PduType) -> boolean() + accept_recv_pdu(Domain, Addr, PduType) -> boolean() Shall the received pdu be accepted - Addr = ip_address() - Port = port() + Domain = transportDomain() + Addr = transportAddressWithPort() PduType = pdu_type() @@ -141,11 +149,11 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | - accept_send_pdu(Addr, Port, PduType) -> boolean() + accept_send_pdu(Domain, Addr, PduType) -> boolean() Shall the pdu be sent - Addr = ip_address() - Port = port() + Domain = transportDomain() + Addr = transportAddressWithPort() PduType = pdu_type() > 0 diff --git a/lib/snmp/doc/src/snmpm_user.xml b/lib/snmp/doc/src/snmpm_user.xml index 6f412d90f8..a4492839cd 100644 --- a/lib/snmp/doc/src/snmpm_user.xml +++ b/lib/snmp/doc/src/snmpm_user.xml @@ -4,7 +4,7 @@

- 20042013 + 20042014 Ericsson AB. All Rights Reserved. @@ -63,10 +63,15 @@

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

Some of the function has no defined return value (void()), - they can ofcourse return anythyng. But the functions that do have + they can of course return anything. But the functions that do have specified return value(s) must adhere to this. None of the functions can use exit of throw to return.

+

If the manager is not configured to use any particular + transport domain, the behaviour handle_agent/4 + will for backwards copmpatibility reasons be called with the old + IpAddr and PortNumber arguments

+ @@ -116,11 +121,11 @@ snmp_v1_trap_info() :: {Enteprise :: snmp:oid(), - handle_agent(Addr, Port, Type, SnmpInfo, UserData) -> Reply + handle_agent(Domain, Addr, Type, SnmpInfo, UserData) -> Reply Handle agent - Addr = ip_address() - Port = integer() + Domain = transportDomainUdpIpv4 | transportDomainUdpIpv6 + Addr = {inet:ip_address(), inet:port_number()} Type = pdu | trap | report | inform SnmpInfo = SnmpPduInfo | SnmpTrapInfo | SnmpReportInfo | SnmpInformInfo SnmpPduInfo = snmp_gen_info() -- cgit v1.2.3