Add policy to create 64bit octet counters
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 2 Dec 2013 19:35:41 +0000 (19:35 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 2 Dec 2013 20:34:56 +0000 (20:34 +0000)
raddb/policy.d/accounting
raddb/sites-available/default
share/dictionary.freeradius.internal

index 48cb8b7..369b1c6 100644 (file)
@@ -60,3 +60,13 @@ insert_acct_class {
        }
 }
 
+#
+#      Merges Acct-[Input|Output]-Octets and Acct-[Input|Output]-Gigawords into Acct-[Input|Output]-Octets64
+#
+acct_counters64.preacct {
+       update request {
+               Acct-Input-Octets64 = "%{expr:(%{%{Acct-Input-Gigawords}:-0} * 4294967296) + %{%{Acct-Input-Octets}:-0}}"
+               Acct-Output-Octets64 = "%{expr:(%{%{Acct-Output-Gigawords}:-0} * 4294967296) + %{%{Acct-Output-Octets}:-0}}"
+       }
+}
+
index 6c0ad24..3278975 100644 (file)
@@ -484,6 +484,12 @@ preacct {
        preprocess
 
        #
+       #  Merge Acct-[Input|Output]-Gigawords and Acct-[Input-Output]-Octets
+       #  into a single 64bit counter Acct-[Input|Output]-Octets64.
+       #
+#      acct_counters64
+
+       #
        #  Session start times are *implied* in RADIUS.
        #  The NAS never sends a "start time".  Instead, it sends
        #  a start packet, *possibly* with an Acct-Delay-Time.
index 8206c22..d9d0d0c 100644 (file)
@@ -240,6 +240,10 @@ ATTRIBUTE  FreeRADIUS-Client-Src-IPv6-Address      1144    ipv6addr
 
 ATTRIBUTE      OTP-Challenge                           1145    string
 ATTRIBUTE      EAP-Session-Id                          1146    octets
+
+ATTRIBUTE      Acct-Input-Octets64                     1148    integer64
+ATTRIBUTE      Acct-Output-Octets64                    1149    integer64
+
 #
 #      Range:  1200-1279
 #              EAP-SIM (and other EAP type) weirdness.