~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to raddb/sql/mysql/ippool.conf

  • Committer: Bazaar Package Importer
  • Author(s): Josip Rodin
  • Date: 2009-11-23 03:57:37 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20091123035737-zsgtzhfych8hir68
Tags: 2.1.7+dfsg-1
* Adopting the package, closes: #536623.
* New upstream version, closes: #513484.
  + Fixes the blooper in unlang evaluation logic, closes: #526175.
* Used quilt (and added README.source), and moved upstream file patching
  into debian/patches/. The source is no longer in collab-maint git
  (to make it simpler for me to finally get this out the door), but
  kept the .gitignore should we need that again.
* Dropped the dialup_admin/bin/backup_radacct patch (integrated upstream).
* Dropped the raddb/Makefile patch (problem no longer exists upstream).
* Dropped the lib/packet.c lib/radius.c main/listen.c patches (was from
  upstream 2.0.5 anyway).
* Dropped references to otp.conf, it no longer exists upstream.
  Keep removing the conffile statoverride in prerm.
* Dropped references to snmp.conf, it no longer exists upstream.
  Keep removing the conffile statoverride in prerm.
* Ship /etc/freeradius/modules/* in the freeradius package.
* Stop shipping sites-enabled symlinks in the package and instead create
  them only on initial install, thanks to Matej Vela, closes: #533396.
* Add export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" to the init script
  at the request of John Morrissey, closes: #550143.
* Stop installing /var/run/freeradius in the package to silence Lintian.
  The init script already recreates it at will.
* Remove executable bit from example.pl to silence Lintian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
##
3
3
## ippool.conf -- MySQL queries for rlm_sqlippool
4
4
##
5
 
##      $Id: ippool.conf,v 1.6 2008/03/14 15:13:01 pnixon Exp $
 
5
##      $Id$
6
6
 
7
7
# ## This series of queries allocates an IP address
8
8
# allocate-clear = "UPDATE ${ippool_table} \
9
9
#  SET nasipaddress = '', pool_key = 0, \
10
10
#  callingstationid = '', username = '', \
11
 
#  expiry_time IS NULL \
 
11
#  expiry_time = NULL \
12
12
#  WHERE pool_key = '${pool-key}'"
13
13
 
14
14
## This series of queries allocates an IP address
19
19
 allocate-clear = "UPDATE ${ippool_table} \
20
20
  SET nasipaddress = '', pool_key = 0, \
21
21
  callingstationid = '', username = '', \
22
 
  expiry_time IS NULL \
23
 
  WHERE expiry_time <= NOW() - INTERVAL 1 SECOND
 
22
  expiry_time = NULL \
 
23
  WHERE expiry_time <= NOW() - INTERVAL 1 SECOND \
24
24
  AND nasipaddress = '%{Nas-IP-Address}'"
25
25
 
26
26
 
28
28
## The ORDER BY clause of this query tries to allocate the same IP-address
29
29
## which user had last session...
30
30
allocate-find = "SELECT framedipaddress FROM ${ippool_table} \
31
 
 WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < NOW() \
 
31
 WHERE pool_name = '%{control:Pool-Name}' AND (expiry_time < NOW() OR expiry_time IS NULL) \
32
32
 ORDER BY (username <> '%{User-Name}'), \
33
33
 (callingstationid <> '%{Calling-Station-Id}'), \
34
34
 expiry_time \
39
39
# ## use this query instead
40
40
# allocate-find = "SELECT framedipaddress FROM ${ippool_table} \
41
41
#  WHERE pool_name = '%{control:Pool-Name}' \
42
 
#  AND expiry_time IS NULL \
 
42
#  AND expiry_time = NULL \
43
43
#  ORDER BY RAND() \
44
44
#  LIMIT 1 \
45
45
#  FOR UPDATE"
59
59
 SET nasipaddress = '%{NAS-IP-Address}', pool_key = '${pool-key}', \
60
60
 callingstationid = '%{Calling-Station-Id}', username = '%{User-Name}', \
61
61
 expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \
62
 
 WHERE framedipaddress = '%I'"
 
62
 WHERE framedipaddress = '%I' AND expiry_time IS NULL"
63
63
 
64
64
 
65
65
 
67
67
## START record arrives
68
68
start-update = "UPDATE ${ippool_table} \
69
69
 SET expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \
70
 
 WHERE nasipaddress = '%{NAS-IP-Address}' AND  pool_key = '${pool-key}'"
 
70
 WHERE nasipaddress = '%{NAS-IP-Address}' AND  pool_key = '${pool-key}' \
 
71
 AND username = '%{User-Name}' \
 
72
 AND callingstationid = '%{Calling-Station-Id}' \
 
73
 AND framedipaddress = '%{Framed-IP-Address}'"
71
74
 
72
75
## This series of queries frees an IP number when an accounting
73
76
## STOP record arrives
74
77
stop-clear = "UPDATE ${ippool_table} \
75
78
 SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \
76
 
 expiry_time IS NULL \
 
79
 expiry_time = NULL \
77
80
 WHERE nasipaddress = '%{Nas-IP-Address}' AND pool_key = '${pool-key}' \
78
81
 AND username = '%{User-Name}' \
79
82
 AND callingstationid = '%{Calling-Station-Id}' \
96
99
## NAS when an accounting ON record arrives
97
100
on-clear = "UPDATE ${ippool_table} \
98
101
 SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \
99
 
 expiry_time IS NULL \
 
102
 expiry_time = NULL \
100
103
 WHERE nasipaddress = '%{Nas-IP-Address}'"
101
104
 
102
105
## This series of queries frees the IP numbers allocate to a
103
106
## NAS when an accounting OFF record arrives
104
107
off-clear = "UPDATE ${ippool_table} \
105
108
 SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \
106
 
 expiry_time IS NULL \
 
109
 expiry_time = NULL \
107
110
 WHERE nasipaddress = '%{Nas-IP-Address}'"
108
111