1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# -*- text -*-
#
# ippool/mongo/queries.conf -- Mongo queries for rlm_sqlippool
#
# $Id$
#
# The IP Pool queries expect a result like:
#
# {
# pool_key: "bob"
# pool_name: "my_pool"
# expiry_time: xxx
# value: "192.168.1.1"
# }
#
# i.e. the results are in "value", and not "framed_ip_address".
#
# When using dynamic expansions such as "%{sql:... mongo query ...}",
# Mongo uses a lot of curly brackets, {..}. Any closing braces have
# to be escaped as %}. Sorry, that is a limitation of the FreeRADIUS
# parser.
#
allocate_begin = ""
#
# This query allocates an IP address from the Pool
#
allocate_find = "db.mypool_collection.findAndModify( \
{ \
'query': {' \
'$and': [ \
{ \
'pool_name': '%{control:Pool-Name}' \
}, \
{ \
'nas_ip': '%{Nas-IP-Address}' \
}, \
{ \
'$or': [ \
{ \
'calling_station_id': '%{Calling-Station-Id}' \
}, \
{ \
'locked': 0 \
} \
] \
} \
] \
}, \
'update': { \
'locked': 1', \
'calling_station_id': '%{Calling-Station-Id'}' \
}, \
'fields': { \
'_id': 0, 'framed_ip_address': 1 \
} \
})"
allocate_update = ""
allocate_clear = "db.mypool_collection.findAndModify( \
{ \
'query': { \
'$and': [ \
{ \
'pool_name': '%{Control:Pool-Name}' \
}, \
{ \
'nas_ip': '%{Nas-IP-Address}' \
}, \
{ \
'calling_station_id': '%{Calling-Station-Id}' \
}, \
{ \
'locked': 1 \
} \
] \
}, \
'update': { \
'locked': 0, \
'calling_station_id': '' \
} \
})"
allocate_commit = ""
start_update = ""
stop_clear = ""
alive_update = ""
on_clear = ""
off_clear = ""
|