From 7558861af77de9405decc8d88b2c799e15f266da Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 10 Sep 2013 10:18:53 +0200 Subject: [snmp/manager] Improve handling of unexpected/invalid snmpm_user callbacks Improved handling of unexpected return values from snmpm_user callback functions. Violations of the documented API (crashes or invalid return values) will now result in an error message. Updated doc for snmpm_user bahaviour and some other stuff. Add more (common) type defs. Update manager example. Fixed manager test(s). Fixed unused vars in (manager) test suite. Make test user follow defined behaviour. --- lib/snmp/doc/src/notes.xml | 85 ++++++++++++++++++ lib/snmp/doc/src/snmpm_user.xml | 187 +++++++++++++++++++++++----------------- 2 files changed, 191 insertions(+), 81 deletions(-) (limited to 'lib/snmp/doc') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 21c417f0c1..646e3027d6 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -33,6 +33,91 @@ +
+ SNMP Development Toolkit 4.25 +

Version 4.25 supports code replacement in runtime from/to + version 4.24.1, 4.24, 4.23.1 and 4.23.

+ +
+ Improvements and new features + + + + +

[manager] Improved handling of unexpected return values from + snmpm_user + callback functions.

+

Violations of the documented API (crashes or invalid return + values) will now result in an error message.

+

Own Id: OTP-11307

+
+ +
+ +
+ +
+ Fixed Bugs and Malfunctions +

-

+ + + +
+ +
+ Incompatibilities + + + + +

[manager] The + snmpm_user + callback functions are no longer allowed to "return" via + exit or throw.

+

Own Id: OTP-11307

+
+ +
+
+ +
+ +
SNMP Development Toolkit 4.24.1

Version 4.24.1 supports code replacement in runtime from/to diff --git a/lib/snmp/doc/src/snmpm_user.xml b/lib/snmp/doc/src/snmpm_user.xml index 1823e0c815..cb2deab976 100644 --- a/lib/snmp/doc/src/snmpm_user.xml +++ b/lib/snmp/doc/src/snmpm_user.xml @@ -1,10 +1,10 @@ - +

- 20042009 + 20042013 Ericsson AB. All Rights Reserved. @@ -56,40 +56,59 @@

handle_report/3

+ +

handle_invalid_result/2

+

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

-

Note that if an agent is registered using the old, no longer - documented, functions (using Addr and Port), the old variant of the - callback functions, handle_pdu, handle_trap, handle_inform and - handle_report, will be called.

+ below.

+

Some of the function has no defined return value (void()), + they can ofcourse return anythyng. 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.

- + + +
+ DATA TYPES + + +
+ - handle_error(ReqId, Reason, UserData) -> Reply + handle_error(ReqId, Reason, UserData) -> void() Handle error ReqId = integer() Reason = {unexpected_pdu, SnmpInfo} | {invalid_sec_info, SecInfo, SnmpInfo} | {empty_message, Addr, Port} | term() + SnmpInfo = snmp_gen_info() + SecInfo = term() Addr = ip_address() Port = integer() UserData = term() - Reply = ignore

This function is called when the manager needs to - communicate an "asynchronous" error, to the user: - e.g. failure to send an asynchronous message (i.e. encoding - error), a received message was discarded due to security - error, the manager failed to generate a response message to - a received inform-request, or when receiving an unexpected - PDU from an agent (could be an expired async request).

-

If ReqId is less then 0, it means that this - information was not available to the manager (that info was - never retrieved before the message was discarded). -

+ communicate an "asynchronous" error to the user: + e.g. failure to send an asynchronous message (i.e. encoding + error), a received message was discarded due to security + error, the manager failed to generate a response message to + a received inform-request, or when receiving an unexpected + PDU from an agent (could be an expired async request).

+

If ReqId is less then 0, it means that this + information was not available to the manager (that info was + never retrieved before the message was discarded).

For SnmpInfo see handle_agent below.

