anchor.diff:  -export([]).
   
   %% export the ocs_eap_ttls_aaah_fsm state callbacks
  --export([idle/2]).
  +-export([idle/2, request/2]).
   
   %% export the call backs needed for gen_fsm behaviour
   -export([init/1, handle_event/3, handle_sync_event/4, handle_info/3,
  
positive.code: %% @private
  %%
  idle(timeout, #statedata{} = StateData) ->
  	{shutdown, normal, StateData};
  idle({ttls_socket, TtlsFsm, TlsRecordLayerSocket}, StateData) ->
  	case ssl:transport_accept(TlsRecordLayerSocket) of
  		{ok, SslSocket} ->
  			case ssl:ssl_accept(SslSocket, ?TIMEOUT) of
  				ok ->
  					NewStateData = StateData#statedata{ssl_socket = SslSocket},
  					{next_state, idle, NewStateData};
  				{error, Reason} ->
  					{shutdown, Reason, StateData}
  			end;
  		{error, Reason} ->
  			{shutdown, Reason, StateData}
  	end.
  
  -spec handle_event(Event :: term(), StateName :: atom(),
  		StateData :: #statedata{}) ->
  
negative.code: %% @see //stdlib/gen_fsm:handle_event/3
  %% @private
  %%
  
  handle_event(_Event, StateName, StateData) ->
  	{next_state, StateName, StateData, ?TIMEOUT}.
  
  