]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove un-needed .dflt="" and tidy configs
authorNick Porter <nick@portercomputing.co.uk>
Wed, 19 Aug 2020 09:37:34 +0000 (10:37 +0100)
committerAlan DeKok <aland@freeradius.org>
Wed, 9 Sep 2020 12:45:16 +0000 (08:45 -0400)
raddb/mods-config/sql/ippool-dhcp/mssql/queries.conf
raddb/mods-config/sql/ippool-dhcp/mysql/queries.conf
raddb/mods-config/sql/ippool-dhcp/oracle/queries.conf
raddb/mods-config/sql/ippool-dhcp/postgresql/queries.conf
raddb/mods-config/sql/ippool-dhcp/sqlite/queries.conf
raddb/mods-config/sql/ippool/oracle/queries.conf
src/modules/rlm_sqlippool/rlm_sqlippool.c

index 05c15175c5a6701a026410fff0f42152c507fab7..136cfa56f9cc22f4551aac1730d07995415586b6 100644 (file)
@@ -150,19 +150,16 @@ pool_check = "\
 #
 #  Queries to extend a lease - used in response to DHCP-Request packets
 #
-extend_begin = ""
 extend_update = "\
        UPDATE ${ippool_table} \
        SET expiry_time = DATEADD(SECOND,${lease_duration},CURRENT_TIMESTAMP) \
        WHERE pool_name = '%{control:${pool_name}}' \
        AND pool_key = '${pool_key}' \
        AND framedipaddress = '%{DHCP-Requested-IP-Address}'"
-extend_commit = ""
 
 #
 #  Queries to release a lease - used in response to DHCP-Release packets
 #
-release_begin = ""
 release_clear = "\
        UPDATE ${ippool_table} \
        SET gateway = '', \
@@ -171,15 +168,12 @@ release_clear = "\
        WHERE pool_name = '%{control:${pool_name}}' \
        AND pool_key = '${pool_key}' \
        AND framedipaddress = '%{DHCP-Client-IP-Address}'"
-release_commit = ""
 
 #
 #  Queries to mark leases as "bad" - used in response to DHCP-Decline
 #
-mark_begin = ""
 mark_update = "\
        UPDATE ${ippool_table} \
        SET status_id = (SELECT status_id FROM dhcpstatus WHERE status = 'declined') \
        WHERE pool_name = '%{control:${pool_name}}' \
        AND framedipaddress = '%{DHCP-Requested-IP-Address}'"
-mark_commit = ""
index 15d62beff7d45cb05aa6ff4d3803467d1b4670d6..bdf622902bc6ca6644f27aa96bf63cf895980d0b 100644 (file)
@@ -115,19 +115,16 @@ allocate_update = "\
 #
 #  Queries to extend a lease - used in response to DHCP-Request packets
 #
-extend_begin = ""
 extend_update = "\
        UPDATE ${ippool_table} \
        SET expiry_time = 'now'::timesheet(0) + '${lease_duration} second'::interval \
        WHERE pool_name = '%{control:${pool_name}}' \
        AND pool_key = '${pool_key}' \
        AND framedipaddress = '%{DHCP-Requested-IP-Address}'"
-extend_commit = ""
 
 #
 #  Queries to release a lease - used in response to DHCP-Release packets
 #
-release_begin = ""
 release_clear = "\
        UPDATE ${ippool_table} \
        SET gateway = '', \
@@ -136,15 +133,12 @@ release_clear = "\
        WHERE pool_name = '%{control:${pool_name}}' \
        AND pool_key = '${pool_key}' \
        AND framedipaddress = '%{DHCP-Client-IP-Address}'"
-release_commit = ""
 
 #
 #  Queries to mark leases as "bad" - used in response to DHCP-Decline
 #
-mark_begin = ""
 mark_update = "\
        UPDATE ${ippool_table} \
        SET `status` = 'declined' \
        WHERE pool_name = '%{control:${pool_name}}' \
        AND framedipaddress = '%{DHCP-Requested-IP-Address}'"
-mark_commit = ""
index 251098a0030ad585e524f83979c93aeec7bca021..06197f02964554bfcde8fa29cdd950341e575358 100644 (file)
@@ -4,6 +4,9 @@
 #
 #  $id: 416d59802a1321c16b936bb5e63c288ca3634bcd $
 
+#
+#  Due to Oracle's transaction focus, update queries further down are
+#  wrapped in "commit" statements.
 #
 #  Use a stored procedure to find AND allocate the address. Read and customise
 #  `procedure.sql` in this directory to determine the optimal configuration.
@@ -135,40 +138,3 @@ mark_update = "\
        WHERE pool_name = '%{control:${pool_name}}' \
        AND framedipaddress = '%{DHCP-Requested-IP-Address}'"
 mark_commit = "commit"