@@ -104,22 +123,22 @@ Port = integer() Type = pdu | trap | report | inform SnmpInfo = SnmpPduInfo | SnmpTrapInfo | SnmpReportInfo | SnmpInformInfo - ErrorStatus = atom() - ErrorIndex = integer() - Varbinds = [varbind()] - varbind() = #varbind + SnmpPduInfo = snmp_gen_info() + SnmpTrapInfo = snmp_v1_trap_info() + SnmpReportInfo = snmp_gen_info() + SnmpInformInfo = snmp_gen_info() UserData = term() - Reply = ignore | {register, UserId, TargetName, agent_info()} + Reply = ignore | {register, UserId, TargetName, AgentConfig} UserId = term() TargetName = target_name() - agent_info() = [{agent_info_item(), agent_info_value()}] + AgentConfig = [agent_config()] -

This function is called when a message is received from an - unknown agent.

+

This function is called when a message is received from an + unknown agent.

Note that this will always be the default user that is called.

-

For more info about the agent_info(), see - register_agent.

+

For more info about the agent_config(), see + register_agent.

The arguments Type and SnmpInfo relates in the following way:

@@ -148,7 +167,7 @@

The only user which would return - {register, UserId, TargetName, agent_info()} is the + {register, UserId, TargetName, AgentConfig} is the default user.

@@ -156,18 +175,13 @@
- handle_pdu(TargetName, ReqId, SnmpPduInfo, UserData) -> Reply + handle_pdu(TargetName, ReqId, SnmpPduInfo, UserData) -> void() Handle the reply to an asynchronous request TargetName = target_name() ReqId = term() - SnmpPduInfo = {ErrorStatus, ErrorIndex, Varbinds} - ErrorStatus = atom() - ErrorIndex = integer() - Varbinds = [varbind()] - varbind() = #varbind + SnmpPduInfo = snmp_gen_info() UserData = term() - Reply = ignore

Handle the reply to an asynchronous request, such as @@ -186,27 +200,19 @@ Handle a trap/notification message TargetName = TargetName2 = target_name() - SnmpTrapInfo = {Enteprise, Generic, Spec, Timestamp, Varbinds} | {ErrorStatus, ErrorIndex, Varbinds} - Enterprise = oid() - Generic = integer() - Spec = integer() - Timestamp = integer() - ErrorStatus = atom() - ErrorIndex = integer() - Varbinds = [varbind()] - varbind() = #varbind + SnmpTrapInfo = snmp_v1_trap_info() | snmp_gen_info() UserData = term() - Reply = ignore | unregister | {register, UserId, TargetName2, agent_info()} + Reply = ignore | unregister | {register, UserId, TargetName2, AgentConfig} UserId = term() - agent_info() = [{agent_info_item(), agent_info_value()}] + AgentConfig = [agent_config()]

Handle a trap/notification message from an agent.

-

For more info about the agent_info(), see - register_agent

+

For more info about the agent_config(), see + register_agent

The only user which would return - {register, UserId, TargetName2, agent_info()} is the - default user.

+ {register, UserId, TargetName2, agent_info()} is the + default user.

@@ -217,29 +223,25 @@ Handle a inform message TargetName = TargetName2 = target_name() - SnmpInformInfo = {ErrorStatus, ErrorIndex, Varbinds} - ErrorStatus = atom() - ErrorIndex = integer() - Varbinds = [varbind()] - varbind() = #varbind + SnmpInformInfo = snmp_gen_info() UserData = term() - Reply = ignore | unregister | {register, UserId, TargetName2, agent_info()} + Reply = ignore | no_reply | unregister | {register, UserId, TargetName2, AgentConfig} UserId = term() - agent_info() = [{agent_info_item(), agent_info_value()}] + AgentConfig = [agent_config()]

Handle a inform message.

-

For more info about the agent_info(), see - register_agent

+

For more info about the agent_config(), see + register_agent

The only user which would return - {register, UserId, TargetName2, agent_info()} is the - default user.

-

If the - inform request behaviour - configuration option is set to user or - {user, integer()}, the response (acknowledgment) to this - inform-request will be sent when this function returns.

- + {register, UserId, TargetName2, AgentConfig} is the + default user.

+

If the + inform request behaviour + configuration option is set to user or + {user, integer()}, the response (acknowledgment) to this + inform-request will be sent when this function returns.

