anchor.diff:  %%		gen_fsm:send_event/2} in the <b>eap_start</b> state.
   %% @@see //stdlib/gen_fsm:StateName/2
   %% @private
  -eap_start(timeout, #statedata{start = _Request} = StateData) ->
  -	{stop, unimplemented, StateData}.
  +eap_start(timeout, #statedata{eap_id = EapID,
  +		session_id = SessionId, auth_req_type = AuthReqType,
  +		start = #diameter_eap_app_DER{'EAP-Payload' = []} = Request,
  +		origin_host = OHost, origin_realm = ORealm,
  +		diameter_port_server = PortServer} = StateData) ->
  +	EapData = [],
  +	EapPacket = #eap_packet{code = request, type = ?AKA,
  +			identifier = EapID, data = EapData},
  +	send_diameter_response(SessionId, AuthReqType,
  +			?'DIAMETER_BASE_RESULT-CODE_MULTI_ROUND_AUTH', OHost, ORealm,
  +			EapPacket, PortServer, Request, StateData),
  +	{next_state, id, StateData, ?TIMEOUT};
  +eap_start(timeout, #statedata{sup = Sup, eap_id = EapID,
  +		session_id = SessionId, auth_req_type = AuthReqType,
  +		start = #diameter_eap_app_DER{'EAP-Payload' = EapMessage} = Request,
  +		origin_host = OHost, origin_realm = ORealm,
  +		diameter_port_server = PortServer} = StateData) ->
  +	Children = supervisor:which_children(Sup),
  +	{_, AucFsm, _, _} = lists:keyfind(ocs_eap_aka_auc_fsm, 1, Children),
  +	NewStateData = StateData#statedata{start = undeined, auc_fsm = AucFsm},
  +	EapData = [],
  +	case catch ocs_eap_codec:eap_packet(EapMessage) of
  +		#eap_packet{code = response, type = ?Identity, identifier = NewEapID} ->
  +			NextEapID = (NewEapID rem 255) + 1,
  +			EapPacket = #eap_packet{code = request, type = ?AKA,
  +					identifier = NextEapID, data = EapData},
  +			NextStateData = NewStateData#statedata{eap_id = NextEapID},
  +			send_diameter_response(SessionId, AuthReqType,
  +					?'DIAMETER_BASE_RESULT-CODE_MULTI_ROUND_AUTH', OHost, ORealm,
  +					EapPacket, PortServer, Request, NextStateData),
  +			{next_state, id, NextStateData, ?TIMEOUT};
  +		#eap_packet{code = request, identifier = NewEapID} ->
  +			EapPacket = #eap_packet{code = response, type = ?LegacyNak,
  +					identifier = NewEapID, data = <<0>>},
  +			send_diameter_response(SessionId, AuthReqType,
  +					?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OHost, ORealm,
  +					EapPacket, PortServer, Request, NewStateData),
  +			{stop, {shutdown, SessionId}, NewStateData};
  +		#eap_packet{code = Code, type = EapType,
  +				identifier = NewEapID, data = Data} ->
  +			error_logger:warning_report(["Unknown EAP received",
  +					{pid, self()}, {session_id, SessionId}, {code, Code},
  +					{type, EapType}, {identifier, NewEapID}, {data, Data}]),
  +			EapPacket = #eap_packet{code = failure, identifier = NewEapID},
  +			send_diameter_response(SessionId, AuthReqType,
  +					?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OHost, ORealm,
  +					EapPacket, PortServer, Request, NewStateData),
  +			{stop, {shutdown, SessionId}, NewStateData};
  +		{'EXIT', _Reason} ->
  +			EapPacket = #eap_packet{code = failure, identifier = EapID},
  +			send_diameter_response(SessionId, AuthReqType,
  +					?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OHost, ORealm,
  +					EapPacket, PortServer, Request, NewStateData),
  +			{stop, {shutdown, SessionId}, NewStateData}
  +	end;
  +%% @hidden
  +eap_start(timeout, #statedata{sup = Sup, eap_id = EapID,
  +		start = #radius{code = ?AccessRequest, id = RadiusID,
  +		authenticator = RequestAuthenticator, attributes = RequestAttributes},
  +		session_id = SessionID} = StateData) ->
  +	Children = supervisor:which_children(Sup),
  +	{_, AucFsm, _, _} = lists:keyfind(ocs_eap_aka_auc_fsm, 1, Children),
  +	NewStateData = StateData#statedata{start = undefined, auc_fsm = AucFsm},
  +	EapData = [],
  +	case radius_attributes:find(?EAPMessage, RequestAttributes) of
  +		{ok, <<>>} ->
  +			EapPacket = #eap_packet{code = request,
  +					type = ?AKA, identifier = EapID, data = EapData},
  +			send_radius_response(EapPacket, ?AccessChallenge, [], RadiusID,
  +					RequestAuthenticator, RequestAttributes, NewStateData),
  +			{next_state, id, NewStateData, ?TIMEOUT};
  +		{ok, EAPMessage} ->
  +			case catch ocs_eap_codec:eap_packet(EAPMessage) of
  +				#eap_packet{code = response, type = ?Identity,
  +						identifier = NewEapID} ->
  +					NextEapID = (NewEapID rem 255) + 1,
  +					EapPacket = #eap_packet{code = request,
  +							type = ?AKA, identifier = NextEapID, data = EapData},
  +					send_radius_response(EapPacket, ?AccessChallenge, [], RadiusID,
  +							RequestAuthenticator, RequestAttributes, NewStateData),
  +					NextStateData = NewStateData#statedata{eap_id = NextEapID},
  +					{next_state, id, NextStateData, ?TIMEOUT};
  +				#eap_packet{code = request, identifier = NewEapID} ->
  +					EapPacket = #eap_packet{code = response, type = ?LegacyNak,
  +							identifier = NewEapID, data = <<0>>},
  +					send_radius_response(EapPacket, ?AccessReject, [], RadiusID,
  +							RequestAuthenticator, RequestAttributes, NewStateData),
  +					{stop, {shutdown, SessionID}, StateData};
  +				#eap_packet{code = Code, type = EapType,
  +						identifier = NewEapID, data = Data} ->
  +					error_logger:warning_report(["Unknown EAP received",
  +							{pid, self()}, {session_id, SessionID}, {code, Code},
  +							{type, EapType}, {identifier, NewEapID}, {data, Data}]),
  +					EapPacket = #eap_packet{code = failure, identifier = NewEapID},
  +					send_radius_response(EapPacket, ?AccessReject, [], RadiusID,
  +							RequestAuthenticator, RequestAttributes, NewStateData),
  +					{stop, {shutdown, SessionID}, StateData};
  +				{'EXIT', _Reason} ->
  +					EapPacket = #eap_packet{code = failure, identifier = EapID},
  +					send_radius_response(EapPacket, ?AccessReject, [], RadiusID,
  +							RequestAuthenticator, RequestAttributes, NewStateData),
  +					{stop, {shutdown, SessionID}, StateData}
  +			end;
  +		{error, not_found} ->
  +			EapPacket = #eap_packet{code = request,
  +					type = ?AKA, identifier = EapID, data = EapData},
  +			send_radius_response(EapPacket, ?AccessChallenge, [], RadiusID,
  +					RequestAuthenticator, RequestAttributes, NewStateData),
  +			{next_state, id, NewStateData, ?TIMEOUT}
  +	end.
   
   -spec handle_event(Event, StateName, StateData) -> Result
   	when
  -		Event :: term(), 
  +		Event :: term(),
   		StateName :: atom(),
   		StateData :: statedata(),
   		Result :: {next_state, NextStateName, NewStateData}
   		| {next_state, NextStateName, NewStateData, Timeout}
   		| {next_state, NextStateName, NewStateData, hibernate}
   		| {stop, Reason, NewStateData},
  -		NextStateName :: atom(), 
  +		NextStateName :: atom(),
   		NewStateData :: statedata(),
   		Timeout :: non_neg_integer() | infinity,
   		Reason :: normal | term().
  
