# Returns the current epoch time in ms
#
-# Sets Tmp-Integer64-0 with the current epoch time in ms
+# Sets Tmp-uint64-0 with the current epoch time in ms
time_current_ms {
update request {
- Tmp-Integer64-0 := "%{expr:(%c*1000) + (%C/1000)}"
+ Tmp-uint64-0 := "%{expr:(%c*1000) + (%C/1000)}"
}
}
# Returns elapsed time in ms since time_current_ms
#
-# Sets Tmp-Integer64-1 with number of milliseconds
+# Sets Tmp-uint64-1 with number of milliseconds
time_elapsed_ms {
update request {
- Tmp-Integer64-1 := "%{expr:(%c*1000) + (%C/1000) - %{Tmp-Integer64-0}}"
+ Tmp-uint64-1 := "%{expr:(%c*1000) + (%C/1000) - %{Tmp-uint64-0}}"
}
}
ATTRIBUTE Called-Station-SSID 1139 string
-ATTRIBUTE Acct-Input-Octets64 1148 integer64
-ATTRIBUTE Acct-Output-Octets64 1149 integer64
+ATTRIBUTE Acct-Input-Octets64 1148 uint64
+ATTRIBUTE Acct-Output-Octets64 1149 uint64
ATTRIBUTE FreeRADIUS-Client-IP-Prefix 1150 ipv4prefix
ATTRIBUTE FreeRADIUS-Client-IPv6-Prefix 1151 ipv6prefix
# Attributes 1850 through 1850 + FR_TYPE_MAX are reserved.
#
-ATTRIBUTE Tmp-Integer64-0 1760 integer64
-ATTRIBUTE Tmp-Integer64-1 1761 integer64
-ATTRIBUTE Tmp-Integer64-2 1762 integer64
-ATTRIBUTE Tmp-Integer64-3 1763 integer64
-ATTRIBUTE Tmp-Integer64-4 1764 integer64
-ATTRIBUTE Tmp-Integer64-5 1765 integer64
-ATTRIBUTE Tmp-Integer64-6 1766 integer64
-ATTRIBUTE Tmp-Integer64-7 1767 integer64
-ATTRIBUTE Tmp-Integer64-8 1768 integer64
-ATTRIBUTE Tmp-Integer64-9 1769 integer64
-
-ATTRIBUTE Tmp-Signed-0 1770 signed
-ATTRIBUTE Tmp-Signed-1 1771 signed
-ATTRIBUTE Tmp-Signed-2 1772 signed
-ATTRIBUTE Tmp-Signed-3 1773 signed
-ATTRIBUTE Tmp-Signed-4 1774 signed
-ATTRIBUTE Tmp-Signed-5 1775 signed
-ATTRIBUTE Tmp-Signed-6 1776 signed
-ATTRIBUTE Tmp-Signed-7 1777 signed
-ATTRIBUTE Tmp-Signed-8 1778 signed
-ATTRIBUTE Tmp-Signed-9 1779 signed
-
-ATTRIBUTE Tmp-Ethernet-0 1780 ether
-ATTRIBUTE Tmp-Ethernet-1 1781 ether
-ATTRIBUTE Tmp-Ethernet-2 1782 ether
-ATTRIBUTE Tmp-Ethernet-3 1783 ether
-ATTRIBUTE Tmp-Ethernet-4 1784 ether
+ATTRIBUTE Tmp-uint64-0 1760 uint64
+ATTRIBUTE Tmp-uint64-1 1761 uint64
+ATTRIBUTE Tmp-uint64-2 1762 uint64
+ATTRIBUTE Tmp-uint64-3 1763 uint64
+ATTRIBUTE Tmp-uint64-4 1764 uint64
+ATTRIBUTE Tmp-uint64-5 1765 uint64
+ATTRIBUTE Tmp-uint64-6 1766 uint64
+ATTRIBUTE Tmp-uint64-7 1767 uint64
+ATTRIBUTE Tmp-uint64-8 1768 uint64
+ATTRIBUTE Tmp-uint64-9 1769 uint64
+
+ATTRIBUTE Tmp-int64-0 1770 int64
+ATTRIBUTE Tmp-int64-1 1771 int64
+ATTRIBUTE Tmp-int64-2 1772 int64
+ATTRIBUTE Tmp-int64-3 1773 int64
+ATTRIBUTE Tmp-int64-4 1774 int64
+ATTRIBUTE Tmp-int64-5 1775 int64
+ATTRIBUTE Tmp-int64-6 1776 int64
+ATTRIBUTE Tmp-int64-7 1777 int64
+ATTRIBUTE Tmp-int64-8 1778 int64
+ATTRIBUTE Tmp-int64-9 1779 int64
+
+ATTRIBUTE Tmp-Signed-0 1780 signed
+ATTRIBUTE Tmp-Signed-1 1781 signed
+ATTRIBUTE Tmp-Signed-2 1782 signed
+ATTRIBUTE Tmp-Signed-3 1783 signed
+ATTRIBUTE Tmp-Signed-4 1784 signed
+ATTRIBUTE Tmp-Signed-5 1785 signed
+ATTRIBUTE Tmp-Signed-6 1786 signed
+ATTRIBUTE Tmp-Signed-7 1787 signed
+ATTRIBUTE Tmp-Signed-8 1788 signed
+ATTRIBUTE Tmp-Signed-9 1789 signed
+
+ATTRIBUTE Tmp-Ethernet-0 1790 ether
+ATTRIBUTE Tmp-Ethernet-1 1791 ether
+ATTRIBUTE Tmp-Ethernet-2 1792 ether
+ATTRIBUTE Tmp-Ethernet-3 1793 ether
+ATTRIBUTE Tmp-Ethernet-4 1794 ether
ATTRIBUTE Tmp-Float-0 1880 float32
# Regression test for double consecutive alternations
update request {
- &Tmp-Integer64-0 := "%{%{Acct-Input-Octets}:-2}%{%{Acct-Input-Gigawords}:-1}"
+ &Tmp-uint64-0 := "%{%{Acct-Input-Octets}:-2}%{%{Acct-Input-Gigawords}:-1}"
}
-if (&Tmp-Integer64-0 != 21) {
+if (&Tmp-uint64-0 != 21) {
fail
}
# String - network order representation of a 8 char string
update request {
- &Tmp-Integer64-0 := "%(integer:%{Tmp-String-1})"
+ &Tmp-uint64-0 := "%(integer:%{Tmp-String-1})"
}
-if ((<integer64>&Tmp-String-1 != &Tmp-Integer64-0) || (&Tmp-Integer64-0 != 98709870)) {
+if ((<integer64>&Tmp-String-1 != &Tmp-uint64-0) || (&Tmp-uint64-0 != 98709870)) {
test_fail
}
# Octets - network order representation of a 8 byte octet string
update request {
- &Tmp-Integer64-0 := "%(integer:%{Tmp-Octets-1})"
+ &Tmp-uint64-0 := "%(integer:%{Tmp-Octets-1})"
}
#
# Disabled until xlats can return binary data
#
-#if (&Tmp-Octets-1 != "%{hex:Tmp-Integer64-0}") {
+#if (&Tmp-Octets-1 != "%{hex:Tmp-uint64-0}") {
# test_fail
#}
-if (&Tmp-Integer64-0 != 4123106143410599729) {
+if (&Tmp-uint64-0 != 4123106143410599729) {
test_fail
}
update request {
&Tmp-String-0 := "%(integer:%{Tmp-Cast-Byte})"
&Tmp-String-1 := "%(integer:%{Tmp-Cast-Short})"
- &Tmp-Integer64-2 := "%(integer:%{Tmp-Cast-Ether})"
+ &Tmp-uint64-2 := "%(integer:%{Tmp-Cast-Ether})"
&Tmp-String-3 := "%(integer:%{Tmp-Cast-Integer64})"
&Tmp-String-4 := "%(integer:%{Tmp-Cast-IPv4Prefix})"
}
}
# ethernet
-if (&Tmp-Integer64-2 != 959985468) {
+if (&Tmp-uint64-2 != 959985468) {
test_fail
}
# with the lowest octet of the integer mapping to the right-most
# ethernet octet (in network order)
#
-if (<ether>&Tmp-Integer64-2 != &Tmp-Cast-Ether) {
+if (<ether>&Tmp-uint64-2 != &Tmp-Cast-Ether) {
test_fail
}
map json &Tmp-String-0 {
&Tmp-Integer-0 += '$.my_array[3::-3]'
}
-if ((&Tmp-Integer-0[0] == 3) && (&Tmp-Integer-0[1] == 0) && !&Tmp-Integer-0[2]) {
- test_pass
-} else {
+if ((&Tmp-Integer-0[0] != 3) || (&Tmp-Integer-0[1] != 0) || &Tmp-Integer-0[2]) {
test_fail
}
update request {
}
noop
}
-if (noop || ((&Tmp-Integer-0 == 4294967295) || (&Tmp-Integer-0 == 2147483647))) {
- test_pass
-} else {
+if (!noop && ((&Tmp-Integer-0 != 4294967295) && (&Tmp-Integer-0 != 2147483647))) {
test_fail
}
&Tmp-Integer-0 !* ANY
}
-# 33. Multiple array indicies
+# 33. Signed 64bit integers
+map json &Tmp-String-0 {
+ &Tmp-int64-0 := '$[0]'
+}
+if (&Tmp-int64-0 != 9223372036854775807) {
+ test_fail
+}
+update request {
+ &Tmp-int64-0 !* ANY
+}
+
+# 34. Signed 64bit integers
+map json &Tmp-String-0 {
+ &Tmp-int64-0 := '$[1]'
+}
+if (&Tmp-int64-0 != -9223372036854775807) {
+ test_fail
+}
+update request {
+ &Tmp-int64-0 !* ANY
+}
+
+# 35. Unsigned 64bit integers (not allowed by json so gets truncated)
+map json &Tmp-String-0 {
+ &Tmp-uint64-0 := '$[2]'
+}
+if (&Tmp-uint64-0 != 9223372036854775807) {
+ test_fail
+}
+update request {
+ &Tmp-uint64-0 !* ANY
+}
+
+# 36. Multiple array indicies
map json &Tmp-String-0 {
&Tmp-Signed-0 += '$[3][0,1]'
}
&Tmp-Signed-0 !* ANY
}
-# 34. Path containing dynamic expansion
+# 37. Path containing dynamic expansion
update request {
&Tmp-Integer-2 := 0
}
&Tmp-Integer-0 !* ANY
}
-# 35. An expanded field name with bad chars
+# 38. An expanded field name with bad chars
update request {
&Tmp-String-0 := "\
{\
}"
}
-# 36. Recursive descent with field match
+# 39. Recursive descent with field match
map json &Tmp-String-0 {
&Tmp-String-1 += '$..bool'
}
&Tmp-String-1 !* ANY
}
-# 37. Recursive descent with element match (2nd element in each array)
+# 40. Recursive descent with element match (2nd element in each array)
map json &Tmp-String-0 {
&Tmp-String-1 += '$..[1]'
}
&Tmp-String-1 !* ANY
}
-# 38. Recursive descent with field then element match
+# 41. Recursive descent with field then element match
map json &Tmp-String-0 {
&Tmp-String-1 += '$..my_cats[2]'
}
&Tmp-String-1 !* ANY
}
-#
-# @todo - What's going on here? The input json has an array as
-# element 0, whicj is most definitely not a 64-bit integer.
-#
-if (0) {
-# 39. Unsigned 64bit integers
-map json &Tmp-String-0 {
- &Tmp-Integer64-0 := '$[0]'
-}
-if (&Tmp-Integer64-0 != 9223372036854775807) {
- test_fail
-}
-update request {
- &Tmp-Integer64-0 !* ANY
-}
-
-# 40. Signed 64bit integers (not supported)
-redundant {
- group {
- map json &Tmp-String-0 {
- &Tmp-Integer64-0 := '$[1]'
- }
- }
- ok
-}
-if (fail || &Tmp-Integer64-0) {
- test_fail
-}
-update request {
- &Tmp-Integer64-0 !* ANY
-}
-
-# 41. Signed 64bit integers (not supported)
-redundant {
- group {
- map json &Tmp-String-0 {
- &Tmp-Integer64-0 := '$[1]'
- }
- }
- ok
-}
-if (fail || &Tmp-Integer64-0) {
- test_fail
-}
-update request {
- &Tmp-Integer64-0 !* ANY
-}
-}
-
test_pass
condition <ipaddr>127.0.0.1 == &Filter-Id
match <ipaddr>&Filter-Id == 127.0.0.1
-condition &Tmp-Integer64-0 == &request.Foo-Stuff-Bar
-match &Tmp-Integer64-0 == &Foo-Stuff-Bar
+condition &Tmp-uint64-0 == &request.Foo-Stuff-Bar
+match &Tmp-uint64-0 == &Foo-Stuff-Bar
-condition &Tmp-Integer64-0 == &reply.Foo-Stuff-Bar
-match &Tmp-Integer64-0 == &reply.Foo-Stuff-Bar
+condition &Tmp-uint64-0 == &reply.Foo-Stuff-Bar
+match &Tmp-uint64-0 == &reply.Foo-Stuff-Bar
#
# Casting attributes of different size
#
-condition <ipaddr>&Tmp-Integer64-0 == &Framed-IP-Address
+condition <ipaddr>&Tmp-uint64-0 == &Framed-IP-Address
match ERROR offset 8: Cannot cast type 'uint64' to 'ipaddr'
#
match <ipaddr>&PMIP6-Home-IPv4-HoA == &Framed-IP-Address
# but these are allowed
-condition <ether>&Tmp-Integer64-0 == "%{module: foo}"
-match <ether>&Tmp-Integer64-0 == "%{module: foo}"
+condition <ether>&Tmp-uint64-0 == "%{module: foo}"
+match <ether>&Tmp-uint64-0 == "%{module: foo}"
condition <ipaddr>&Filter-Id == &Framed-IP-Address
match <ipaddr>&Filter-Id == &Framed-IP-Address