{
#
#  Pre-accounting.  Decide which accounting type to use.
#
}preacct \{
	preprocess
{
        #
        #  Merge Acct-[Input|Output]-Gigawords and Acct-[Input-Output]-Octets
        #  into a single 64bit counter Acct-[Input|Output]-Octets64.
        #
}#       acct_counters64
{
        #
        #  Session start times are *implied* in RADIUS.
        #  The NAS never sends a "start time".  Instead, it sends
        #  a start packet, *possibly* with an Acct-Delay-Time.
        #  The server is supposed to conclude that the start time
        #  was "Acct-Delay-Time" seconds in the past.
        #
        #  The code below creates an explicit start time, which can
        #  then be used in other modules.  It will be *mostly* correct.
        #  Any errors are due to the 1-second resolution of RADIUS,
        #  and the possibility that the time on the NAS may be off.
        #
        #  The start time is: NOW - delay - session_length
        #
}
#       update request {
#               FreeRADIUS-Acct-Session-Start-Time = "%{expr: %l - %{%{Acct-Session-Time}:-0} - %{%{Acct-Delay-Time}:-0}}"
#       }

{
        #
        #  Ensure that we have a semi-unique identifier for every
        #  request, and many NAS boxes are broken.
}
	
        acct_unique
{
	#  Accounting requests are generally proxied to the same
	#  home server as authentication requests.
}	suffix
	ntdomain
        files

\}