+
@@ -251,23 +253,46 @@ TargetName = TargetName2 = target_name() Addr = ip_address() Port = integer() - SnmpReportInfo = {ErrorStatus, ErrorIndex, Varbinds} - ErrorStatus = atom() - ErrorIndex = integer() - Varbinds = [varbind()] - varbind() = #varbind + SnmpReportInfo = snmp_gen_info() UserData = term() - Reply = ignore | unregister | {register, UserId, TargetName2, agent_info()} + Reply = ignore | unregister | {register, UserId, TargetName2, AgentConfig} UserId = term() - agent_info() = [{agent_info_item(), agent_info_value()}] + AgentConfig = [agent_config()]

Handle a report message.

-

For more info about the agent_info(), see - register_agent

+

For more info about the agent_config(), see + register_agent

The only user which would return - {register, UserId, TargetName2, agent_info()} is the - default user.

+ {register, UserId, TargetName2, AgentConfig} is the + default user.

+ + +
+ + + + handle_invalid_result(IN, OUT) -> void() + Handle a report message + + IN = {Func, Args} + Func = atom() + Args = list() + OUT = {crash, CrashInfo} | {result, InvalidResult} + CrashInfo = {ErrorType, Error, Stacktrace} + ErrorType = atom() + Error = term() + Stacktrace = list() + InvalidResult = term() + + +

If any of the other callback functions crashes + (exit, throw or a plain crash) or return an invalid result (if a valid + return has been specified), this function is called. + The purpose is to allow the user handle this + error (for instance to issue an error report).

+

IN reprecents the function called (and its arguments). + OUT represents the unexpected/invalid result.

-- cgit v1.2.3 From c83c236f6a0a1a5299376e40db57e7b7527cbac7 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Fri, 20 Sep 2013 14:23:35 -0400 Subject: [snmp/agent] enable SNMP to create missing database directories Add {db_init_error, create_db_and_dir} option to SNMP manager and agent. This allows them to create any missing parent directories for db_dir, rather than treating any missing directories as a fatal error. The default for db_init_error, which is terminate, is unchanged. Add create_db_and_dir to the documentation. Add new tests to verify that using create_db_and_dir results in missing parent directories being created. --- lib/snmp/doc/src/snmp_app.xml | 7 +++++-- lib/snmp/doc/src/snmp_config.xml | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'lib/snmp/doc') diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml index e5a05342c1..9ede75b943 100644 --- a/lib/snmp/doc/src/snmp_app.xml +++ b/lib/snmp/doc/src/snmp_app.xml @@ -763,12 +763,15 @@ - db_init_error() = terminate | create + db_init_error() = terminate | create | create_db_and_dir

Defines what to do if the agent or manager is unable to open an existing database file. terminate means that the agent/manager will terminate and create means that the - agent/manager will remove the faulty file(s) and create new ones.

+ agent/manager will remove the faulty file(s) and create new ones, + and create_db_and_dir means that the agent/manager will + create the database file along with any missing parent directories + for the database file.

Default is terminate.

diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml index 61ee7f00ee..30b46e6aa8 100644 --- a/lib/snmp/doc/src/snmp_config.xml +++ b/lib/snmp/doc/src/snmp_config.xml @@ -792,12 +792,15 @@ in so far as it will be converted to the new format if found. - db_init_error() = terminate | create + db_init_error() = terminate | create | create_db_and_dir

Defines what to do if the agent is unable to open an existing database file. terminate means that the - agent/manager will terminate and create means that the - agent/manager will remove the faulty file(s) and create new ones.

+ agent/manager will terminate, create means that the + agent/manager will remove the faulty file(s) and create new ones, + and create_db_and_dir means that the agent/manager will + create the database file along with any missing parent directories + for the database file.

Default is terminate.

-- cgit v1.2.3 From bf552c9138427070b1e17c6fc92f8972d8aef112 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 24 Sep 2013 11:55:21 +0200 Subject: [snmp] Add proper version, release nodes and appup Also fixed copyright end date. OTP-11352 --- lib/snmp/doc/src/notes.xml | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'lib/snmp/doc') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 7514c52dda..2b0daf897b 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -33,6 +33,77 @@
+
+ SNMP Development Toolkit 4.25 +

Version 4.25 supports code replacement in runtime from/to + version 4.24.2, 4.24.1, 4.24, 4.23.1 and 4.23.

+ +
+ Improvements and new features + + + + +

Enable SNMP to create missing database directories.

+

