anchor.diff:  -include_lib("diameter/include/diameter.hrl").
   
   -record(statedata,
  -		{aka_fsm :: undefined | pid(),
  -		hss_realm :: string(),
  -		hss_host :: string()}).
  +		{aka_fsm :: pid() | undefined,
  +		identity :: string() | undefined,
  +		anid :: string() | undefined,
  +		hss_realm :: string() | undefined,
  +		hss_host :: string() | undefined}).
   -type statedata() :: #statedata{}.
   
   %%----------------------------------------------------------------------
  
positive.code: 	<<CKprime:16/binary, IKprime:16/binary>> = kdf(CK, IK, ANID, SQN, AK),
  	gen_fsm:send_event(AkaFsm, {RAND, AUTN, CKprime, IKprime, XRES}),
  	{next_state, idle, StateData};
  idle1(AkaFsm, _ANID, #statedata{hss_realm = undefined} = StateData,
  		{error, not_found}) ->
  	gen_fsm:send_event(AkaFsm, {error, user_unknown}),
  	{next_state, idle, StateData};
  idle1(_AkaFsm, _ANID, #statedata{hss_realm = _HssRealm} = StateData,
  		{error, not_found}) ->
  	{next_state, auth, StateData};
  idle1(AkaFsm, _ANID, StateData, {error, Reason}) ->
  	error_logger:error_report(["Service lookup failure",
  			{module, ?MODULE}, {error, Reason}]),
  	gen_fsm:send_event(AkaFsm, {error, Reason}),
  
negative.code: 	AUTN = autn(SQN, AK, AMF, MAC),
  	gen_fsm:send_event(AkaFsm, {RAND, AUTN, CK, IK, XRES}),
  	{next_state, idle, StateData};
  idle1({ok, #service{password = #aka_cred{k = K, opc = OPc, dif = DIF}}},
  		#statedata{anid = ANID, aka_fsm = AkaFsm} = StateData) ->
  	RAND = ocs_milenage:f0(),
  	{XRES, CK, IK, <<AK:48>>} = ocs_milenage:f2345(OPc, K, RAND),
  	SQN = sqn(DIF),
  