-
-
-#
-#  This query is not applicable to DHCP as there are no accounting
-#  START records
-#
-start_update = ""
-
-#
-#  This query frees an IP address when an accounting STOP record arrives
-#  - for DHCP this is when a Release occurs
-#
-stop_clear = "\
-       UPDATE ${ippool_table} \
-       SET \
-               gateway = '', \
-               pool_key = '0', \
-               expiry_time = current_timestamp - INTERVAL '1' second(1) \
-       WHERE pool_name = '%{control:${pool_name}}' \
-       AND pool_key = '${pool_key}' \
-       AND framedipaddress = '%{DHCP-Client-IP-Address}'"
-
-#
-#  This query is not applicable to DHCP as there are no accounting
-#  ALIVE records
-#
-alive_update = ""
-
-#
-#  This query is not applicable to DHCP
-#
-on_clear = ""
-
-#
-#  This query is not applicable to DHCP
-#
-off_clear = ""
index 3159fafab26b611580935c38560314a991ea3e23..4a73cec3a96b010708d8b5491fce73e6813339d3 100644 (file)
@@ -133,19 +133,16 @@ pool_check = "\
 #
 #  Queries to extend a lease - used in response to DHCP-Request packets
 #
-extend_begin = ""
 extend_update = "\
        UPDATE ${ippool_table} \
        SET expiry_time = 'now'::timesheet(0) + '${lease_duration} second'::interval \
        WHERE pool_name = '%{control:${pool_name}}' \
        AND pool_key = '${pool_key}' \
        AND framedipaddress = '%{DHCP-Requested-IP-Address}'"
-extend_commit = ""
 
 #
 #  Queries to release a lease - used in response to DHCP-Release packets
 #
-release_begin = ""
 release_clear = "\
        UPDATE ${ippool_table} \
        SET gateway = '', \
@@ -154,15 +151,12 @@ release_clear = "\
        WHERE pool_name = '%{control:${pool_name}}' \
        AND pool_key = '${pool_key}' \
        AND framedipaddress = '%{DHCP-Client-IP-Address}'"
-release_commit = ""
 
 #
 #  Queries to mark leases as "bad" - used in response to DHCP-Decline
 #
-mark_begin = ""
 mark_update = "\
        UPDATE ${ippool_table} \
        SET status = 'declined' \
        WHERE pool_name = '%{control:${pool_name}}' \
        AND framedipaddress = '%{DHCP-Requested-IP-Address}'"
-mark_commit = ""
index fb74c149957be180199664c3166fa0d57a8f9ca7..fe13b101637570ae4d20519c7b5d3d6dbc2994c7 100644 (file)
@@ -101,19 +101,16 @@ allocate_update = "\
 #
 #  Queries to extend a lease - used in response to DHCP-Request packets
 #
-extend_begin = ""
 extend_update = "\
        UPDATE ${ippool_table} \
        SET expiry_time = datetime(strftime('%%s', 'now') + ${lease_duration}, 'unixepoch') \
        WHERE pool_name = '%{control:${pool_name}}' \
        AND pool_key = '${pool_key}' \
        AND framedipaddress = '%{DHCP-Requested-IP-Address}'"
-extend_commit = ""
 
 #
 #  Queries to release a lease - used in response to DHCP-Release packets
 #
-release_begin = ""
 release_clear = "\
        UPDATE ${ippool_table} \
        SET gateway = '', \
@@ -122,16 +119,13 @@ release_clear = "\
        WHERE pool_name = '%{control:${pool_name}}' \
        AND pool_key = '${pool_key}' \
        AND framedipaddress = '%{DHCP-Client-IP-Address}'"
-release_commit = ""
 
 #
 #  Queries to mark leases as "bad" - used in response to DHCP-Decline
 #
-mark_begin = ""
 mark_update = "\
        UPDATE ${ippool_table} \
        SET status_id = (SELECT status_id FROM dhcpstatus WHERE status = 'declined') \
        WHERE pool_name = '%{control:${pool_name}}' \
        AND framedipaddress = '%{DHCP-Requested-IP-Address}'"
-mark_commit = ""
 
index 9f4b0d191e49d50ca165de5cbac8e2cd86faae8e..0faa5fba6ed28aaa75e18e495cf291e81e4afbc9 100644 (file)
@@ -4,6 +4,9 @@
 #
 #  $Id$
 
+#
+#  Due to Oracle's transaction focus, update queries further down are
+#  wrapped in "commit" statements.
 #
 #  This query allocates an IP address from the Pool
 #  The ORDER BY clause of this query tries to allocate the same IP-address
