anchor.diff:  -include_lib("diameter/include/diameter.hrl").
   -include_lib("diameter/include/diameter_gen_base_rfc6733.hrl").
   -include("../include/diameter_gen_nas_application_rfc7155.hrl").
  +-include("ocs.hrl").
   
   -record(state,
   		{auth_port_sup :: pid(),
  -		simple_auth_sup :: undefined | pid()}).
  +		simple_auth_sup :: undefined | pid(),
  +		handlers = gb_trees:empty() :: gb_trees:tree(
  +				Key :: (SessionId :: string()), Value :: (Fsm :: pid()))}).
   
   -type state() :: #state{}.
  +-type capabilities() :: #diameter_caps{}.
   
   %%----------------------------------------------------------------------
   %%  The ocs_diameter_auth_port_server API
  
positive.code: %%  internal functions
  %%----------------------------------------------------------------------
  
  -spec request(OHost, ORealm, Request, State) -> Reply
  	when
  		OHost :: string(),
  		ORealm :: string(),
  		Request :: #diameter_nas_app_AAR{},
  		State :: state(),
  		Reply :: {reply, Answer, State},
  		Answer :: #diameter_nas_app_AAA{}.
  %% @doc Based on the DIAMETER request generate appropriate DIAMETER
  %% answer.
  %% @hidden
  request(OHost, ORealm, Request, #state{simple_auth_sup = SimpleAuthSup} = State) 
  		when is_record(Request, diameter_nas_app_AAR)->
  	#diameter_nas_app_AAR{'Session-Id' = SessId, 'Auth-Request-Type' = Type,
  			'User-Name' = UserName, 'User-Password' = Password} = Request,
  	case {UserName, Password} of
  		{UserName, Password} when (UserName /= undefined andalso
  				Password /= undefined) ->
  			start_fsm(SimpleAuthSup, 1, SessId, Type, OHost, ORealm, UserName,
  				Password, State);
  		_ ->
  			Answer = #diameter_nas_app_AAA{
  					'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  					'Origin-Host' = OHost, 'Origin-Realm' = ORealm, 'Session-Id' = SessId},
  			{reply, Answer, State}
  	end.
  
  %% @hidden
  -spec start_fsm(AuthSup, AppId, SessionId, AuthRequestType, OHost,
  		ORealm, UserName, Password, State) -> Result
  	when
  		AuthSup :: pid(),
  		AppId :: non_neg_integer(),
  
negative.code: %% @see //stdlib/gen_server:handle_call/3
  %% @private
  handle_call({diameter_request, Caps, Request}, _From, State) ->
  	request(Caps, Request, State).
  
  -spec handle_cast(Request, State) -> Result
  	when
  