Add + + {db_init_error, create_db_and_dir} option to SNMP + manager + and + agent. + This allows them to create any missing parent directories for + db_dir, rather than treating any missing directories + as a fatal error. + The default for db_init_error, which is terminate, + is unchanged.

+

Steve Vinoski

+

Own Id: OTP-11352

+
+ +
+ +
+ +
+ Fixed Bugs and Malfunctions +

-

+ + + +
+ +
+ Incompatibilities +

-

+ + +
+ +
+ +
SNMP Development Toolkit 4.24.2

Version 4.24.2 supports code replacement in runtime from/to -- cgit v1.2.3 From 08b6fcf4c00deb2efb7ddb759b430ab7effa3cc8 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 11 Oct 2013 13:06:19 +0200 Subject: [snmp] Updated release notes, ref man, appup and assigned proper version --- lib/snmp/doc/src/notes.xml | 72 ++++++++++++++++++++++++++++++++++++++++++++++ lib/snmp/doc/src/snmpa.xml | 48 ++++++++++++++++++++----------- lib/snmp/doc/src/snmpm.xml | 45 ++++++++++++++++++----------- 3 files changed, 131 insertions(+), 34 deletions(-) (limited to 'lib/snmp/doc') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 7514c52dda..1b954a5294 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -33,6 +33,78 @@ +

+ SNMP Development Toolkit 4.25 +

Version 4.25 supports code replacement in runtime from/to + version 2.24.2, 4.24.1, 4.24, 4.23.1 and 4.23.

+ +
+ Improvements and new features + + + + +

Add (atl) log conversion block option.

+

It is now possible to request that the Audit Trail Log should + be blocked during conversion (log_to_txt or log_to_io). + This could be usefull when coverting a large log (when there is + a chance it may otherwise wrap during conversion).

+

See + agent + log_to_txt and + log_to_io and also + manager + log_to_txt and + log_to_io + for details.

+

Own Id: OTP-11396

+

Own Id: seq12433

+
+ +
+ +
+ +
+ Fixed Bugs and Malfunctions +

-

+ + + +
+ +
+ Incompatibilities +

-

+ + +
+ +
+ +
SNMP Development Toolkit 4.24.2

Version 4.24.2 supports code replacement in runtime from/to diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml index 77146f3a89..29e8869401 100644 --- a/lib/snmp/doc/src/snmpa.xml +++ b/lib/snmp/doc/src/snmpa.xml @@ -4,7 +4,7 @@

- 20042012 + 20042013 Ericsson AB. All Rights Reserved. @@ -557,32 +557,39 @@ notification_delivery_info() = #snmpa_notification_delivery_info{} log_to_txt(LogDir) - log_to_txt(LogDir, Mibs) - log_to_txt(LogDir, Mibs, OutFile) -> ok | {error, Reason} - log_to_txt(LogDir, Mibs, OutFile, LogName) -> ok | {error, Reason} - log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) -> ok | {error, Reason} - log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) -> ok | {error, Reason} + log_to_txt(LogDir, Block | Mibs) + log_to_txt(LogDir, Mibs, Block | OutFile) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, Block | LogName) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, Block | LogFile) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block | Start) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start) -> ok | {error, Reason} log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop) -> ok | {error, Reason} Convert an Audit Trail Log to text format LogDir = string() Mibs = [MibName] MibName = string() + Block = block() OutFile = string() LogName = string() LogFile = string() - Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} + Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} Reason = disk_log_open_error() | file_open_error() | term() disk_log_open_error() = {LogName, term()} file_open_error() = {OutFile, term()}

Converts an Audit Trail Log to a readable text file. - OutFile defaults to "./snmpa_log.txt". - LogName defaults to "snmpa_log". - LogFile defaults to "snmpa.log". - See snmp:log_to_txt - for more info.

+ OutFile defaults to "./snmpa_log.txt". + LogName defaults to "snmpa_log". + LogFile defaults to "snmpa.log".

+

The Block option indicates if the log should be blocked + during conversion. This could be usefull when converting large + logs (when otherwise the log could wrap during conversion). + Defaults to false.

+

See snmp:log_to_txt + for more info.