index fa188c31006acfc1c6d88f56d10add9c0615d8b6..0556faea24b3d7ac62919852419a439985fba110 100644 (file)
@@ -104,7 +104,7 @@ static CONF_PARSER module_config[] = {
 
        { FR_CONF_OFFSET("lease_duration", FR_TYPE_UINT32, rlm_sqlippool_t, lease_duration), .dflt = "86400" },
 
-       { FR_CONF_OFFSET("pool_name", FR_TYPE_STRING, rlm_sqlippool_t, pool_name), .dflt = "" },
+       { FR_CONF_OFFSET("pool_name", FR_TYPE_STRING, rlm_sqlippool_t, pool_name) },
 
        { FR_CONF_OFFSET("attribute_name", FR_TYPE_STRING | FR_TYPE_REQUIRED | FR_TYPE_NOT_EMPTY, rlm_sqlippool_t, attribute_name), .dflt = "Framed-IP-Address" },
 
@@ -113,44 +113,44 @@ static CONF_PARSER module_config[] = {
 
        { FR_CONF_OFFSET("allocate_begin", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, allocate_begin), .dflt = "START TRANSACTION" },
 
-       { FR_CONF_OFFSET("allocate_existing", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, allocate_existing), .dflt = "" },
+       { FR_CONF_OFFSET("allocate_existing", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, allocate_existing) },
 
-       { FR_CONF_OFFSET("allocate_find", FR_TYPE_STRING | FR_TYPE_XLAT | FR_TYPE_REQUIRED, rlm_sqlippool_t, allocate_find), .dflt = "" },
+       { FR_CONF_OFFSET("allocate_find", FR_TYPE_STRING | FR_TYPE_XLAT | FR_TYPE_REQUIRED, rlm_sqlippool_t, allocate_find) },
 
-       { FR_CONF_OFFSET("allocate_update", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, allocate_update), .dflt = "" },
+       { FR_CONF_OFFSET("allocate_update", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, allocate_update) },
 
        { FR_CONF_OFFSET("allocate_commit", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, allocate_commit), .dflt = "COMMIT" },
 
 
-       { FR_CONF_OFFSET("pool_check", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, pool_check), .dflt = "" },
+       { FR_CONF_OFFSET("pool_check", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, pool_check) },
 
 
-       { FR_CONF_OFFSET("extend_begin", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, extend_begin), .dflt = "" },
+       { FR_CONF_OFFSET("extend_begin", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, extend_begin) },
 
-       { FR_CONF_OFFSET("extend_update", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, extend_update), .dflt = "" },
+       { FR_CONF_OFFSET("extend_update", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, extend_update) },
 
-       { FR_CONF_OFFSET("extend_commit", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, extend_commit), .dflt = "" },
+       { FR_CONF_OFFSET("extend_commit", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, extend_commit) },
 
 
-       { FR_CONF_OFFSET("release_begin", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, release_begin), .dflt = "" },
+       { FR_CONF_OFFSET("release_begin", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, release_begin) },
 
-       { FR_CONF_OFFSET("release_clear", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, release_clear), .dflt = "" },
+       { FR_CONF_OFFSET("release_clear", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, release_clear) },
 
-       { FR_CONF_OFFSET("release_commit", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, release_commit), .dflt = "" },
+       { FR_CONF_OFFSET("release_commit", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, release_commit) },
 
 
-       { FR_CONF_OFFSET("bulkrelease_begin", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, bulkrelease_begin), .dflt = "" },
+       { FR_CONF_OFFSET("bulkrelease_begin", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, bulkrelease_begin) },
 
-       { FR_CONF_OFFSET("bulkrelease_clear", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, bulkrelease_clear), .dflt = "" },
+       { FR_CONF_OFFSET("bulkrelease_clear", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, bulkrelease_clear) },
 
-       { FR_CONF_OFFSET("bulkrelease_commit", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, bulkrelease_commit), .dflt = "" },
+       { FR_CONF_OFFSET("bulkrelease_commit", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, bulkrelease_commit) },
 
 
-       { FR_CONF_OFFSET("mark_begin", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, mark_begin), .dflt = "" },
+       { FR_CONF_OFFSET("mark_begin", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, mark_begin) },
 
-       { FR_CONF_OFFSET("mark_update", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, mark_update), .dflt = "" },
+       { FR_CONF_OFFSET("mark_update", FR_TYPE_STRING | FR_TYPE_XLAT , rlm_sqlippool_t, mark_update) },
 
-       { FR_CONF_OFFSET("mark_commit", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, mark_commit), .dflt = "" },
+       { FR_CONF_OFFSET("mark_commit", FR_TYPE_STRING | FR_TYPE_XLAT, rlm_sqlippool_t, mark_commit) },
 
 
        { FR_CONF_POINTER("messages", FR_TYPE_SUBSECTION, NULL), .subcs = (void const *) message_config },