anchor.diff:  
   -include_lib("radius/include/radius.hrl").
   -include("ocs_eap_codec.hrl").
  +-include_lib("diameter/include/diameter.hrl").
  +-include_lib("diameter/include/diameter_gen_base_rfc6733.hrl").
  +-include("../include/diameter_gen_eap_application_rfc4072.hrl").
   
   -record(statedata,
   		{sup :: pid(),
   		aaah_fsm :: undefined | pid(),
   		server_address :: inet:ip_address(),
   		server_port :: pos_integer(),
  -		client_address :: inet:ip_address(),
  -		client_port :: pos_integer(),
  -		session_id :: {NAS :: inet:ip_address() | string(),
  +		client_address :: undefined | inet:ip_address(),
  +		client_port :: undefined | pos_integer(),
  +		session_id :: binary() | {NAS :: inet:ip_address() | string(),
   				Port :: string(), Peer :: string()},
  -		secret :: binary(),
  +		secret :: secret | binary(),
   		eap_id = 0 :: byte(),
  -		start :: #radius{},
  +		start :: #radius{} | #diameter_eap_app_DER{},
   		server_id :: binary(),
  -		radius_fsm :: pid(),
  +		radius_fsm :: undefined | pid(),
   		radius_id :: undefined | byte(),
   		req_auth :: undefined | [byte()],
   		ssl_socket :: undefined | ssl:sslsocket(),
  
positive.code: 		server_rand :: undefined | binary(),
  		tls_key :: string(),
  		tls_cert :: string(),
  		tls_cacert :: string()}).
  -type statedata() :: #statedata{}.
  
  -define(TIMEOUT, 30000).
  
negative.code: 			send_response(EapPacket, ?AccessChallenge,
  					RadiusID, [], RequestAuthenticator, Secret, RadiusFsm),
  			{next_state, client_hello, NewStateData, ?TIMEOUT}
  	end;
  eap_start(timeout, #statedata{start = DiameterRequest,
  		eap_id = EapID, session_id = SessionID, auth_req_type = AuthType,
  		origin_host = OH, origin_realm = OR, port_server = PortServer}
  		= StateData) ->
  	EapTtls = #eap_ttls{start = true},
  	EapData = ocs_eap_codec:eap_ttls(EapTtls),
  	case DiameterRequest#diameter_eap_app_DER.'EAP-Payload' of
  		<<>> ->
  			EapPacket = #eap_packet{code = request, type = ?TTLS,
  					identifier = EapID, data = EapData},
  			Answer = generate_diameter_response(SessionID, AuthType,
  					?'DIAMETER_BASE_RESULT-CODE_MULTI_ROUND_AUTH',
  					OH, OR, EapPacket),
  			gen_server:cast(PortServer, {self(), Answer}),
  			{next_state, client_hello, StateData, ?TIMEOUT};
  		EAPMessage ->
  			case catch ocs_eap_codec:eap_packet(EAPMessage) of
  				#eap_packet{code = response,
  						type = ?Identity, identifier = StartEapID} ->
  					NewEapID = (StartEapID rem 255) + 1,
  					NewEapPacket = #eap_packet{code = request, type = ?TTLS,
  							identifier = NewEapID, data = EapData},
  					Answer = generate_diameter_response(SessionID, AuthType,
  							?'DIAMETER_BASE_RESULT-CODE_MULTI_ROUND_AUTH',
  							OH, OR, NewEapPacket),
  					gen_server:cast(PortServer, {self(), Answer}),
  					NextStateData = StateData#statedata{eap_id = NewEapID},
  					{next_state, client_hello, NextStateData, ?TIMEOUT};
  				#eap_packet{code = request, identifier = NewEapID} ->
  					NewEapPacket = #eap_packet{code = response, type = ?LegacyNak,
  							identifier = NewEapID, data = <<0>>},
  					Answer = generate_diameter_response(SessionID, AuthType,
  							?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  							OH, OR, NewEapPacket),
  					gen_server:cast(PortServer, {self(), Answer}),
  					{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},
  							{eap_id, NewEapID}, {code, Code},
  							{type, EapType}, {data, Data}]),
  					NewEapPacket = #eap_packet{code = failure, identifier = NewEapID},
  					Answer = generate_diameter_response(SessionID, AuthType,
  							?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  							OH, OR, NewEapPacket),
  					gen_server:cast(PortServer, {self(), Answer}),
  					{stop, {shutdown, SessionID}, StateData};
  				{'EXIT', _Reason} ->
  					NewEapPacket = #eap_packet{code = failure, identifier = EapID},
  					Answer = generate_diameter_response(SessionID, AuthType,
  							?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  							OH, OR, NewEapPacket),
  					gen_server:cast(PortServer, {self(), Answer}),
  					{stop, {shutdown, SessionID}, StateData}
  			end
  	end.
  
  -spec client_hello(Event, StateData) -> Result
  