@@ -590,19 +597,22 @@ notification_delivery_info() = #snmpa_notification_delivery_info{} log_to_io(LogDir) -> ok | {error, Reason} - log_to_io(LogDir, Mibs) -> ok | {error, Reason} - log_to_io(LogDir, Mibs, LogName) -> ok | {error, Reason} - log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason} - log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason} + log_to_io(LogDir, Block | Mibs) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, Block | LogName) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, Block | LogFile) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Block | Start) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start) -> ok | {error, Reason} log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop) -> ok | {error, Reason} Convert an Audit Trail Log to text format LogDir = string() Mibs = [MibName] MibName = string() + Block = block() LogName = string() LogFile = string() - Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} + Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} Reason = disk_log_open_error() | file_open_error() | term() disk_log_open_error() = {LogName, term()} file_open_error() = {OutFile, term()} @@ -612,6 +622,10 @@ notification_delivery_info() = #snmpa_notification_delivery_info{} prints it on stdio. LogName defaults to "snmpa_log". LogFile defaults to "snmpa.log". +

The Block option indicates if the log should be blocked + during conversion. This could be usefull when converting large + logs (when otherwise the log could wrap during conversion). + Defaults to false.

See snmp:log_to_io for more info.

diff --git a/lib/snmp/doc/src/snmpm.xml b/lib/snmp/doc/src/snmpm.xml index 07fdd208ff..f7b7e6220e 100644 --- a/lib/snmp/doc/src/snmpm.xml +++ b/lib/snmp/doc/src/snmpm.xml @@ -4,7 +4,7 @@
- 20042012 + 20042013 Ericsson AB. All Rights Reserved. @@ -1209,32 +1209,40 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1 - log_to_txt(LogDir, Mibs) - log_to_txt(LogDir, Mibs, OutFile) -> ok | {error, Reason} - log_to_txt(LogDir, Mibs, OutFile, LogName) -> ok | {error, Reason} - log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) -> ok | {error, Reason} - log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) -> ok | {error, Reason} + log_to_txt(LogDir) + log_to_txt(LogDir, Block | Mibs) + log_to_txt(LogDir, Mibs, Block | OutFile) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, Block | LogName) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, Block | LogFile) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block | Start) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start) -> ok | {error, Reason} log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block, Start, Stop) -> ok | {error, Reason} Convert an Audit Trail Log to text format LogDir = string() Mibs = [MibName] MibName = string() + Block = block() OutFile = string() LogName = string() LogFile = string() - Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} + Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} Reason = disk_log_open_error() | file_open_error() | term() disk_log_open_error() = {LogName, term()} file_open_error() = {OutFile, term()}

Converts an Audit Trail Log to a readable text file. - OutFile defaults to "./snmpm_log.txt". - LogName defaults to "snmpm_log". - LogFile defaults to "snmpm.log". - See snmp:log_to_txt - for more info.

+ OutFile defaults to "./snmpm_log.txt". + LogName defaults to "snmpm_log". + LogFile defaults to "snmpm.log". +

The Block option indicates if the log should be blocked + during conversion. This could be usefull when converting large + logs (when otherwise the log could wrap during conversion). + Defaults to false.

+ See snmp:log_to_txt + for more info.

@@ -1242,20 +1250,23 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1 log_to_io(LogDir) -> ok | {error, Reason} + log_to_io(LogDir, Block | Mibs) -> ok | {error, Reason} log_to_io(LogDir, Mibs) -> ok | {error, Reason} - log_to_io(LogDir, Mibs) -> ok | {error, Reason} - log_to_io(LogDir, Mibs, LogName) -> ok | {error, Reason} - log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason} - log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, Block | LogName) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, Block | LogFile) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Block | Start) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start) -> ok | {error, Reason} log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Block, Start, Stop) -> ok | {error, Reason} Convert an Audit Trail Log to text format LogDir = string() Mibs = [MibName] MibName = string() + Block = block() LogName = string() LogFile = string() - Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} + Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} Reason = disk_log_open_error() | file_open_error() | term() disk_log_open_error() = {LogName, term()} file_open_error() = {OutFile, term()} -- cgit v1.2.3 From a803a95c00f89932d2cfd7a7b424aad05fa276b8 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 17 Oct 2013 17:45:54 +0200 Subject: [snmp] Wrong block cypher type used for AES Wrong block cypher type used for AES ('aes_cbf128' instead of 'aes_cfb128') when performing AES block encrypt/decrypt which breaks SNMP usmAesCfb128Protocol in agent and manager. OTP-11412 --- lib/snmp/doc/src/notes.xml | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'lib/snmp/doc') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 7514c52dda..7155402ab1 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -33,6 +33,74 @@
+
+ SNMP Development Toolkit 4.25 +

