anchor.diff:      %% An exchange of 3 watchdogs (the first directly after
       %% capabilities exchange) brings the connection back up.
   
  -    ?EVENT({watchdog, Ref, _, {reopen, okay}, _}, 2, WdL, WdH),
  -    ?EVENT({up, Ref, _, _, #diameter_packet{}}, 0),
  +    {reopen, okay} = ?WD_EVENT(Ref),
  +    ?EVENT({up, Ref, _, _, #diameter_packet{}}),
  +
  +    %% Three DWR's have been answered.
  +    R3 = R2 + 3,
  +    A3 = A2 + 3,
  +    [R3,_,_,A3] = wd_counts(SvcName),
   
       %% Non-response brings it down again.
   
  -    ?EVENT({watchdog, Ref, _, {okay, suspect}, _}, 2, WdL, WdH),
  -    ?EVENT({down, Ref, _, _}, 0),
  -    ?EVENT({watchdog, Ref, _, {suspect, down}, _}, 1, WdL, WdH),
  +    {okay, suspect} = ?WD_EVENT(Ref),
  +    ?EVENT({down, Ref, _, _}),
  +    {suspect, down} = ?WD_EVENT(Ref),
  +
  +    R4 = R3 + 1,
  +    A4 = A3,
  +    [R4,_,_,A4] = wd_counts(SvcName),
   
       %% Reestablish after another watchdog.
   
  -    recv_reopen(Type, Ref, WdL, WdH),
  +    recv_reopen(Type, Ref),
   
       %%   REOPEN        Timer expires &      NumDWA = -1
       %%                 Pending &            SetWatchdog()
  
positive.code:     %% The peer sends a message before the expiry of another watchdog
      %% to induce failback.
  
      ?EVENT({watchdog, Ref, _, {suspect, okay}, _}, WdH + 2000),
      ?EVENT({up, Ref, _, _}, 0),
  
      %%   OKAY          Timer expires &      SendWatchdog()
      %%                 !Pending             SetWatchdog()
  
negative.code:     %% back down after either one or two watchdog expiries, depending
      %% on whether or not DWA restored the connection.
  
      {okay, suspect} = ?WD_EVENT(Ref),
      ?EVENT({down, Ref, _, _}),
  
      %%   SUSPECT       Timer expires        CloseConnection()
      %%                                      SetWatchdog()        DOWN
      %%
      %% Non-response brings the connection down after another timeout.
  
      {suspect, down} = ?WD_EVENT(Ref),
  
      R2 = R1 + choose(M == 'DWA', 1, 0),
      A2 = A1,
      [R2,_,_,A2] = wd_counts(SvcName),
  
      %%   DOWN          Timer expires        AttemptOpen()
      %%                                      SetWatchdog()        DOWN
  