New build path variable
[freeradius.git] / man / man5 / rlm_counter.5
1 .\"     # DS - begin display
2 .de DS
3 .RS
4 .nf
5 .sp
6 ..
7 .\"     # DE - end display
8 .de DE
9 .fi
10 .RE
11 .sp
12 ..
13 .TH rlm_counter 5 "13 March 2004" "" "FreeRADIUS Module"
14 .SH NAME
15 rlm_counter \- FreeRADIUS Module
16 .SH DESCRIPTION
17 The \fIrlm_counter\fP module provides a general framework to
18 allow access based on accumulated usage of a resource, such as
19 total time online in a given period, total data transferred in
20 a given period, etc.  This is very useful in a 'Prepaid Service'
21 situation, where a user has paid for a finite amount of usage
22 and should not be allowed to use more than that service.  Collection,
23 monitoring, and replenishment of prepaid services are beyond the
24 scope of this module.
25 .PP
26 The main configuration items to be aware of are:
27 .IP filename
28 The filename where the usage data is stored.
29 .IP key
30 An attribute which will be present in the Access-Request to be used as
31 the 'index' value for the counter. A counter entry is tracked for
32 each unique key.  The most likely key you will want to use is User-Name.
33 .IP count-attribute
34 An attribute which will be used to increment the counter value.  If this
35 attribute is Acct-Session-Time or an integer value the counter data is
36 incremented by the Attribute value.  For all other attribute types the 
37 counter is incremented by one.
38 .IP reset
39 How frequently the counter data should be set back to 0.  Valid values for
40 this variable are:
41 .BR hourly,
42 .BR daily,
43 .BR weekly,
44 .BR monthly,
45 .BR or never
46 Alternatively, it can be user defined, in the form: num[hdwm].  num is
47 a numeric value, followed by one or none of the following letters.  h: hours,
48 d: days, w: weeks, m: months.
49 .IP check-name
50 This defines an attribute name which will be registered by the counter module 
51 and can be used to set the maximum allowed value for the counter after which 
52 the user is rejected.  If Daily-Session-Time is set, you can use the following
53 syntax in the Users file to set a cap of 3600 seconds ( 8 hours ):
54 .PP
55 .DS
56 DEFAULT Max-Daily-Session := 3600
57 .DE
58 .PP
59 .IP reply-name
60 This is the name of the attribute which will contain the remaining value for
61 the counter in the reply packet when the user is successfully authorized. The
62 default attribute name is "Session-Timeout".
63 .IP allowed-servicetype
64 This can be used to only apply the limitations to specific service types of
65 sessions.  For example, setting this to Framed-User will only apply the counter
66 module to Framed sessions, excluding other types such as Telnet or Rlogin.
67 .IP cache-size
68 The maximum size of the cache to be used by the module.  The default is 1000.
69 .SH NOTES
70 This module registers an attribute, so it should be added to the
71 instantiate section, to be called on server startup.  When used
72 in the authorize section, it must come after any modules which
73 set the 'check-name' attribute.
74 .PP
75 .SH SECTIONS
76 .BR instantiate,
77 .BR authorize,
78 .BR accounting
79 .PP
80 .SH FILES
81 .I /etc/raddb/radiusd.conf
82 .PP
83 .SH "SEE ALSO"
84 .BR radiusd (8),
85 .BR radiusd.conf (5)
86 .BR rlm_sqlcounter (5)
87 .SH AUTHOR
88 Chris Parker, cparker@segv.org
89