anchor.diff:  
   %% incoming/2
   
  -incoming({recv = T, Name, Pkt}, #state{parent = Pid, ack = Ack} = S) ->
  -    Pid ! {T, self(), get_route(Ack, Pkt), Name, Pkt},
  -    rcv(Name, Pkt, S);
  -
   incoming(#diameter_header{is_request = R}, #state{transport = TPid,
                                                     ack = Ack}) ->
       R andalso Ack andalso send(TPid, false),
  
positive.code:     ?LOG(Reason, T),
      ok.
  
  %% rcv/3
  
  %% Incoming CEA.
  rcv('CEA' = N,
      #diameter_packet{header = #diameter_header{end_to_end_id = Eid,
                                                 hop_by_hop_id = Hid}}
      = Pkt,
      #state{state = {'Wait-CEA', Hid, Eid}}
      = S) ->
      ?LOG(recv, N),
      handle_CEA(Pkt, S);
  
  %% Incoming CER
  rcv('CER' = N, Pkt, #state{state = recv_CER} = S) ->
      handle_request(N, Pkt, S);
  
  %% Anything but CER/CEA in a non-Open state is an error, as is
  %% CER/CEA in anything but recv_CER/Wait-CEA.
  rcv(Name, _, #state{state = PS})
    when PS /= 'Open';
         Name == 'CER';
         Name == 'CEA' ->
      {stop, {Name, PS}};
  
  rcv('DPR' = N, Pkt, S) ->
      handle_request(N, Pkt, S);
  
  %% DPA in response to DPR, with the expected identifiers.
  rcv('DPA' = N,
      #diameter_packet{header = #diameter_header{end_to_end_id = Eid,
                                                 hop_by_hop_id = Hid}
                              = H}
      = Pkt,
      #state{dictionary = Dict0,
             transport = TPid,
             dpr = {X, Hid, Eid},
  
negative.code: %% Ignore an unsolicited DPA in particular. Note that dpa_timeout
  %% deals with the case in which the peer sends the wrong identifiers
  %% in DPA.
  handle('DPA' = N, #diameter_packet{header = H}, _) ->
      ?LOG(ignored, N),
      %% Note that these aren't counted in the normal recv counter.
      diameter_stats:incr({diameter_codec:msg_id(H), recv, ignored}),
      ok;
  
  handle(_, _, _) ->
      ok.
  
  %% incr/3
  