# -*- text -*-
##
##  SimpliFi — sqlcounter instances (FreeRADIUS 3.0.x / 3.2.x)
##
##  noresetcounter enforces "Max-All-Session" (total seconds a user may be online
##  across all sessions) that SimpliFi writes to radcheck for time-based packages,
##  and replies with the remaining Session-Timeout.
##
##  Install:  cp deploy/freeradius/mods-available/sqlcounter /etc/freeradius/3.0/mods-available/sqlcounter
##            ln -sf ../mods-available/sqlcounter /etc/freeradius/3.0/mods-enabled/sqlcounter
##  The query file comes with FreeRADIUS:
##            mods-config/sql/counter/mysql/noresetcounter.conf
##

sqlcounter noresetcounter {
	sql_module_instance = sql
	dialect = ${modules.sql.dialect}

	counter_name = Max-All-Session-Time
	check_name = Max-All-Session
	key = User-Name
	reset = never

	$INCLUDE ${modconfdir}/sql/counter/${dialect}/${.:instance}.conf
}
