anchor.diff:  	     varbinds     = VBs} when is_list(Index) ->
   	    case lists:member(Idx, Index) of
   		true ->
  +                    ?PRINT2("received expected pdu (~w, ~w, ~w) - check varbinds"
  +                            "~n   Expected VBs: ~p"
  +                            "~n   Received VBs: ~p",
  +                            [Id, Err, Idx, PureVBs, VBs]),
   		    check_vars(Id, PureVBs, VBs);
   		false ->
  +                    ?EPRINT1("received response pdu with unexpected index (~w, ~w):"
  +                             "~n   Expected Index: ~p"
  +                             "~n   Received Index: ~p"
  +                             "~n   Expected VBs:   ~p"
  +                             "~n   Received VBs:   ~p",
  +                             [Id, Err, Index, Idx, PureVBs, VBs]),
   		    {error,Id,
   		     {"ErrStat: ~w, Idx: ~w, Varbinds: ~w, RequestId: ~w",
   		      [Err,Index,PureVBs,ReqId]},
  
positive.code: echo_errors(ok) -> ok;
  echo_errors({ok, Val}) -> {ok, Val}.
  
  get_response_impl(Id, Vars) ->
      case receive_response() of
  	#pdu{type         = 'get-response', 
  	     error_status = noError, 
  	     error_index  = 0,
  	     varbinds     = VBs} ->
  	    match_vars(Id, find_pure_oids2(Vars), VBs, []);
  
  	#pdu{type         = Type2, 
  	     request_id   = ReqId, 
  	     error_status = Err2, 
  	     error_index  = Index2} ->
  	    {error, 
  	     Id, 
  	     {"Type: ~w, ErrStat: ~w, Idx: ~w, RequestId: ~w",
  
negative.code: %% Returns: ok | {error, Id, {ExpectedFormat, ExpectedData}, {Format, Data}}
  %%----------------------------------------------------------------------
  expect_impl(Id, any) -> 
      ?PRINT2("await ~w pdu (any)", [Id]),
      case receive_response() of
  	PDU when is_record(PDU, pdu) -> 
              ?PRINT2("received expected pdu (~w)", [Id]),
              ok;
  	{error, Reason} ->
              ?EPRINT1("unexpected receive error: ~w"
                       "~n   ~p", [Id, Reason]),
              format_reason(Id, Reason)
      end;
  
  expect_impl(Id, return) -> 
      ?PRINT2("await ~w pdu", [Id]),
      case receive_response() of
  	PDU when is_record(PDU, pdu) ->
              ?PRINT2("received expected pdu (~w)", [Id]),
              {ok, PDU};
  	{error, Reason} ->
              ?EPRINT1("unexpected receive error: ~w"
                       "~n   ~p", [Id, Reason]),
              format_reason(Id, Reason)
      end;
  
  expect_impl(Id, trap) -> 
      ?PRINT2("await ~w trap", [Id]),
      case receive_trap(3500) of
  	PDU when is_record(PDU, trappdu) ->
              ?PRINT2("received expected trap (~w)", [Id]),
              ok;
  	{error, Reason} ->
              ?EPRINT1("unexpected receive error: ~w"
                       "~n   ~p", [Id, Reason]),
              format_reason(Id, Reason)
      end;
  
  expect_impl(Id, timeout) -> 
      ?PRINT2("await ~w nothing", [Id]),
      receive
  	X -> 
              ?EPRINT1("received unexpected message: ~w"
                       "~n   ~p",
                       [Id, X]),
  	    {error, Id, {"Timeout", []}, {"Message ~w",  [X]}}
      after 3500 ->
  	    ok
      end;
  
  expect_impl(Id, Err) when is_atom(Err) ->
      ?PRINT2("await ~w with"
              "~n   Err: ~p",
              [Id, Err]),
      case receive_response() of
  	#pdu{error_status = Err} -> 
              ?PRINT2("received pdu with expected error status (~w, ~w)",
                      [Id, Err]),
  	    ok;
  
  	#pdu{type         = Type2, 
  	     request_id   = ReqId, 
  	     error_status = Err2} ->
              ?EPRINT1("received pdu with unexpected error status: ~w, ~w, ~w"
                       "~n   Expected Error: ~p"
                       "~n   Received Error: ~p",
                       [Type2, Id, ReqId, Err, Err2]),
  	    {error, Id, {"ErrorStatus: ~w, RequestId: ~w", [Err,ReqId]},
  	     {"ErrorStatus: ~w", [Err2]}};
  
  	{error, Reason} -> 
              ?EPRINT1("unexpected receive error: ~w"
                       "~n   ~p", [Id, Reason]),
  	    format_reason(Id, Reason)
      end;
  
  expect_impl(Id, ExpectedVarbinds) when is_list(ExpectedVarbinds) ->
      ?PRINT2("await ~w with"
              "~n   ExpectedVarbinds: ~p",
              [Id, ExpectedVarbinds]),
      PureVars = find_pure_oids(ExpectedVarbinds),
      case receive_response() of
  	#pdu{type         = 'get-response', 
  	     error_status = noError, 
  	     error_index  = 0,
  	     varbinds     = VBs} ->
              ?PRINT2("received expected response pdu (~w) - check varbinds"
                      "~n   Expected VBs: ~p"
                      "~n   Received VBs: ~p",
                      [Id, PureVars, VBs]),
  	    check_vars(Id, PureVars, VBs);
  
  	#pdu{type         = Type2, 
  	     request_id   = ReqId, 
  	     error_status = Err2, 
  	     error_index  = Index2} ->
              ?EPRINT1("received unexpected pdu: ~w, ~w, ~w"
                       "~n   Received Error: ~p"
                       "~n   Received Index: ~p",
                       [Type2, Id, ReqId, Err2, Index2]),
  	    {error, Id, {"Type: ~w, ErrStat: ~w, Idx: ~w, RequestId: ~w", 
  			 ['get-response', noError, 0, ReqId]},
  	     {"Type: ~w, ErrStat: ~w, Idx: ~w", [Type2, Err2, Index2]}};
  
  	{error, Reason} -> 
              ?EPRINT1("unexpected receive error: ~w"
                       "~n   ~p", [Id, Reason]),
  	    format_reason(Id, Reason)
      end.
  
  expect_impl(Id, v2trap, ExpectedVarbinds) when is_list(ExpectedVarbinds) ->
      ?PRINT2("await v2 trap ~w with"
              "~n   ExpectedVarbinds: ~p",
              [Id, ExpectedVarbinds]),
      PureVars = find_pure_oids(ExpectedVarbinds),
      case receive_response() of
  	#pdu{type         = 'snmpv2-trap', 
  	     error_status = noError, 
  	     error_index  = 0,
  	     varbinds     = VBs} ->
              ?PRINT2("received expected v2 trap (~w) - check varbinds"
                      "~n   Expected VBs: ~p"
                      "~n   Received VBs: ~p",
                      [Id, PureVars, VBs]),
  	    check_vars(Id, PureVars, VBs);
  
  	#pdu{type         = Type2, 
  	     request_id   = ReqId, 
  	     error_status = Err2, 
  	     error_index  = Index2} ->
              ?EPRINT1("received unexpected pdu: ~w, ~w, ~w"
                       "~n   Received Error: ~p"
                       "~n   Received Index: ~p",
                       [Type2, Id, ReqId, Err2, Index2]),
  	    {error, Id, {"Type: ~w, ErrStat: ~w, Idx: ~w, RequestId: ~w", 
  			 ['snmpv2-trap', noError, 0, ReqId]},
  	     {"Type: ~w, ErrStat: ~w, Idx: ~w", [Type2, Err2, Index2]}};
  
  	{error, Reason} -> 
              ?EPRINT1("unexpected receive error: ~w"
                       "~n   ~p", [Id, Reason]),
  	    format_reason(Id, Reason)
      end;
  
  expect_impl(Id, report, ExpectedVarbinds) when is_list(ExpectedVarbinds) ->
      ?PRINT2("await report ~w with"
              "~n   ExpectedVarbinds: ~p",
              [Id, ExpectedVarbinds]),
      PureVBs = find_pure_oids(ExpectedVarbinds),
      case receive_response() of
  	#pdu{type         = 'report', 
  	     error_status = noError, 
  	     error_index  = 0,
  	     varbinds     = VBs} ->
              ?PRINT2("received expected report (~w) - check varbinds"
                      "~n   Expected VBs: ~p"
                      "~n   Received VBs: ~p",
                      [Id, PureVBs, VBs]),
  	    check_vars(Id, PureVBs, VBs);
  
  	#pdu{type         = Type2, 
  	     request_id   = ReqId, 
  	     error_status = Err2, 
  	     error_index  = Index2} ->
              ?EPRINT1("received unexpected pdu: ~w, ~w, ~w"
                       "~n   Received Error: ~p"
                       "~n   Received Index: ~p",
                       [Type2, Id, ReqId, Err2, Index2]),
  	    {error, Id, {"Type: ~w, ErrStat: ~w, Idx: ~w, RequestId: ~w", 
  			 [report, noError, 0, ReqId]},
  	     {"Type: ~w, ErrStat: ~w, Idx: ~w", [Type2, Err2, Index2]}};
  
  	{error, Reason} -> 
              ?EPRINT1("unexpected receive error: ~w"
                       "~n   ~p", [Id, Reason]),
  	    format_reason(Id, Reason)
      end;
  
  expect_impl(Id, {inform, Reply}, ExpectedVarbinds) 
    when is_list(ExpectedVarbinds) ->
      ?PRINT2("await inform ~w with"
              "~n   Reply:            ~p"
              "~n   ExpectedVarbinds: ~p",
              [Id, Reply, ExpectedVarbinds]),
      PureVBs = find_pure_oids(ExpectedVarbinds),
      Resp    = receive_response(),
      case Resp of
  	#pdu{type         = 'inform-request', 
  	     error_status = noError, 
  	     error_index  = 0,
  	     varbinds     = VBs} ->
              ?PRINT2("received inform (~w) - check varbinds"
                      "~n   Expected VBs: ~p"
                      "~n   Received VBs: ~p",
                      [Id, PureVBs, VBs]),
  	    case check_vars(Id, PureVBs, VBs) of
  		ok when (Reply == true) ->
                      ?PRINT2("varbinds ok (~w) - send ok inform response", [Id]),
  		    RespPDU = Resp#pdu{type = 'get-response',
  				       error_status = noError,
  				       error_index = 0},
  		    ?MODULE:rpl(RespPDU),
  		    ok;
  		ok when (element(1, Reply) == error) ->
                      ?PRINT2("varbinds ok (~w) - send error inform response", [Id]),
  		    {error, Status, Index} = Reply,
  		    RespPDU = Resp#pdu{type = 'get-response',
  				       error_status = Status,
  