anchor.diff:  %%  internal functions
   %%----------------------------------------------------------------------
   
  --spec send_response( RadiusCode :: integer(), RadiusID :: byte(),
  -		RadiusAttributes :: radius_attributes:attributes(),
  -		RequestAuthenticator :: binary() | [byte()], Secret :: binary(),
  -		RadiusFsm :: pid()) -> ok.
  -%% @doc Sends an RADIUS-Access/Challenge or Reject or Accept  packet to peer
  +-spec response(RadiusCode :: integer(),
  +		ResponseAttributes :: radius_attributes:attributes(),
  +		StateData :: #statedata{}) -> ok.
  +%% @doc Send a RADIUS Access-Reject or Access-Accept reply
   %% @hidden
  -send_response(RadiusCode, RadiusID, RadiusAttributes,
  -		RequestAuthenticator, Secret, RadiusFsm) ->
  +response(RadiusCode, ResponseAttributes,
  +		#statedata{id = RadiusID, req_attr = RequestAttributes,
  +		req_auth = RequestAuthenticator, secret = Secret,
  +		radius_fsm = RadiusFsm} = _StateData) ->
   	AttributeList1 = radius_attributes:store(?MessageAuthenticator,
  -		<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>, RadiusAttributes),
  +		<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>, ResponseAttributes),
   	Attributes1 = radius_attributes:codec(AttributeList1),
   	Length = size(Attributes1) + 20,
   	MessageAuthenticator = crypto:hmac(md5, Secret, [<<RadiusCode, RadiusID,
  
positive.code: -record(statedata,
  		{address :: inet:ip_address(),
  		port :: pos_integer(),
  		secret :: binary(),
  		session_id:: {NAS :: inet:ip_address() | string(),
  				Port :: string(), Peer :: string()},
  		socket :: term(),
  		subscriber :: binary()}).
  
  -define(TIMEOUT, 30000).
  
negative.code: %% @see //stdlib/gen_fsm:init/1
  %% @private
  %%
  init([Address, Port, RadiusFsm, Secret, SessionID,
  		#radius{code = ?AccessRequest, id = ID,
  		authenticator = Authenticator, attributes = Attributes] = _Args) ->
  	StateData = #statedata{address = Address, port = Port,
  		radius_fsm = RadiusFsm, secret = Secret, session_id = SessionID,
  		req_auth = Authenticator, req_attr = Attributes},
  	process_flag(trap_exit, true),
  	{ok, request, StateData, 0}.
  
  -spec request(Event :: timeout | term(), StateData :: #statedata{}) ->
  	Result :: {next_state, NextStateName :: atom(), NewStateData :: #statedata{}}
  		| {next_state, NextStateName :: atom(), NewStateData :: #statedata{},
  		Timeout :: non_neg_integer() | infinity}
  