]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Create a TLV and additional identifiers for IP-Pool attirbutes
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 29 Nov 2020 02:11:59 +0000 (19:11 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 29 Nov 2020 02:21:19 +0000 (19:21 -0700)
23 files changed:
doc/antora/modules/howto/pages/modules/sqlippool/index.adoc
doc/antora/modules/raddb/pages/mods-available/dhcp_sqlippool.adoc
doc/antora/modules/raddb/pages/mods-available/redis_ippool.adoc
doc/antora/modules/raddb/pages/mods-available/sqlippool.adoc
doc/antora/modules/raddb/pages/sites-available/default.adoc
doc/antora/modules/raddb/pages/sites-available/dhcp.adoc
raddb/mods-available/redis_ippool
raddb/mods-available/sqlippool
raddb/mods-config/sql/ippool/mysql/queries.conf
raddb/mods-config/sql/ippool/oracle/queries.conf
raddb/mods-config/sql/ippool/sqlite/queries.conf
raddb/sites-available/decoupled-accounting
raddb/sites-available/default
raddb/sites-available/dhcp
share/dictionary/freeradius/dictionary.freeradius.internal.ippool
src/tests/modules/redis_ippool/alloc.unlang
src/tests/modules/redis_ippool/module.conf
src/tests/modules/redis_ippool/pool_tool_delete.unlang
src/tests/modules/redis_ippool/pool_tool_modify.unlang
src/tests/modules/redis_ippool/pool_tool_release.unlang
src/tests/modules/redis_ippool/release.unlang
src/tests/modules/redis_ippool/update.unlang
src/tests/modules/redis_ippool/update_alloc.unlang

index 701db305d1b6fd7955bb15c08f8ac7a7d545120c..a2b4ed6be3134da70e728b2cdab8b56e46ed375e 100644 (file)
@@ -56,13 +56,13 @@ an individual IP address, MAC address, etc.
 === `Access-Request`: A device connects to the NAS with correct credentials
 
 . FreeRADIUS receives an `Access-Request` from the NAS.  After some
-processing (modules. `unlang`, etc.), the `Pool-Name` attribute is
+processing (modules. `unlang`, etc.), the `IP-Pool.Name` attribute is
 added to the `control` list.  This attribute indicates that the IP
 address should be allocated from the named pool.  This attribute can
 be added from any module, database, `unlang`, etc.
 
 . When the `sqlippool` module is eventually run, it looks for the
-`Pool-Name` attribute, and runs the various SQL queries in order to
+`IP-Pool.Name` attribute, and runs the various SQL queries in order to
 perform IP address allocation.  If the module is configured to place
 address into the `Framed-IP-Address` attribute (as it is by default),
 and that attribute already exists, the module does nothing, and
@@ -70,13 +70,13 @@ returns `noop`.
 
 . The module then runs the `alloc_existing` query, which looks for
 the IP address last assigned to the device from the pool indicated by
-`Pool-Name`.  The device is identified using the `pool_key`
+`IP-Pool.Name`.  The device is identified using the `pool_key`
 configuration item (typically `NAS-Port`) and a NAS identifier (the
 `NAS-IP-Address`).
 
 . If no address was found using `alloc_existing`, the module then
 runs the `alloc_find` query, which chooses a free IP address from
-the pool indicated by `Pool-Name`.  If `alloc_find` does not return
+the pool indicated by `IP-Pool.Name`.  If `alloc_find` does not return
 an IP address, the `pool_check` query is run in order to determine
 why the allocation failed.  For example, either the requested pool is
 empty (i.e.  no free addresses), or it is non-existent.  This
@@ -495,24 +495,24 @@ interval).
 
 === 7. Enable a pool user
 
-For a request to acquire an address from the pool you must set a `Pool-Name`
+For a request to acquire an address from the pool you must set a `IP-Pool.Name`
 check attribute, either directly in the virtual server configuration or via a
 data source such as `sql` (for example using the `radcheck` table).
 
-.Example of setting a Pool-Name attribute using the `radcheck` table
+.Example of setting a IP-Pool.Name attribute using the `radcheck` table
 =============================================
 
 [source,shell]
 ----
 echo "INSERT INTO radcheck (username,attribute,op,value)   \
-      VALUES ('bob','Pool-Name',':=','internet');"         \
+      VALUES ('bob','IP-Pool.Name',':=','internet');"         \
      | mysql radius
 ----
 
 =============================================
 
 
