anchor.diff:  %% an encoded binary. This isn't the usual case and doesn't properly
   %% support retransmission but is useful for test.
   
  +encode(Dict, TPid, Pkt)
  +  when is_atom(Dict) ->
  +    encode({Dict, Dict}, TPid, Pkt);
  +
   %% A message to be encoded.
  -encode(Dict, TPid, #diameter_packet{bin = undefined} = Pkt) ->
  +encode(DictT, TPid, #diameter_packet{bin = undefined} = Pkt) ->
  +    {Dict, AppDict} = DictT,
       try
           diameter_codec:encode(Dict, Pkt)
       catch
           exit: {diameter_codec, encode, T} = Reason ->
  -            incr_error(send, T, TPid, Dict),
  +            incr_error(send, T, TPid, AppDict),
               exit(Reason)
       end;
   
  
positive.code: %%    code, the missing vendor id, and a zero filled payload of the minimum
  %%    required length for the omitted AVP will be added.
  
  %% incr_rc/5
  %%
  %% Increment a stats counter for result codes in incoming and outgoing
  %% answers.
  
  %% Outgoing message as binary: don't count. (Sending binaries is only
  %% partially supported.)
  incr_rc(_, #diameter_packet{msg = undefined = No}, _, _, _) ->
      No;
  
  %% Incoming or outgoing. Outgoing with encode errors never gets here
  %% since encode fails.
  incr_rc(Dir, Pkt, Dict, TPid, Dict0) ->
      #diameter_packet{header = #diameter_header{is_error = E}
                              = Hdr,
                       msg = Msg,
                       errors = Es}
          = Pkt,
  
      Id = msg_id(Hdr, Dict),
  
      %% Count incoming decode errors.
      recv /= Dir orelse [] == Es orelse incr_error(Dir, Id, TPid, Dict),
  
      %% Exit on a missing result code.
      T = rc_counter(Dict, Msg),
  
negative.code: %% want to examine the answer?
  
  handle_A(Pkt, SvcName, Dict, Dict0, App, #request{transport = TPid} = Req) ->
      AppDict = App#diameter_app.dictionary,
  
      incr(recv, Pkt, TPid, AppDict),
  
      try
          incr_result(recv, Pkt, TPid, {Dict, AppDict, Dict0}) %% count incoming
      of
          _ -> answer(Pkt, SvcName, App, Req)
      catch
  