aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2012-02-14 12:03:16 +0100
committerMicael Karlberg <[email protected]>2012-02-14 12:03:16 +0100
commit7dae219762c7048e3c6a24aa8b172e998bf300df (patch)
tree7cf10ba5b2cd4f9dea6c9033f73d397985bc81c9 /lib
parent0c9547c384ba9d299d4a73bdf2a514c2b47128cd (diff)
parent5c16cd5f30829fb3edf4e924cba5d59774865270 (diff)
downloadotp-7dae219762c7048e3c6a24aa8b172e998bf300df.tar.gz
otp-7dae219762c7048e3c6a24aa8b172e998bf300df.tar.bz2
otp-7dae219762c7048e3c6a24aa8b172e998bf300df.zip
Merge branch 'bmk/snmp/updating_examples/r14/20120214' into bmk/snmp/updating_examples/r15/20120214
Diffstat (limited to 'lib')
-rw-r--r--lib/snmp/examples/ex2/snmp_ex2_manager.erl13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/snmp/examples/ex2/snmp_ex2_manager.erl b/lib/snmp/examples/ex2/snmp_ex2_manager.erl
index ff873327bc..1b247d713d 100644
--- a/lib/snmp/examples/ex2/snmp_ex2_manager.erl
+++ b/lib/snmp/examples/ex2/snmp_ex2_manager.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -39,7 +39,7 @@
%% Manager callback API:
-export([handle_error/3,
- handle_agent/4,
+ handle_agent/5,
handle_pdu/4,
handle_trap/3,
handle_inform/3,
@@ -265,16 +265,17 @@ handle_snmp_callback(handle_error, {ReqId, Reason}) ->
"~n Reason: ~p"
"~n", [ReqId, Reason]),
ok;
-handle_snmp_callback(handle_agent, {Addr, Port, SnmpInfo}) ->
+handle_snmp_callback(handle_agent, {Addr, Port, Type, SnmpInfo}) ->
{ES, EI, VBs} = SnmpInfo,
io:format("*** UNKNOWN AGENT ***"
"~n Address: ~p"
"~n Port: ~p"
+ "~n Type: ~p"
"~n SNMP Info: "
"~n Error Status: ~w"
"~n Error Index: ~w"
"~n Varbinds: ~p"
- "~n", [Addr, Port, ES, EI, VBs]),
+ "~n", [Addr, Port, Type, ES, EI, VBs]),
ok;
handle_snmp_callback(handle_pdu, {TargetName, ReqId, SnmpResponse}) ->
{ES, EI, VBs} = SnmpResponse,
@@ -382,8 +383,8 @@ handle_error(ReqId, Reason, Server) when is_pid(Server) ->
ignore.
-handle_agent(Addr, Port, SnmpInfo, Server) when is_pid(Server) ->
- report_callback(Server, handle_agent, {Addr, Port, SnmpInfo}),
+handle_agent(Addr, Port, Type, SnmpInfo, Server) when is_pid(Server) ->
+ report_callback(Server, handle_agent, {Addr, Port, Type, SnmpInfo}),
ignore.