anchor.diff:  -export([send/2, controlling_process/2,
   		shutdown/2, close/1, connect/4]).
   %% export public API
  --export([ssl_connect/3, deliver/1]).
  +-export([ssl_connect/3, deliver/3]).
   
   -export_type([listen_option/0, eap_option/0]).
   
  
positive.code: 		Reason :: closed | term().
  %% @doc Sends a packet on an EAP session.
  send(ClientPid, Data) when is_pid(ClientPid) ->
  	{ok, Address} = application:get_env(ocs, radius_auth_addr),
  	{ok, Port} = application:get_env(ocs, radius_auth_port),
  	{ok, Socket} = gen_udp:open(0, [{active, false}, inet, {ip, Address}, binary]),
  	Secret = "xyzzy5461",
  	NasId = atom_to_list(node()),
  	AnonymousName = "DonaldTrump",
  	MAC = "dd:ee:ff:aa:bb:cc",
  	send1(ClientPid, Socket, Address, Port, Secret, NasId, MAC, AnonymousName, Data).
  %% @hidden
  send1(ClientPid, Socket, Address, Port, Secret, NasId, MAC, UserName,
  			[<<?Handshake, _:32>>, [[?ClientHello | _] | _]] = Data) ->
  	RadId = 10, EapId = 3,
  	Auth = radius:authenticator(),
  	client_hello(Socket, Address, Port, Auth,
  			RadId, EapId, Secret, NasId, MAC, UserName, Data),
  	server_hello(ClientPid, Socket, Address, Port, Auth, RadId, Secret);
  send1(_, _, _, _, _, _, _, _, [<<?Handshake, _:32>>,
  		[[?ClientKeyExchange | _] | _]] = Data) ->
  	ets:new(client_cipher, [named_table]),
  	ets:insert(client_cipher, {key_ex, Data});
  send1(_, _, _, _, _, _, _, _, [<<?ChangeCipherSpec, _:32>> | _] = Data) ->
  	ets:insert(client_cipher, {change_cipher, Data});
  send1(ClientPid, Socket, Address, Port, Secret, NasId, MAC, UserName,
  			[<<?Handshake, _:32>> | _] = Data) ->
  	RadId = 11, EapId = 4,
  	Auth = radius:authenticator(),
  	[{_, KeyEx}] = ets:lookup(client_cipher, key_ex), 
  	[{_, ChangeCipher}] = ets:lookup(client_cipher, change_cipher), 
  	ClientCipher = [KeyEx, ChangeCipher, Data],
  	client_cipher(Socket, Address, Port, Auth,
  			RadId, EapId, Secret, NasId, MAC, UserName, ClientCipher),
  	server_cipher(ClientPid, Socket, Address, Port, Auth, RadId, Secret).
  
  -spec controlling_process(ClientPid, Pid) ->
  	ok | {error, Reason} when
  
negative.code: %%----------------------------------------------------------------------
  
  -dialyzer({nowarn_function, ssl_connect/3}).
  -spec ssl_connect(Address, ClientPid, Options) ->
  		{ok, SslSocket} | {error, Reason} when
  	Address :: inet:ip_address(),
  	ClientPid :: pid(),
  	Options :: [term()],
  	SslSocket :: pid(),
  	Reason :: term().
  %% @doc Open an SSL connection to Host, Port.
  ssl_connect(Address, ClientPid, Options) ->
  	{ok , SslSocket} = ssl:connect(Address, ClientPid, [?cb_info | Options]),
  	ClientPid ! {ssl_socket, SslSocket}.
  
  -spec deliver(SslPid, ClientPid, Data) ->
  	ok when
  		SslPid :: pid(),
  		ClientPid :: pid(),
  		Data :: iodata().
  %% @doc Deliver received EAP-TTLS payload to SSL.
  deliver(SslPid, ClientPid, Data) when is_pid(SslPid), is_pid(ClientPid) ->
  	SslPid ! {eap_ttls, ClientPid, iolist_to_binary(Data)},
  	ok.
  
  %%----------------------------------------------------------------------
  %%  peer_ttls_transport callbacks
  %%----------------------------------------------------------------------
  -spec connect(Address, ClientPid, SocketOpts, Timeout) ->
  		{ok, ClinetPid} when
  	Address :: inet:socket_address() | inet:hostname(),
  	ClientPid :: pid(),
  	SocketOpts :: [trems()],
  	Timeout :: timeout().
  %% @doc Connects to the EAP session
  connect(Address, ClientPid, SocketOpts, Timeout) ->
  	{ok, ClientPid}.
  
  -spec setopts(ClientPid, Options) ->
  	ok | {error, Reason} when
  