positive.code: %%  The ocs_eap_aka_fsm gen_fsm call backs
  %%----------------------------------------------------------------------
  
  init([radius, ServerAddress, ServerPort, ClientAddress, ClientPort,
  		RadiusFsm, Secret, PasswordReq, SessionID, AccessRequest] = _Args) ->
  	{ok, Hostname} = inet:gethostname(),
  	StateData = #statedata{server_address = ServerAddress,
  			server_port = ServerPort, client_address = ClientAddress,
  			client_port = ClientPort, radius_fsm = RadiusFsm,
  			secret = Secret, session_id = SessionID,
  			server_id = list_to_binary(Hostname), start = AccessRequest,
  			password_required = PasswordReq},
  	process_flag(trap_exit, true),
  	{ok, eap_start, StateData, 0};
  init([diameter, ServerAddress, ServerPort, ClientAddress, ClientPort,
  		PasswordReq, SessionId, ApplicationId, AuthType, OHost, ORealm,
  		_DHost, _DRealm, Request, _Options] = _Args) ->
  	{ok, Hostname} = inet:gethostname(),
  	case global:whereis_name({ocs_diameter_auth, ServerAddress, ServerPort}) of
  
negative.code: 
  -define(TIMEOUT, 30000).
  
  -define(EAP_APPLICATION_ID, 5).
  
  %%----------------------------------------------------------------------
  %%  The ocs_eap_aka_fsm API
  %%----------------------------------------------------------------------
  