anchor.diff:  	ok = ocs_test_lib:start(),
   	SharedSecret = ct:get_config(radius_shared_secret),
   	ok = ocs:add_client({127, 0, 0, 1}, SharedSecret),
  -	PeerId = "25252525",
  -	Config1 = [{peer_id, PeerId} | Config],
  +	Username = "25252525",
  +	Config1 = [{username, Username} | Config],
   	Password = ocs:generate_password(),
   	Config2 = [{password, Password} | Config1],
  -	ok = ocs:add_subscriber(PeerId, Password, [], 1000),
  +	ok = ocs:add_subscriber(Username, Password, [], 1000),
   	NasId = atom_to_list(node()),
   	[{nas_id, NasId} | Config2].
   
  
positive.code: 	{ok, AcctPort} = application:get_env(ocs, radius_acct_port),
  	{ok, AuthPort} = application:get_env(ocs, radius_auth_port),
  	{ok, Socket} = gen_udp:open(0, [{active, false}, inet, binary]), 
  	{ok, NasPort} = inet:port(Socket),
  	UserName = "simoon",
  	SharedSecret = ct:get_config(radius_shared_secret),
  	Authenticator = radius:authenticator(),
  	IDReqAttributeList0 = radius_attributes:new(),
  	IDReqAttributeList1 = radius_attributes:store(?UserName, UserName, IDReqAttributeList0),
  	IDReqAttributeList2 = radius_attributes:store(?NasIdentifier, NasId, IDReqAttributeList1),
  	IDReqAttributeList3 = radius_attributes:store(?NasPort, NasPort, IDReqAttributeList2),
  	IDReqAttributeList4 = radius_attributes:store(?CallingStationId,"de:ad:be:ef:ca:fe",
  		IDReqAttributeList3),
  	IDReqAttributeList5 = radius_attributes:store(?MessageAuthenticator,
  
negative.code: radius_accouting(Config) ->
  	Id = 1,
  	NasId = ?config(nas_id, Config),
  	AcctSessionId = "12345678",
  	Username = ?config(username, Config),
  	Password = ?config(password, Config),
  	AcctAddress = {127, 0, 0, 1},
  	AuthAddress = {127, 0, 0, 1},
  	{ok, AcctPort} = application:get_env(ocs, radius_acct_port),
  	{ok, AuthPort} = application:get_env(ocs, radius_auth_port),
  	{ok, Socket} = gen_udp:open(0, [{active, false}, inet, binary]), 
  	UserName = "simoon",
  	SharedSecret = ct:get_config(radius_shared_secret),
  	ArqAuthenticator = radius:authenticator(),
  	A0 = radius_attributes:new(),
  	A1 = radius_attributes:add(?UserName, Username, A0),
  	A2 = radius_attributes:add(?UserPassword, Password, A1),
  	A3 = radius_attributes:add(?NasIdentifier, NasId, A2),
  	A4 = radius_attributes:add(?NasPortType, 19, A3),
  	A5 = radius_attributes:add(?CallingStationId,"de:ad:be:ef:ca:fe", A4),
  	A6 = radius_attributes:add(?AcctSessionId, AcctSessionId, A5),
  	AccessRequest = #radius{code = ?AccessRequest, id = Id,
  			authenticator = ArqAuthenticator, attributes = A6},
  	ArqPacket = radius:codec(AccessRequest),
  	ok = gen_udp:send(Socket, AuthAddress, AuthPort, ArqPacket),
  	{ok, {AuthAddress, AuthPort, ResponsePacket}} = gen_udp:recv(Socket, 0, 1000),
  	#radius{code = ?AccessAccept, id = Id} = radius:codec(ResponsePacket),
  	NextId = Id + 1,
  	AccAuthenticator = radius:authenticator(),
  	B0 = radius_attributes:new(),
  	B1 = radius_attributes:add(?UserName, UserName, B0),
  	B2 = radius_attributes:add(?UserPassword, Password, B1),
  	B3 = radius_attributes:add(?NasIdentifier, NasId, B2),
  	B4 = radius_attributes:add(?NasPortType, 19, B3),
  	B5 = radius_attributes:add(?CallingStationId,"de:ad:be:ef:ca:fe", B4),
  	B6 = radius_attributes:add(?AcctSessionId, AcctSessionId, B5),
  	B7 = radius_attributes:add(?AcctStatusType, ?AccountingStart, B6),
  	AccAttributes = radius_attributes:codec(B7),
  	AccountingRequest = #radius{code = ?AccountingRequest, id = NextId,
  			authenticator = AccAuthenticator, attributes = AccAttributes},
  	AccPacket = radius:codec(AccountingRequest),
  	ok = gen_udp:send(Socket, AcctAddress, AcctPort, AccPacket),
  	{ok, {AcctAddress, AcctPort, AccResponse}} = gen_udp:recv(Socket, 0),
  	ResponseLength = size(AccResponse),
  	#radius{code = ?AccountingResponse, id = NextId,
  			authenticator = ResponseAuthenticator} = radius:codec(AccResponse),
  	ResponseAuthenticator = crypto:hash(md5, [<<?AccountingResponse, NextId,
  			ResponseLength:16>>, AccAuthenticator, AccAttributes, SharedSecret]).
  
  %	RADAcct_NewReqId = 2,
  %	RADAcctNewAttributes1 = radius_attributes:store(?AcctStatusType, ?AccountingStop, RADAcctAttributes2),
  %	RADAcctNewAttributes2 = radius_attributes:store(?NasIdentifier, NasId, RADAcctNewAttributes1),
  %	RADAcctNewAttributes3 = radius_attributes:store(?AcctInputOctets, 24657, RADAcctNewAttributes2),
  %	RADAcctNewAttributes4 = radius_attributes:store(?AcctOutputOctets, 87465, RADAcctNewAttributes3),
  %	RADAcctNewAttributesList = radius_attributes:codec(RADAcctNewAttributes4),
  %	RADAcct_stop_rec = #radius{code = ?AccountingRequest, id = RADAcct_NewReqId, authenticator = RADAcct_ReqAuth,
  %		attributes = RADAcctNewAttributesList},
  %	RADAcct_stop_packet = radius:codec(RADAcct_stop_rec),
  %	ok = gen_udp:send(Socket, AcctAddress, AcctPort, RADAcct_stop_packet),
  %	{ok, {_, _, RADAcct_stop_response}} = gen_udp:recv(Socket, 0),
  %	#radius{code = ?AccountingResponse, id = RADAcct_NewReqId } = radius:codec(RADAcct_stop_response),
  %	ok =  gen_udp:close(Socket).
  
  disconnect_session() ->
  	[{userdata, [{doc, "Disconnect a RADIUS accouting session based on usage"}]}].
  