anchor.diff:  
   %% export the ocs_simple_auth_fsm state callbacks
   -export([request/2]).
  -
  --export([radius/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: 				case supervisor:start_child(DiscSup, StartArgs) of
  					{ok, DiscFsm} ->
  						link(DiscFsm),
  						{next_state, radius, NewStateData};
  					{error, Reason} ->
  						error_logger:error_report(["Failed to initiate session disconnect function",
  								{module, ?MODULE}, {subscriber, SubscriberId}, {nas, NAS},
  								{address, Address}, {session, SessionID}, {error, Reason}]),
  						{next_state, radius, NewStateData}
  				end
  			catch
  				_:R ->
  
negative.code: 		Password = radius_attributes:unhide(Secret, Authenticator, Hidden),
  		NewStateData = StateData#statedata{subscriber = Subscriber,
  				password = list_to_binary(Password)},
  		handle_radius1(NewStateData)
  	catch
  		_:_ ->
  			response(?AccessReject, [], StateData),
  			{stop, {shutdown, SessionID}, StateData}
  	end.
  %% @hidden
  handle_radius1(#statedata{subscriber = SubscriberId, password = <<>>} = StateData) ->
  	case ocs:authorize(ocs:normalize(SubscriberId), []) of
  		{ok, #subscriber{password = <<>>,
  				attributes = Attributes} = Subscriber} ->
  			NewStateData = StateData#statedata{res_attr = Attributes},
  			handle_radius2(Subscriber, NewStateData);
  		{ok, PSK, #subscriber{attributes = Attributes}
  				= Subscriber} when is_binary(PSK) ->
  			VendorSpecific = {?Mikrotik, ?MikrotikWirelessPsk, binary_to_list(PSK)},
  			ResponseAttributes = radius_attributes:store(?VendorSpecific,
  					VendorSpecific, Attributes),
  			NewStateData = StateData#statedata{res_attr = ResponseAttributes},
  			handle_radius2(Subscriber, NewStateData);
  		{error, Reason} ->
  			reject_radius(Reason, StateData)
  	end;
  handle_radius1(#statedata{subscriber = SubscriberId, password = Password} = StateData) ->
  	case ocs:authorize(ocs:normalize(SubscriberId), Password) of
  		{ok, #subscriber{attributes = Attributes} = Subscriber} ->
  			NewStateData = StateData#statedata{res_attr = Attributes},
  			handle_radius2(Subscriber, NewStateData);
  		{error, Reason} ->
  			reject_radius(Reason, StateData)
  	end.
  %% @hidden
  handle_radius2(#subscriber{multisession = true}, StateData) ->
  	NewStateData = StateData#statedata{multisession = true},
  	handle_radius3(NewStateData);
  handle_radius2(#subscriber{session_attributes = [], multisession = MultiSession}, StateData) ->
  	NewStateData = StateData#statedata{multisession = MultiSession},
  	handle_radius3(NewStateData);
  handle_radius2(#subscriber{multisession = false, session_attributes = SessionAttributes},
  		#statedata{subscriber = SubscriberId, client_address = Address, client_port = ListenPort,
  		shared_secret = Secret, session_id = SessionID} = StateData) ->
  	case pg2:get_closest_pid(ocs_radius_acct_port_sup) of
  