anchor.diff:  incr(_, #diameter_packet{msg = undefined}, _) ->
       ok;
   
  -incr(Dir, Pkt, TPid)
  -  when is_pid(TPid) ->
  +incr(recv = D, #diameter_packet{header = H, errors = [_|_]}, TPid) ->
  +    incr(TPid, {diameter_codec:msg_id(H), D, error});
  +
  +incr(Dir, Pkt, TPid) ->
       #diameter_packet{header = #diameter_header{is_error = E}
                               = Hdr,
                        msg = Rec}
  
positive.code:         orelse (E andalso PE)
          orelse x({invalid_error_bit, RC}, answer, [Dir, Pkt]),
  
      Ctr = rc_counter(Rec, RC),
      is_tuple(Ctr)
          andalso incr(TPid, {diameter_codec:msg_id(Hdr), Dir, Ctr}).
  
  %% incr/2
  
  incr(TPid, Counter) ->
      diameter_stats:incr(Counter, TPid, 1).
  
  %% RFC 3588, 7.6:
  %%
  
negative.code: handle_answer(SvcName,
                AnswerErrors,
                {answer, #request{dictionary = Dict} = Req, Pkt}) ->
      answer(examine(diameter_codec:decode(Dict, Pkt)),
             SvcName,
             AnswerErrors,
             Req).
  
  %% We don't really need to do a full decode if we're a relay and will
  %% just resend with a new hop by hop identifier, but might a proxy
  %% want to examine the answer?
  
  answer(Pkt, SvcName, AE, #request{transport = TPid} = Req) ->
      try
          incr(recv, Pkt, TPid)
      of
          _ -> a(Pkt, SvcName, AE, Req)
      catch
          exit: {invalid_error_bit, _} = E ->
              a(Pkt#diameter_packet{errors = [E]}, SvcName, AE, Req)
      end.
  
  a(#diameter_packet{errors = Es} = Pkt, SvcName, AE, #request{transport = TPid,
                                                               caps = Caps,
                                                               packet = P}
                                                      = Req)
    when [] == Es;
         callback == AE ->
      cb(Req, handle_answer, [Pkt, msg(P), SvcName, {TPid, Caps}]);
      
  a(Pkt, SvcName, report, Req) ->
      x(errors, handle_answer, [SvcName, Req, Pkt]);
  
  a(Pkt, SvcName, discard, Req) ->
      x({errors, handle_answer, [SvcName, Req, Pkt]}).
  
  %% Note that we don't check that the application id in the answer's
  