Version 4.25 supports code replacement in runtime from/to + version 4.24.2, 4.24.1, 4.24, 4.23.1 and 4.23.

+ +
+ Improvements and new features +

-

+ + + +
+ +
+ Fixed Bugs and Malfunctions + + + + +

Wrong block cypher type used for AES ('aes_cbf128' + instead of 'aes_cfb128') when performing AES block + encrypt/decrypt which breaks SNMP usmAesCfb128Protocol + in agent and manager.

+

Own Id: OTP-11412

+
+ +
+ +
+ +
+ Incompatibilities +

-

+ + +
+ +
+ +
SNMP Development Toolkit 4.24.2

Version 4.24.2 supports code replacement in runtime from/to -- cgit v1.2.3 From 300803837926d0bb28829f313fad07f757188d41 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 18 Oct 2013 11:32:25 +0200 Subject: [snmp/manager] Incorrect use of EngineBoots and EngineTime when encrypting When performing the AES encryption, invalid values for the EngineBoots and EngineTime was used. The values of the local agent was used, which would have produced some values if an agent was actually running. If not it would have caused a crash. OTP-11413 --- lib/snmp/doc/src/notes.xml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/snmp/doc') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 7155402ab1..977af3ffb2 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -77,6 +77,15 @@

Own Id: OTP-11412

+ +

[manager] When performing the AES encryption, invalid values for + the EngineBoots and EngineTime was used.

+

The values of the local agent was used, which would have produced + some values if an agent was actually running. + If not it would have caused a crash.

+

Own Id: OTP-11413

+
+
-- cgit v1.2.3 From 1508a71c3ec41347e6e34c57671028f2e4640680 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 19 Nov 2013 12:41:02 +0100 Subject: [snmp] Cleanup and changed atl conversion block default Changed the default value for the Audit Trail Log conversion to true. Also some cleanup. OTP-11396 --- lib/snmp/doc/src/snmp.xml | 80 ++++++++++++++++++++++++---------------------- lib/snmp/doc/src/snmpa.xml | 8 ++--- lib/snmp/doc/src/snmpm.xml | 12 ++++--- 3 files changed, 54 insertions(+), 46 deletions(-) (limited to 'lib/snmp/doc') diff --git a/lib/snmp/doc/src/snmp.xml b/lib/snmp/doc/src/snmp.xml index 3e6610891f..97b479385c 100644 --- a/lib/snmp/doc/src/snmp.xml +++ b/lib/snmp/doc/src/snmp.xml @@ -341,8 +341,9 @@ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) -> ok | {error, Reason} - log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) -> ok | {error, Reason} - log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Block | Start) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Block | Stop) -> ok | {error, Reason} + log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop, Block) -> ok | {error, Reason} Convert an Audit Trail Log to text format LogDir = string() @@ -352,53 +353,56 @@ LogName = string() LogFile = string() Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} + Block = boolean() Reason = term() -

Converts an Audit Trail Log to a readable text file, where - each item has a trailing TAB character, and any TAB - character in the body of an item has been replaced by ESC - TAB. -

+

Converts an Audit Trail Log to a readable text file, where + each item has a trailing TAB character, and any TAB + character in the body of an item has been replaced by ESC + TAB.

The function can be used on a running system, or by copying - the entire log directory and calling this function. SNMP - must be running in order to provide MIB information. -

+ the entire log directory and calling this function. SNMP + must be running in order to provide MIB information.

LogDir is the name of the directory where the audit - trail log is stored. - Mibs is a list of Mibs to be used. The function uses - the information in the Mibs to convert for example object - identifiers to their symbolic name. - OutFile is the name of the generated text-file. - LogName is the name of the log, - LogFile is the name of the log file. - Start is the start (first) date and time from which - log events will be converted and - Stop is the stop (last) date and time to which log - events will be converted. -

-

The format of an audit trail log text item is as follows: -

-

Tag Addr - Community [TimeStamp] Vsn

- PDU

-

