anchor.diff:  acct_close() ->
   	close_log(log_name(acct_log_name)).
   
  --spec acct_query(Continuation, Start, End, Types, MatchSpec) -> Result
  +-spec acct_query(Continuation, Start, End, Types, Matches) -> Result
   	when
   		Continuation :: start | disk_log:continuation(),
   		Start :: calendar:datetime() | pos_integer(),
   		End :: calendar:datetime() | pos_integer(),
   		Types :: [Type] | '_',
   		Type :: on | off | start | stop | interim | event,
  -		MatchSpec :: RadiusMatchSpec | DiameterMatchSpec,
  -		RadiusMatchSpec :: [{Attribute, Match}] | '_',
  +		Matches :: [Match] | '_',
  +		Match :: RadiusMatch | DiameterMatchSpec | RatedMatchSpec,
  +		RadiusMatch :: {Attribute, AttributeMatch},
   		Attribute :: byte(),
  -		Match :: {exact, term()} | {notexact, term()}
  +		AttributeMatch :: {exact, term()} | {notexact, term()}
   				| {lt, term()} | {lte, term()}
   				| {gt, term()} | {gte, term()}
   				| {regex, term()} | {like, [term()]} | {notlike, [term()]}
   				| {in, [term()]} | {notin, [term()]} | {contains, [term()]}
  -				| {notcontain, [term()]} | {containsall, [term()]} | '_',
  -		DiameterMatchSpec :: ets:match_spec() | '_',
  +				| {notcontain, [term()]} | {containsall, [term()]},
  +		DiameterMatchSpec :: {DiameterMatchHead, MatchConditions},
  +		DiameterMatchHead :: #'3gpp_ro_CCR'{} | #'3gpp_ro_CCA'{},
  +		RatedMatchSpec :: {RatedMatchHead, MatchConditions},
  +		RatedMatchHead :: #rated{},
  +		MatchConditions :: [tuple()],
   		Result :: {Continuation2, Events} | {error, Reason},
   		Continuation2 :: eof | disk_log:continuation(),
   		Events :: [acct_event()],
  
positive.code: 		Protocol :: radius | diameter | '_',
  		Types :: [Type] | '_',
  		Type :: on | off | start | stop | interim | event,
  		MatchSpec :: RadiusMatchSpec | DiameterMatchSpec,
  		RadiusMatchSpec :: [{Attribute, Match}] | '_',
  		Attribute :: byte(),
  		Match :: {exact, term()} | {notexact, term()}
  				| {lt, term()} | {lte, term()}
  				| {gt, term()} | {gte, term()}
  				| {regex, term()} | {like, [term()]} | {notlike, [term()]}
  				| {in, [term()]} | {notin, [term()]} | {contains, [term()]}
  				| {notcontain, [term()]} | {containsall, [term()]} | '_',
  		DiameterMatchSpec :: ets:match_spec() | '_',
  		Result :: {Continuation2, Events} | {error, Reason},
  		Continuation2 :: eof | disk_log:continuation(),
  		Events :: [acct_event()],
  
negative.code: 	end;
  acct_query4(Attributes, [{_, {like, []}} | T]) ->
  	acct_query4(Attributes, T);
  acct_query4(Attributes, [_ | T]) ->
  	acct_query4(Attributes, T);
  acct_query4(_Attributes, []) ->
  	true.
  %% @hidden
  acct_query5(Events = [H | T], Matches, Acc) when element(3, H) == diameter ->
  	F = fun({#'3gpp_ro_CCA'{} = MatchHead, MatchConds}) ->
  				{true, {MatchHead, MatchConds, ['$_']}};
  			(_) ->
  				false
  	end,
  	MatchSpec = lists:filtermap(F, Matches),
  	case length(MatchSpec) of
  		0 ->
  			acct_query6(Events, Matches, []);
  		_ ->
  			case erlang:match_spec_test(element(8, H), MatchSpec, table) of
  				{ok, #'3gpp_ro_CCA'{}, [], []} ->
  					acct_query5(T, Matches, [H | Acc]);
  				{ok, false , [], []}->
  					acct_query5(T, Matches, Acc);
  				{error, Reason} ->
  					{error, Reason}
  			end
  	end;
  acct_query5([], Matches, Acc) ->
  	acct_query6(lists:reverse(Acc), Matches, []).
  %% @hidden
  acct_query6(Events = [H | T], Matches, Acc) when element(3, H) == diameter ->
  	F = fun({#rated{} = MatchHead, MatchConds}) ->
  				{true, {MatchHead, MatchConds, ['$_']}};
  			(_) ->
  				false
  	end,
  	MatchSpec = lists:filtermap(F, Matches),
  	case length(MatchSpec) of
  		0 ->
  			Events;
  		_ ->
  			case element(9, H) of
  				[#rated{} = Rated | _] ->
  					case erlang:match_spec_test(Rated, MatchSpec, table) of
  						{ok, #rated{}, [], []} ->
  							acct_query6(T, Matches, [H | Acc]);
  						{ok, false , [], []}->
  							acct_query6(T, Matches, Acc);
  						{error, Reason} ->
  							{error, Reason}
  					end;
  				[[#rated{} = Rated | _]] ->
  					case erlang:match_spec_test(Rated, MatchSpec, table) of
  						{ok, #rated{}, [], []} ->
  							acct_query6(T, Matches, [H | Acc]);
  						{ok, false , [], []}->
  							acct_query6(T, Matches, Acc);
  						{error, Reason} ->
  							{error, Reason}
  					end;
  				undefined ->
  					acct_query6(T, Matches, Acc)
  			end
  	end;
  acct_query6([], _Matches, Acc) ->
  	lists:reverse(Acc).
  
  -spec ipdr_query(Continuation, MatchSpec) -> Result
  	when
  