]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Move more Packet-* to Net.*
authorAlan T. DeKok <aland@freeradius.org>
Sun, 3 Sep 2023 13:03:55 +0000 (09:03 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 3 Sep 2023 13:03:55 +0000 (09:03 -0400)
raddb/mods-config/files/accounting
raddb/mods-config/sql/cui/mysql/queries.conf
raddb/mods-config/sql/cui/postgresql/queries.conf
raddb/mods-config/sql/cui/sqlite/queries.conf
raddb/policy.d/accounting
raddb/policy.d/cui
raddb/sites-available/dhcp
raddb/sites-available/dynamic-clients

index de6f89b6f0e5b025b64b7cbe0a1c8e5e73542bad..6922da1d66e4f7430ee3f651aeaa033c2a1e6328 100644 (file)
@@ -13,7 +13,7 @@
 #
 #DEFAULT Huntgroup-Name == "wifi", Acct-Type := sql_log.wifi
 #
-#DEFAULT Packet-Src-IP-Address == 10.0.0.1, Acct-Type := sql_log.other
+#DEFAULT Net.Src.IP == 10.0.0.1, Acct-Type := sql_log.other
 #
 #DEFAULT Acct-Status-Type == Start, Acct-Type := sql_log.start
 
index 7085b532235af5f5cda288ed42abd9a50dcad8b8..ce53b4f8b3c0226cf91b2088996e69d253a27e2d 100644 (file)
@@ -9,7 +9,7 @@ post-auth {
                INSERT INTO ${..cui_table} \
                        (clientipaddress, callingstationid, username, cui, lastaccounting) \
                VALUES \
-                       ('%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}', '%{Calling-Station-Id}', \
+                       ('%{Net.Src.IP}', '%{Calling-Station-Id}', \
                        '%{User-Name}', '%{reply.Chargeable-User-Identity}', NULL) \
                ON DUPLICATE KEY UPDATE \
                        lastaccounting='0000-00-00 00:00:00', \
@@ -24,7 +24,7 @@ accounting {
                        query = "\
                                UPDATE ${....cui_table} SET \
                                        lastaccounting = CURRENT_TIMESTAMP \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}' \
                                AND cui = '%{Chargeable-User-Identity}'"
@@ -33,7 +33,7 @@ accounting {
                        query ="\
                                UPDATE ${....cui_table} SET \
                                        lastaccounting = CURRENT_TIMESTAMP \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}' \
                                AND cui = '%{Chargeable-User-Identity}'"
@@ -41,7 +41,7 @@ accounting {
                stop {
                        query ="\
                                DELETE FROM ${....cui_table} \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}' \
                                AND cui = '%{Chargeable-User-Identity}'"
index 373c61ac0306cc4e7ad2aca927ed74231951338d..d2959e34a44ed3f4914f3700e8df526f8212ef6d 100644 (file)
@@ -12,7 +12,7 @@ post-auth {
                INSERT INTO ${..cui_table} \
                        (clientipaddress, callingstationid, username, cui) \
                VALUES \
-                       ('%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}', '%{Calling-Station-Id}', \
+                       ('%{Net.Src.IP}', '%{Calling-Station-Id}', \
                        '%{User-Name}', '%{reply.Chargeable-User-Identity}') \
                ON CONFLICT ON CONSTRAINT ${..cui_table}_pkey \
                DO UPDATE SET cui = EXCLUDED.cui, lastaccounting = '-infinity'::timestamp"
@@ -26,7 +26,7 @@ accounting {
                        query = "\
                                UPDATE ${....cui_table} SET \
                                        lastaccounting = now() \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}' \
                                AND cui = '%{Chargeable-User-Identity}'"
@@ -35,7 +35,7 @@ accounting {
                        query ="\
                                UPDATE ${....cui_table} SET \
                                        lastaccounting = now() \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}' \
                                AND cui = '%{Chargeable-User-Identity}'"
@@ -43,7 +43,7 @@ accounting {
                stop {
                        query ="\
                                DELETE FROM ${....cui_table} \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}' \
                                AND cui = '%{Chargeable-User-Identity}'"
index a1a3df8b81fa69b2fa4dc71e9373e67e141d96e9..eff87b4f361f10383c4bfef87d96ce09aaefc493 100644 (file)
@@ -9,7 +9,7 @@ post-auth {
                INSERT OR REPLACE INTO ${..cui_table} \
                        (clientipaddress, callingstationid, username, cui, lastaccounting) \
                VALUES \
-                       ('%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}', '%{Calling-Station-Id}', \
+                       ('%{Net.Src.IP}', '%{Calling-Station-Id}', \
                        '%{User-Name}', '%{reply.Chargeable-User-Identity}', NULL)"
 
 }
@@ -21,7 +21,7 @@ accounting {
                        query = "\
                                UPDATE ${....cui_table} SET \
                                        lastaccounting = CURRENT_TIMESTAMP \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}' \
                                AND cui = '%{Chargeable-User-Identity}'"
@@ -30,7 +30,7 @@ accounting {
                        query ="\
                                UPDATE ${....cui_table} SET \
                                        lastaccounting = CURRENT_TIMESTAMP \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}' \
                                AND cui = '%{Chargeable-User-Identity}'"
@@ -38,7 +38,7 @@ accounting {
                stop {
                        query ="\
                                DELETE FROM ${....cui_table} \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}' \
                                AND cui = '%{Chargeable-User-Identity}'"
index 10e62d4abe724575671ab66c27885c1a0b9feae1..569ec4aeabb23c9ee18c0e5eb99c256b3059c42f 100644 (file)
@@ -47,7 +47,7 @@ acct_unique {
        #  Using a Class/Session-ID combination is more robust
        #  than using elements in the Accounting-Request,
        #  which may be subject to change, such as
-       #  NAS-IP-Address, Packet-Src-IP-Address and
+       #  NAS-IP-Address, Net.Src.IP and
        #  NAS-Port-ID/NAS-Port.
        #
        #  This policy should ensure that session data is not
@@ -75,7 +75,7 @@ acct_unique {
 #      Insert a (hopefully unique) value into class
 #
 insert_acct_class {
-       &reply.Class = "${policy.class_value_prefix}%{md5:%t,%I,%{Packet-Src-Port},%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}},%{NAS-IP-Address},%{Calling-Station-ID},%{User-Name}}"
+       &reply.Class = "${policy.class_value_prefix}%{md5:%t,%I,%{Net.Src.Port},%{Net.Src.IP},%{NAS-IP-Address},%{Calling-Station-ID},%{User-Name}}"
 }
 
 #
index 5636297bcc4e247c1c01e21082362d597f2d459b..4e1e5532dad8eb1db9b16e668540b532ccc0b7dc 100644 (file)
@@ -95,7 +95,7 @@ cui.accounting {
        if (!&Chargeable-User-Identity) {
                &request.Chargeable-User-Identity := %{cuisql:\
                                SELECT cui FROM cui \
-                               WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \
+                               WHERE clientipaddress = '%{Net.Src.IP}' \
                                AND callingstationid = '%{Calling-Station-Id}' \
                                AND username = '%{User-Name}'}
        }
index bfc0c1bc835c57e5d0ad86daeec3791801bc7bd3..e3727e95e0ab9fd1166388163828c5f139762749 100644 (file)
@@ -256,9 +256,9 @@ recv Inform {
 #  For Windows 7 boxes
 #
 #recv Inform {
-#      &reply.Packet-Dst-Port = 67
+#      &reply.Net.Dst.Port = 67
 #      &reply.Message-Type = Ack
-#      &reply.Server-Identifier = "%{Packet-Dst-IP-Address}"
+#      &reply.Server-Identifier = "%{Net.Dst.IP}"
 #      &reply.Site-specific-28 = 0x0a00
 #      ok
 #}
index cdd897688016dc45f76719a7c8733a55e3eda0f2..83d2a48417e011935490c154b0797a1db14e5be6 100644 (file)
@@ -239,7 +239,7 @@ server dynamic_clients {
                #  Copy the IP address of the client from
                #  the request just received
                &control += {
-                       &FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}"
+                       &FreeRADIUS-Client-IP-Address = "%{Net.Src.IP}"
 
                        #  require_message_authenticator
                        &FreeRADIUS-Client-Require-MA = no
@@ -247,7 +247,7 @@ server dynamic_clients {
                        &FreeRADIUS-Client-Secret = "testing123"
 
                        #  shortname
-                       &FreeRADIUS-Client-Shortname = "%{Packet-Src-IP-Address}"
+                       &FreeRADIUS-Client-Shortname = "%{Net.Src.IP}"
 
                        #  nas_type
                        &FreeRADIUS-Client-NAS-Type = "other"