where Tag is request, response, - report, trap or inform; Addr is - IP:Port (or comma space separated list of such); - Community is the community parameter (SNMP version - v1 and v2), or SecLevel:"AuthEngineID":"UserName" - (SNMP v3); TimeStamp is a date and time stamp, - and Vsn is the SNMP version. PDU is a textual - version of the protocol data unit. There is a new line - between Vsn and PDU.

- + trail log is stored. + Mibs is a list of Mibs to be used. The function uses + the information in the Mibs to convert for example object + identifiers to their symbolic name. + OutFile is the name of the generated text-file. + LogName is the name of the log, + LogFile is the name of the log file. + Start is the start (first) date and time from which + log events will be converted and + Stop is the stop (last) date and time to which log + events will be converted. + The Block argument indicates if the log should be blocked + during conversion. This could be usefull when converting large + logs (when otherwise the log could wrap during conversion). + Defaults to true. +

+

The format of an audit trail log text item is as follows:

+

Tag Addr - Community [TimeStamp] Vsn

+ PDU

+

where Tag is request, response, + report, trap or inform; Addr is + IP:Port (or comma space separated list of such); + Community is the community parameter (SNMP version + v1 and v2), or SecLevel:"AuthEngineID":"UserName" + (SNMP v3); TimeStamp is a date and time stamp, + and Vsn is the SNMP version. PDU is a textual + version of the protocol data unit. There is a new line + between Vsn and PDU.

+
log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason} - log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason} - log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Block | Start) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Start, Block | Stop) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop, Block) -> ok | {error, Reason} Convert an Audit Trail Log to text format LogDir = string() diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml index 29e8869401..cc8681e5c8 100644 --- a/lib/snmp/doc/src/snmpa.xml +++ b/lib/snmp/doc/src/snmpa.xml @@ -570,7 +570,7 @@ notification_delivery_info() = #snmpa_notification_delivery_info{} LogDir = string() Mibs = [MibName] MibName = string() - Block = block() + Block = boolean() OutFile = string() LogName = string() LogFile = string() @@ -587,7 +587,7 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}

The Block option indicates if the log should be blocked during conversion. This could be usefull when converting large logs (when otherwise the log could wrap during conversion). - Defaults to false.

+ Defaults to true.

See snmp:log_to_txt for more info.

@@ -609,7 +609,7 @@ notification_delivery_info() = #snmpa_notification_delivery_info{} LogDir = string() Mibs = [MibName] MibName = string() - Block = block() + Block = boolean() LogName = string() LogFile = string() Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} @@ -625,7 +625,7 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}

The Block option indicates if the log should be blocked during conversion. This could be usefull when converting large logs (when otherwise the log could wrap during conversion). - Defaults to false.

+ Defaults to true.

See snmp:log_to_io for more info.

diff --git a/lib/snmp/doc/src/snmpm.xml b/lib/snmp/doc/src/snmpm.xml index f7b7e6220e..a0a1b5716d 100644 --- a/lib/snmp/doc/src/snmpm.xml +++ b/lib/snmp/doc/src/snmpm.xml @@ -1223,7 +1223,7 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1 LogDir = string() Mibs = [MibName] MibName = string() - Block = block() + Block = boolean() OutFile = string() LogName = string() LogFile = string() @@ -1237,10 +1237,10 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1 OutFile defaults to "./snmpm_log.txt". LogName defaults to "snmpm_log". LogFile defaults to "snmpm.log". -

The Block option indicates if the log should be blocked +

The Block argument indicates if the log should be blocked during conversion. This could be usefull when converting large logs (when otherwise the log could wrap during conversion). - Defaults to false.

+ Defaults to true.

See snmp:log_to_txt for more info.

@@ -1263,7 +1263,7 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1 LogDir = string() Mibs = [MibName] MibName = string() - Block = block() + Block = boolean() LogName = string() LogFile = string() Start = Stop = null | calendar:datetime() | {local_time, calendar:datetime()} | {universal_time, calendar:datetime()} @@ -1276,6 +1276,10 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1 prints it on stdio. LogName defaults to "snmpm_log". LogFile defaults to "snmpm.log". +

The Block argument indicates if the log should be blocked + during conversion. This could be usefull when converting large + logs (when otherwise the log could wrap during conversion). + Defaults to true.

See snmp:log_to_io for more info.

-- cgit v1.2.3