anchor.diff:  %%  internal functions
   %%----------------------------------------------------------------------
   
  --spec service_options(Name) -> Options
  +-spec initiate_service(SvcName, Address, Port, AppId, Alias, Dictionary) -> Result
  +	when
  +		SvcName :: atom(),
  +		Address :: inet:ip_address(),
  +		Port :: non_neg_integer(),
  +		AppId :: integer(),
  +		Alias :: term(),
  +		Dictionary :: atom(),
  +		Result :: {ok, Ref} | {error, Reason},
  +		Ref :: reference(),
  +		Reason :: term().
  +%% @doc Initiate a DIAMETER service and return its transport reference.
  +%% @hidden
  +initiate_service(?BASE_SERVICE = SvcName, Address, Port, AppId, Alias,
  +		Dictionary) ->
  +	SOptions = service_options(SvcName, AppId, Alias, Dictionary),
  +	TOptions = transport_options(diameter_tcp, Address, Port),
  +	diameter:subscribe(SvcName),
  +	case diameter:start_service(SvcName, SOptions) of
  +		ok ->
  +			case diameter:add_transport(SvcName, TOptions) of
  +				{ok, Ref} ->
  +					{ok, Ref};
  +				{error, Reason} ->
  +					{error, Reason}
  +			end;
  +		{error, Reason} ->
  +			{error, Reason}
  +	end;
  +initiate_service(?NAS_SERVICE = SvcName, Address, Port, AppId, Alias,
  +		Dictionary) ->
  +	SOptions = service_options(SvcName, AppId, Alias, Dictionary),
  +	TOptions = {listen, [{transport_module, diameter_tcp}]}, 
  +	diameter:subscribe(SvcName),
  +	case diameter:start_service(SvcName, SOptions) of
  +		ok ->
  +			case diameter:add_transport(SvcName, TOptions) of
  +				{ok, Ref} ->
  +					{ok, Ref};
  +				{error, Reason} ->
  +					{error, Reason}
  +			end;
  +		{error, Reason} ->
  +			{error, Reason}
  +	end.
  +
  +-spec service_options(Name, AppId, Alias, Dictionary) -> Options
   	when
   		Name :: atom(),
  +		AppId :: integer(),
  +		Alias :: term(),
  +		Dictionary :: atom(),
   		Options :: list().
   %% @doc Returns options for a DIAMETER service
   %% @hidden
  -service_options(Name) ->
  +service_options(Name, AppId, Alias, Dictionary) ->
   	[{'Origin-Host', atom_to_list(Name) ++ ".example.com"},
   		{'Origin-Realm', "example.com"},{'Vendor-Id', 193},
  -		{'Product-Name', "Server"}, {'Auth-Application-Id', [0]},
  +		{'Product-Name', "Server"}, {'Auth-Application-Id', [AppId]},
   		{restrict_connections, false}, {string_decode, false},
  -		{application, [{alias, common},
  -				{dictionary, diameter_gen_base_rfc6733},
  +		{application, [{alias, Alias},
  +				{dictionary, Dictionary},
   				{module, ocs_diameter_auth_service_callback}]}].
   
   -spec transport_options(Transport, Address, Port) -> Options
  
positive.code: %% @see //stdlib/gen_fsm:handle_info/3
  %% @private
  %%
  handle_info(#diameter_event{service = ?BASE_SERVICE, info = EventInfo},
  		_StateName, StateData) ->
  	change_state(EventInfo, StateData).
  
  -spec terminate(Reason, StateName, StateData) -> any()
  	when
  
negative.code: 							{port, Port}]}],
  	{listen, Opts}.
  
  -spec change_state(StateName, Event, StateData) -> Result
  	when
  		StateName :: atom(),
  		Event :: term(),
  		StateData :: #statedata{},
  		Result :: {next_state, NextStateName, NewStateData}
  			| {next_state, NextStateName, NewStateData, Timeout}
  