-.Example of setting a Pool-Name attribute using in the server config
+.Example of setting a IP-Pool.Name attribute using in the server config
 =============================================
 
 .[raddb]/sites-enabled/default
@@ -521,7 +521,7 @@ echo "INSERT INTO radcheck (username,attribute,op,value)   \
 send Access-Accept {
 ...
         update control {
-                &Pool-Name := 'internet'
+                &IP-Pool.Name := 'internet'
         }
 
         sqlippool
@@ -531,7 +531,7 @@ send Access-Accept {
 
 =============================================
 
-NOTE: Recall that if `sqlippool` is invoked without a `Pool-Name` check
+NOTE: Recall that if `sqlippool` is invoked without a `IP-Pool.Name` check
 attribute then no action is taken. Also recall that if `sqlippool` is invoked
 whilst the attribute configured in the `attribute_name` configuration item
 (e.g. `Framed-IP-Address`) already exists then no action is taken.
index aac4095cc6f4f3510e26a743dd0da51f0530098d..5f52cf8b787fd0cfffbe5fbc1ab25a7070d70fbb 100644 (file)
@@ -52,9 +52,9 @@ sqlippool dhcp_sqlippool {
        $INCLUDE ${modconfdir}/sql/ippool-dhcp/mysql/queries.conf
 #      $INCLUDE ${modconfdir}/sql/ippool-dhcp/sqlite/queries.conf
        sqlippool_log_exists = "DHCP: Existing IP: %{reply.${..attribute_name}} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
-       sqlippool_log_success = "DHCP: Allocated IP: %{reply.${..attribute_name}} from %{control.Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+       sqlippool_log_success = "DHCP: Allocated IP: %{reply.${..attribute_name}} from %{control.IP-Pool.Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
        sqlippool_log_clear = "DHCP: Released IP %{${..attribute_name}} (did %{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})"
-       sqlippool_log_failed = "DHCP: IP Allocation FAILED from %{control.Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
-       sqlippool_log_nopool = "DHCP: No Pool-Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+       sqlippool_log_failed = "DHCP: IP Allocation FAILED from %{control.IP-Pool.Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+       sqlippool_log_nopool = "DHCP: No IP-Pool.Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
 }
 ```
index 74b9b5880fbff9a505bdbc5cba8d723aea79285f..74f8cd70aecc1273eb9cbf499405801650a136cc 100644 (file)
@@ -116,7 +116,7 @@ NOTE: See the `redis` module for more information.
 
 ```
 redis_ippool {
-       pool_name = &control.Pool-Name
+       pool_name = &control.IP-Pool.Name
        offer_time = 30
        lease_time = 3600
 #      wait_num = 10
index b8ff96f656990ba3d010af5a334ce2f06cccc3b0..7de3e27e214ebabb1b8e8e8b984fcded4d83f4df 100644 (file)
@@ -84,10 +84,10 @@ sqlippool {
        pool_key = "%{NAS-Port}"
        messages {
                exists = "Existing IP: %{reply.${..attribute_name}} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
-               success = "Allocated IP: %{reply.${..attribute_name}} from %{control.Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+               success = "Allocated IP: %{reply.${..attribute_name}} from %{control.IP-Pool.Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
                clear = "Released IP %{${..attribute_name}} (did %{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})"
-               failed = "IP Allocation FAILED from %{control.Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
-               nopool = "No Pool-Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+               failed = "IP Allocation FAILED from %{control.IP-Pool.Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+               nopool = "No IP-Pool.Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
        }
        $INCLUDE ${modconfdir}/sql/ippool/${dialect}/queries.conf
 }
index 4249c7cfd61940568af2ebc2b9e0103ae997fd55..1a7fb390a99261127c5ab10d45fa3efd077111af 100644 (file)
@@ -1272,7 +1272,7 @@ be incorrect. There is little we can do about it.
 Refresh leases when we see a start or alive. Return an address to
 the IP Pool when we see a stop record.
 
-Ensure that &control.Pool-Name is set to determine which
+Ensure that &control.IP-Pool.Name is set to determine which
 pool of IPs are used.
 
 
index 40479ba86be2c246a09e93099e869f85b7af9ccc..3c181d03e80588071cbf47f34ee6924d6f389b46 100644 (file)
@@ -286,7 +286,7 @@ recv Discover {
                &DHCP-DHCP-Server-Identifier = 192.0.2.1
        }
 #      update control {
-#              &Pool-Name := "local"
+#              &IP-Pool.Name := "local"
 #      }
 #      dhcp_sqlippool
        ok
@@ -304,7 +304,7 @@ recv Request {
                &DHCP-DHCP-Server-Identifier = 192.0.2.1
        }
 #      update control {
-#              &Pool-Name := "local"
+#              &IP-Pool.Name := "local"
 #      }
 #      dhcp_sqlippool
        ok
index 61afa5e90d88b1a1182a44e52d30d46a903aea83..1b079b82dfe57a763202aefd7f5b087ac09943d3 100644 (file)
@@ -31,7 +31,7 @@ redis_ippool {
        #
        #  pool_name:: Name of the pool from which leases are allocated.
        #
-       pool_name = &control.Pool-Name
+       pool_name = &control.IP-Pool.Name
 
        #
        #  offer_time:: How long a lease is reserved for after making an offer.
index 18b114588e1ca8cb953473d26019aa6097937770..3e5902a9ecff38bd169ea3932221be3661cfa9fc 100644 (file)
@@ -149,13 +149,13 @@ sqlippool {
        messages {
                exists = "Existing IP: %{reply.${..attribute_name}} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
 
-               success = "Allocated IP: %{reply.${..attribute_name}} from %{control.Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+               success = "Allocated IP: %{reply.${..attribute_name}} from %{control.IP-Pool.Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
 
                clear = "Released IP %{${..attribute_name}} (did %{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})"
 
-               failed = "IP Allocation FAILED from %{control.Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+               failed = "IP Allocation FAILED from %{control.IP-Pool.Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
 
-               nopool = "No Pool-Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+               nopool = "No IP-Pool.Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
        }
 
        #
index 4b64dfe02dbaea3037da8133fef2d5eff7c6ef38..3382f5944971939585b9b195040b15dadaf143b2 100644 (file)
@@ -107,7 +107,7 @@ alloc_find = "\
 pool_check = "\
        SELECT id \
        FROM ${ippool_table} \
-       WHERE pool_name='%{control.${pool-name}}' \
+       WHERE pool_name='%{control.${IP-Pool.Name}}' \
        LIMIT 1"
 
 #
index 829dca92ca306bef7d273f566f5959edde3c13f0..996d366a3913eb1e4f78266ae6a5ac04238fbf92 100644 (file)
@@ -95,7 +95,7 @@ pool_check = "\
        FROM (\
                SELECT id \
                FROM ${ippool_table} \
-               WHERE pool_name = '%{control.Pool-Name}'\
+               WHERE pool_name = '%{control.IP-Pool.Name}'\
        ) WHERE ROWNUM = 1"
 
 #
index 3963a811db92e81f7c989e28c6dbaebd87f7b30c..0fbe61e0624b6c9afd60ac405c5ff416353ba1a1 100644 (file)
@@ -91,7 +91,7 @@ alloc_find = "\
 pool_check = "\
        SELECT id \
        FROM ${ippool_table} \
-       WHERE pool_name='%{control.Pool-Name}' \
+       WHERE pool_name='%{control.IP-Pool.Name}' \
        LIMIT 1"
 
 #
index 5e866f24a413077b90229f95389070c14a4bb55e..e9e2526e40f1c655690fc18913eced19410cab8c 100644 (file)
@@ -92,7 +92,7 @@ send Accounting-Response {
        #
        #  Return an address to the IP Pool when we see a stop record.
        #
-       #  Ensure that &control.Pool-Name is set to determine which
+       #  Ensure that &control.IP-Pool.Name is set to determine which
 ï¿¼    #  pool of IPs are used.
        #
        sqlippool
index 8b7e97d08e2ec0adc3faad9c9058e20f1eb84c34..a1674bf20ce1f0ef858494f9b0a344c2bc745ab9 100644 (file)
@@ -1544,7 +1544,7 @@ send Accounting-Response {
        #  Refresh leases when we see a start or alive. Return an address to
        #  the IP Pool when we see a stop record.
        #
-       #  Ensure that &control.Pool-Name is set to determine which
+       #  Ensure that &control.IP-Pool.Name is set to determine which
        #  pool of IPs are used.
        #
 #      sqlippool
index e0480b45168f9358d277a6ce0c9615a896fc0fcd..dc0205fa0bdaf804c4ae8b3a9618d0e7212af686 100644 (file)
@@ -151,7 +151,7 @@ recv Discover {
        #  Or, allocate IPs from the DHCP pool in SQL. You may need to
        #  set the pool name here if you haven't set it elsewhere.
 #      update control {
-#              &Pool-Name := "local"
+#              &IP-Pool.Name := "local"
 #      }
 #      dhcp_sqlippool
 
@@ -219,7 +219,7 @@ recv Request {
        #  Or, allocate IPs from the DHCP pool in SQL. You may need to
        #  set the pool name here if you haven't set it elsewhere.
 #      update control {
-#              &Pool-Name := "local"
+#              &IP-Pool.Name := "local"
 #      }
 #      dhcp_sqlippool
 
@@ -249,7 +249,7 @@ recv Decline {
        #  If using IPs from a DHCP pool in SQL then you may need to set the
        #  pool name here if you haven't set it elsewhere and mark the IP as declined.
 #      update control {
-#              &Pool-Name := "local"
+#              &IP-Pool.Name := "local"
 #      }
 #      dhcp_sqlippool
 
@@ -285,7 +285,7 @@ recv Release {
        #  If using IPs from a DHCP pool in SQL then you may need to set the
        #  pool name here if you haven't set it elsewhere and release the IP.
 #      update control {
-#              &Pool-Name := "local"
+#              &IP-Pool.Name := "local"
 #      }
 #      dhcp_sqlippool
 
index a95561e9c48142d98f2e2715d15223ee1bb3e69c..d0b6884d653044e64949c710b2712767fa91301a 100644 (file)
@@ -3,7 +3,7 @@
 # This work is licensed under CC-BY version 4.0 https://creativecommons.org/licenses/by/4.0
 # Version $Id$
 #
-#      Attributes used by ippool modules (5100-5199)
+#      Attributes used by IP-Pool modules (5100-5199)
 #
 #      $Id$
 #
 #
 FLAGS  internal
 
-ATTRIBUTE      Pool-Name                               5100    string
+ATTRIBUTE      IP-Pool                                 5100    tlv
 
-ATTRIBUTE      Pool-Action                             5101    integer
-ATTRIBUTE      Pool-Range                              5102    string
+BEGIN-TLV      IP-Pool
+ATTRIBUTE      Name                                    1       string  # Generic identifier for the IP pool to allocate from
+ATTRIBUTE      Name-NA                                 2       string  # DHCPv6 - Non-Temporary association pool
+ATTRIBUTE      Name-PD                                 3       string  # DHCPv6 - Prefix-deligation pool
+ATTRIBUTE      Name-TA                                 4       string  # DHCPv6 - Temporary association pool
+ATTRIBUTE      Action                                  5       integer
 
-VALUE  Pool-Action                     Allocate                1
+VALUE  Action                  Allocate                1
 # Renew == Update (they're the same action)
-VALUE  Pool-Action                     Renew                   2
-VALUE  Pool-Action                     Update                  2
-VALUE  Pool-Action                     Release                 3
-VALUE  Pool-Action                     Bulk-Release            4
+VALUE  Action                  Renew                   2
+VALUE  Action                  Update                  2
+VALUE  Action                  Release                 3
+VALUE  Action                  Bulk-Release            4
+
+ATTRIBUTE      Range                                   6       string
+END-TLV                IP-Pool
+
+
index f0b03a77e3b831c0a8a13adbf437cea045382972..c6537ff4ac2a887fed6a136922cb2ac4061e0322 100644 (file)
@@ -4,14 +4,14 @@
 $INCLUDE cluster_reset.inc
 
 update control {
-       &Pool-Name := 'test_alloc'
+       &IP-Pool.Name := 'test_alloc'
 }
 
 #
 #  Add IP addresses
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 }
 
 #
@@ -37,13 +37,13 @@ update request {
        &Tmp-Date-0 := "%l"
 }
 
-if ("%{expr:%{redis:ZSCORE '{%{control.Pool-Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" > 20) {
+if ("%{expr:%{redis:ZSCORE '{%{control.IP-Pool.Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" > 20) {
        test_pass
 } else {
        test_fail
 }
 
-if ("%{expr:%{redis:ZSCORE '{%{control.Pool-Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" < 40) {
+if ("%{expr:%{redis:ZSCORE '{%{control.IP-Pool.Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" < 40) {
        test_pass
 } else {
        test_fail
@@ -52,19 +52,19 @@ if ("%{expr:%{redis:ZSCORE '{%{control.Pool-Name}%}:pool' '%{reply.Framed-IP-Add
 #
 #  Verify the IP hash has been set
 #
-if ("%{redis:HGET '{%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address}' 'device'}" == '00:11:22:33:44:55') {
+if ("%{redis:HGET '{%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address}' 'device'}" == '00:11:22:33:44:55') {
        test_pass
 } else {
        test_fail
 }
 
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
        test_pass
 } else {
        test_fail
 }
 
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address} range}" == '192.168.0.0') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address} range}" == '192.168.0.0') {
        test_pass
 } else {
        test_fail
@@ -79,7 +79,7 @@ if (&reply.Pool-Range == '192.168.0.0') {
 #
 #  Verify the lease has been associated with the device
 #
-if (&reply.Framed-IP-Address == "%{redis:GET '{%{control.Pool-Name}%}:device:%{Calling-Station-ID}'}") {
+if (&reply.Framed-IP-Address == "%{redis:GET '{%{control.IP-Pool.Name}%}:device:%{Calling-Station-ID}'}") {
        test_pass
 } else {
        test_fail
@@ -105,7 +105,7 @@ update {
 #  Add IP addresses
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.1.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.1.0`
 }
 
 #
index ed61d7541956b0bd9bb942872a7fd7315d0095c2..1df0071de9f0b96adcdfbfb766c529376aedddd7 100644 (file)
@@ -10,7 +10,7 @@
 redis_ippool {
        device = &Calling-Station-ID
        gateway = &NAS-IP-Address
-       pool_name = &control.Pool-Name
+       pool_name = &control.IP-Pool.Name
 
        offer_time = 30
        lease_time = 60
index 8c48b2f42fadafcbd9597ec4e3d915fb1783bab3..22b5974c3e62348409fcf15b57e311abfd579801 100644 (file)
@@ -4,14 +4,14 @@
 $INCLUDE cluster_reset.inc
 
 update control {
-       &Pool-Name := 'test_delete'
+       &IP-Pool.Name := 'test_delete'
 }
 
 #
 #  Add IP addresses
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 }
 
 #
@@ -36,13 +36,13 @@ if (&reply.Framed-IP-Address == 192.168.0.1) {
 #  Delete the IP address
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -d 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -d 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 }
 
 #
 #  Verify the association with the device has been removed
 #
-if ("%{redis:EXISTS '{%{control.Pool-Name}%}:device:%{Calling-Station-ID}'}" == '0') {
+if ("%{redis:EXISTS '{%{control.IP-Pool.Name}%}:device:%{Calling-Station-ID}'}" == '0') {
        test_pass
 } else {
        test_fail
@@ -51,14 +51,14 @@ if ("%{redis:EXISTS '{%{control.Pool-Name}%}:device:%{Calling-Station-ID}'}" ==
 #
 #  Verify the hash information is removed
 #
-if ("%{redis:EXISTS '{%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address}'}" == '0') {
+if ("%{redis:EXISTS '{%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address}'}" == '0') {
        test_pass
 } else {
        test_fail
 }
 
 # Check the ZSCORE
-if ("%{redis:ZCOUNT '{%{control.Pool-Name}%}:pool' -inf +inf}" == 0) {
+if ("%{redis:ZCOUNT '{%{control.IP-Pool.Name}%}:pool' -inf +inf}" == 0) {
        test_pass
 } else {
        test_fail
index ecd533883b9b6a059ca8af3e07e9efd87cf03dfd..3f8c23117d94056a112ff593b0831916b0202bd2 100644 (file)
@@ -4,20 +4,20 @@
 $INCLUDE cluster_reset.inc
 
 update control {
-       &Pool-Name := 'test_update'
+       &IP-Pool.Name := 'test_update'
 }
 
 #
 #  Add IP addresses
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 }
 
 #
 #  Verify the range was set OK
 #
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:192.168.0.1 range}" == '192.168.0.0') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:192.168.0.1 range}" == '192.168.0.0') {
        test_pass
 } else {
        test_fail
@@ -27,13 +27,13 @@ if ("%{redis:HGET {%{control.Pool-Name}%}:ip:192.168.0.1 range}" == '192.168.0.0
 #  Modify the range
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -m 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 10.0.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -m 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 10.0.0.0`
 }
 
 #
 #  Check it was updated
 #
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:192.168.0.1 range}" == '10.0.0.0') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:192.168.0.1 range}" == '10.0.0.0') {
        test_pass
 } else {
        test_fail
index 0f27e075ec957104c59e2d8131b589a404698cf9..556027b8fe167d35e9522f11335c7688317ecd0e 100644 (file)
@@ -4,14 +4,14 @@
 $INCLUDE cluster_reset.inc
 
 update control {
-       &Pool-Name := 'test_update'
+       &IP-Pool.Name := 'test_update'
 }
 
 #
 #  Add IP addresses
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 }
 
 #
@@ -36,13 +36,13 @@ if (&reply.Framed-IP-Address == 192.168.0.1) {
 #  Release the IP address
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -r 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -r 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 }
 
 #
 #  Verify the association with the device has been removed
 #
-if ("%{redis:EXISTS '{%{control.Pool-Name}%}:device:%{Calling-Station-ID}'}" == '0') {
+if ("%{redis:EXISTS '{%{control.IP-Pool.Name}%}:device:%{Calling-Station-ID}'}" == '0') {
        test_pass
 } else {
        test_fail
@@ -51,26 +51,26 @@ if ("%{redis:EXISTS '{%{control.Pool-Name}%}:device:%{Calling-Station-ID}'}" ==
 #
 #  Verify the hash information is retained
 #
-if ("%{redis:HGET '{%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address}' 'device'}" == '00:11:22:33:44:55') {
+if ("%{redis:HGET '{%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address}' 'device'}" == '00:11:22:33:44:55') {
        test_pass
 } else {
        test_fail
 }
 
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
        test_pass
 } else {
        test_fail
 }
 
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address} range}" == '192.168.0.0') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address} range}" == '192.168.0.0') {
        test_pass
 } else {
        test_fail
 }
 
 # Check the ZSCORE
-if ("%{redis:ZSCORE '{%{control.Pool-Name}%}:pool' '%{reply.Framed-IP-Address}'}" == 0) {
+if ("%{redis:ZSCORE '{%{control.IP-Pool.Name}%}:pool' '%{reply.Framed-IP-Address}'}" == 0) {
        test_pass
 } else {
        test_fail
index a280a01652296cf7dc98908e8f59b3191d887204..05ef38d6758ddc79c3b9796c2309d501de858075 100644 (file)
@@ -4,14 +4,14 @@
 $INCLUDE cluster_reset.inc
 
 update control {
-       &Pool-Name := 'test_update'
+       &IP-Pool.Name := 'test_update'
 }
 
 #
 #  Add IP addresses
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 }
 
 #
@@ -51,7 +51,7 @@ if (updated) {
 #
 #  Verify the association with the device has been removed
 #
-if ("%{redis:EXISTS '{%{control.Pool-Name}%}:device:%{Calling-Station-ID}'}" == '0') {
+if ("%{redis:EXISTS '{%{control.IP-Pool.Name}%}:device:%{Calling-Station-ID}'}" == '0') {
        test_pass
 } else {
        test_fail
@@ -60,19 +60,19 @@ if ("%{redis:EXISTS '{%{control.Pool-Name}%}:device:%{Calling-Station-ID}'}" ==
 #
 #  Verify the hash information is retained
 #
-if ("%{redis:HGET '{%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address}' 'device'}" == '00:11:22:33:44:55') {
+if ("%{redis:HGET '{%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address}' 'device'}" == '00:11:22:33:44:55') {
        test_pass
 } else {
        test_fail
 }
 
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
        test_pass
 } else {
        test_fail
 }
 
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address} range}" == '192.168.0.0') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address} range}" == '192.168.0.0') {
        test_pass
 } else {
        test_fail
@@ -83,13 +83,13 @@ update request {
        &Tmp-Date-0 := "%l"
 }
 
-if ("%{expr:%{redis:ZSCORE '{%{control.Pool-Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" > 0) {
+if ("%{expr:%{redis:ZSCORE '{%{control.IP-Pool.Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" > 0) {
        test_pass
 } else {
        test_fail
 }
 
-if ("%{expr:%{redis:ZSCORE '{%{control.Pool-Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" < 10) {
+if ("%{expr:%{redis:ZSCORE '{%{control.IP-Pool.Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" < 10) {
        test_pass
 } else {
        test_fail
index faaf911ed29fc60de831d19bcac3496ca7a9dd6c..d215e626ae88ebbcd2b8b6e73a6ccff008564522 100644 (file)
@@ -4,14 +4,14 @@
 $INCLUDE cluster_reset.inc
 
 update control {
-       &Pool-Name := 'test_update'
+       &IP-Pool.Name := 'test_update'
 }
 
 #
 #  Add IP addresses
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 }
 
 # 1. Check allocation
@@ -37,7 +37,7 @@ if (&reply.Session-Timeout == 30) {
 }
 
 # 4. Verify the gateway was set
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
        test_pass
 } else {
        test_fail
@@ -45,7 +45,7 @@ if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address} gateway}
 
 # 5. Add another IP addresses
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.1.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.1.0`
 }
 
 # 6. Verify that the lease time is extended
@@ -73,35 +73,35 @@ update request {
        &Tmp-Date-0 := "%l"
 }
 
-if ("%{expr:%{redis:ZSCORE '{%{control.Pool-Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" > 50) {
+if ("%{expr:%{redis:ZSCORE '{%{control.IP-Pool.Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" > 50) {
        test_pass
 } else {
        test_fail
 }
 
 # 9.
-if ("%{expr:%{redis:ZSCORE '{%{control.Pool-Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" < 70) {
+if ("%{expr:%{redis:ZSCORE '{%{control.IP-Pool.Name}%}:pool' '%{reply.Framed-IP-Address}'} - %{integer:&Tmp-Date-0}}" < 70) {
        test_pass
 } else {
        test_fail
 }
 
 # 10. Verify the lease is still associated with the device
-if (&reply.Framed-IP-Address == "%{redis:GET '{%{control.Pool-Name}%}:device:%{Calling-Station-ID}'}") {
+if (&reply.Framed-IP-Address == "%{redis:GET '{%{control.IP-Pool.Name}%}:device:%{Calling-Station-ID}'}") {
        test_pass
 } else {
        test_fail
 }
 
 # 11. And that the device object will expire a suitable number of seconds into the future
-if ("%{redis:TTL '{%{control.Pool-Name}%}:device:%{Calling-Station-ID}'}" == 60) {
+if ("%{redis:TTL '{%{control.IP-Pool.Name}%}:device:%{Calling-Station-ID}'}" == 60) {
        test_pass
 } else {
        test_fail
 }
 
 # 12. Verify the gateway was updated
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{request.Framed-IP-Address} gateway}" == '127.0.0.2') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{request.Framed-IP-Address} gateway}" == '127.0.0.2') {
        test_pass
 } else {
        test_fail
@@ -145,7 +145,7 @@ if (invalid) {
 }
 
 # 16. Verify the lease is still associated with the previous device
-if (&reply.Framed-IP-Address == "%{redis:GET '{%{control.Pool-Name}%}:device:00:11:22:33:44:55'}") {
+if (&reply.Framed-IP-Address == "%{redis:GET '{%{control.IP-Pool.Name}%}:device:00:11:22:33:44:55'}") {
        test_pass
 } else {
        test_fail
index 45469d43304243cf26a2508c2fa4765be209773e..82a1a17bc6ba231674e142a64dad5e59b8474da8 100644 (file)
@@ -4,14 +4,14 @@
 $INCLUDE cluster_reset.inc
 
 update control {
-       &Pool-Name := 'test_update'
+       &IP-Pool.Name := 'test_update'
 }
 
 #
 #  Add IP addresses
 #
 update request {
-       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.Pool-Name} 192.168.0.0`
+       &Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
 }
 
 # 1. Check allocation
@@ -40,7 +40,7 @@ if (&reply.Session-Timeout == 60) {
 }
 
 # 4. Verify the gateway was set
-if ("%{redis:HGET {%{control.Pool-Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
+if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address} gateway}" == '127.0.0.1') {
        test_pass
 } else {
        test_fail