match ERROR offset 4: Unexpected text after enum value. Expected operator
#
-# @todo - This is just a bare word comparison?
+# @todo - parsing - This is just a bare word comparison, and should be disallowed?
#
condition (Service-Type == 000-111)
match (Service-Type == (0 - 111))
#
-# @todo - many of these "invalid operator" errors should have additional code added to xlat_expr.c,
+# @todo - parsing - many of these "invalid operator" errors should have additional code added to xlat_expr.c,
# so that it finds out which specific parse problem it is, and gives a better error message.
#
condition (ok FOO handled)
condition !(ok)
match !%{rcode:'ok'}
-#
-# @todo - negation is invalid
-#
condition !!ok
match ERROR offset 2: Double operator is invalid
#
-# @todo - do peephole optimization to get rid of double negation?
+# @todo - peephole - do optimization to get rid of double negation?
#
condition !(!ok)
match !!%{rcode:'ok'}
match (!(&User-Name == &User-Password) || (&Filter-Id == &Reply-Message))
#
-# @todo - this is really for unit_test_attribute to check? Did we parse the whole thing?
+# @todo - parsing - unit_test_attribute should really check if we read the whole string
#
condition ((a == b) || (c == d)))
match ((a == b) || (c == d))
condition "hello" == &reply
match ERROR offset 12: Cannot use list references in condition
-
-#
-# @todo - new expressions do not do normalization or peephole optimizations
-#
condition &User-Name == &User-Password
match (&User-Name == &User-Password)
match (&User-Name == 'bob')
#
-# @todo - this should probably be a parse error, as there is no VALUE named 'bob'
+# @todo - parsing - bare-word bob isn't a valid enum name
#
condition &User-Name == bob
match (&User-Name == bob)
match (&Session-Timeout == 10)
#
-# @todo - no automatic type casting
+# @todo - parsing - no automatic type casting
#
condition &Session-Timeout == '10'
match (&Session-Timeout == '10')
match ERROR offset 10: Failed parsing string as type 'uint32'
#
-# @todo - this should probably be a parse error, as there is no VALUE named 'X'
+# @todo - parsing - there is no enum named "X"
#
condition &NAS-Port == X
match (&NAS-Port == X)
# The string gets parsed as an IP address.
#
-#
-# @todo - maybe the cast is suppressed? or... TBD later
-#
condition &Filter-Id == &Framed-IP-Address
match (&Filter-Id == &Framed-IP-Address)
#
# Parse OIDs into known attributes, where possible.
#
-# @todo - Perhaps this isn't done because the xlat name is taken from the
+# @todo - peephole - Perhaps this isn't done because the xlat name is taken from the
# input, and not from the canonicalized names.
#
condition &26.24757.84.9.5.4 == 0x1a99
#
# Sometimes the attribute/condition parser needs to fallback to bare words
#
-# @todo - this is likely treating the LHS as an enum which is impossible here
+# @todo - bare word - this is likely treating the LHS as an enum which is impossible here
#
condition request.Foo == 'request.Foo'
match (request.Foo == 'request.Foo')
#match ERROR offset 13: Unexpected text after attribute reference
#
-# @todo - this is wrong
+# @todo - bare word - this is wrong
#
condition 'request.Foo+d' == &request.Foo+Bar
match ('request.Foo+d' == (&request.Foo + Bar))
# 'Unknown' attributes which are defined in the main dictionary
# should be resolved to their real names.
#
-# @todo - nope
+# @todo - peephole - resolve it and change its name
#
condition &1 == 0x616263
match (&1 == 0x616263)
condition (&reply.)
match &reply.
-#
-# Expansions of environment variables
-# and empty strings
-#
-# @todo - disabled due to moving cf_expand_variables() from
-# the condition parser to cf_file.c. The new xlat expression parser
-# will *not* optimize this at parse time, but *will* optimize
-# this at purification time.
-#
-#condition ("$ENV{SOMETHING_OR_OTHER}" == '')
-#match true
-
#
# Attributes with a protocol namespace
#
#
# More short-circuit evaluations
#
-# @todo - optimise at parse time
+# @todo - peephole - optimise at parse time
#
condition (&User-Name == "bob") && (false)
match ((&User-Name == "bob") && false)
# conditional filters.
#
# And we do not (yet) allow for filters on leaf attributes. See
-# @todo in tmpl_attr_parse_filter(()
+#
+# @todo - feature - allowe expressions in tmpl_attr_parse_filter(()
#
condition &User-Name[&User-Name == 'bar'] == "foo"
match ERROR offset 12: Invalid filter - cannot use filter on leaf attributes
#
# which is a loop that returns &TLS-Certificate.
#
-# @todo - this error is misleading and wrong.
+# @todo - feature - this error is misleading and wrong.
#
condition &TLS-Certificate[&Common-Name == 'user@example.com'] == bar
match ERROR offset 1: Cannot use list references in condition
#
# Fully specified paths.
#
-# @todo - we arguably want to force nesting on these attributes? Or change the nesting when printed?
+# @todo - future - we arguably want to force nesting on these attributes? Or change the nesting when printed?
#
read_file files/cisco_avpair.txt
match User-Name = "bob", User-Password = "hello", Vendor-Specific.Cisco.AVPair = "1", Vendor-Specific.Cisco.AVPair += "2", Vendor-Specific.Cisco.AVPair += "3", Vendor-Specific.Cisco.AVPair += "4"
encode-pair Unit-TLV = { Test-Enum-Integer64 = one }
match fe 0c 0c 0a 00 00 00 00 00 00 00 01
-#
-# @todo - find out why this isn't an enum lookup :(
-#
decode-pair -
match Unit-TLV = { Test-Enum-Integer64 = one }
decode-pair -
match Unit-TLV = { Delta-MSec = 5 }
-#
-# @todo - not yet converted to make nested TLVs!
-#
pair Unit-TLV.Delta-Sec = 10
match Unit-TLV.Delta-Sec = 10
encode-pair 26.6809.1.2 = 0xabcdef
match 1a 0d 00 00 1a 99 01 07 02 05 ab cd ef
-#
-# @todo - This should be Vendor-Specific.6809.1.2 = 0xabcdef
-#
decode-pair -
match Vendor-Specific.6809.1 = { 2 = 0xabcdef }
encode-pair 26.6809.1.2.3 = 0xabcdef
match 1a 0f 00 00 1a 99 01 09 02 07 03 05 ab cd ef
-#
-# @todo - This should be Vendor-Specific.6809.1 = { 2 = { 3 = 0xabcdef } }
-#
decode-pair -
match Vendor-Specific.6809.1 = { 2 = { 3 = 0xabcdef } }
xlat %(debug: 5)
match %(debug: 5)
-#
-# @todo - debug takes an integer, and this is wrong.
-#
xlat %(debug: "foo")
match %(debug: "foo")
#
# The second argument should be an integer.
#
-# @todo - we don't currently track string offsets for intermediate nodes,
+# @todo - parsing - we don't currently track string offsets for intermediate nodes,
# so the "offset 23" is wrong. It also doesn't say *which* string is wrong. We'll fix that later.
#
xlat %(rpad:&User-Name foo x)
match true
#
-# @todo - add a flag which says to parse the FULL thing, or only parse part of it?
+# @todo - unit_test_attribute - add a flag which says to parse the FULL thing, or only parse part of it?
#
xlat_purify ((&User-Name == &Filter-Id) || (&Reply-Message == &User-Password)))
match Passed in 67 characters, but only parsed 66 characters
# We can automatically promote things as needed. But if the
# user forces incompatible types, then that's an error.
#
-# @todo - perhaps better errors for casts?
+# @todo - parsing - better errors for casts
#
xlat_purify <ipaddr>&Filter-Id == <blerg>&Framed-IP-Address
match ERROR offset 23: No operand found. Expected &ref, literal, 'quoted literal', "%{expansion}", or enum value
# Automatic type inference means this is fine
#
-# @todo - in binary resolve, cast the RHS to the type of the LHS.
+# @todo - peephole - resolve the RHS to the type of the LHS
#
xlat_purify &Session-Timeout == '10'
match (&Session-Timeout == '10')
match ERROR offset 10: Failed parsing string as type 'uint32'
#
-# @todo - resolution is delayed, so we don't know where in the input
+# @todo - parsing - resolution is delayed, so we don't know where in the input
# string the RHS is.
#
xlat_purify &NAS-Port == X
xlat_purify true
match true
-# @todo - for conditions, this should evaluate to "true". However, this evaluation
+# @todo - parsing - for conditions, this should evaluate to "true". However, this evaluation
# only occurs in the condition code, and not in the xlat code!
xlat_purify 1
match 1
xlat_purify ('a')
match 'a'
-#
-# @todo - modules && return codes.
-#
-
#xlat_purify (a)
#match ERROR offset 1: Expected a module return code
# This used to be expr, but expr isn't a builtin, so it failed...
#
-# @todo - arguably this is a failed thing, we should get:
+# @todo - peephole - arguably this is a failed thing, we should get:
#
# ERROR: Failed casting 0x002ade8665c69219ca16bd108d92c8d5 to data type uint32: Invalid cast from octets to uint32. Source length 16 is greater than destination type size 4
#
#
# Parse OIDs into known attributes, where possible.
#
-# @todo - whoops, resolve it
+# @todo - peephole - resolve the unknown attribute to something real!
xlat_purify &26.24757.84.9.5.4 == 0x1a99
match (&26.24757.84.9.5.4 == 0x1a99)
#match &Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Port == 6809
#
# 'Unknown' attributes which are defined in the main dictionary
# should be resolved to their real names.
-# @todo - resolve!
+# @todo - peephole - resolve it to something real
xlat_purify &1 == 0x616263
match (&1 == 0x616263)
#match (&User-Name == 'abc')
-# @todo - resolve!
+# @todo - peephole - resolve it to something real
#xlat_purify &26.11344.1 == 0x7f000001
#match &Vendor-Specific.FreeRADIUS.Proxied-To == 127.0.0.1
match true
-# @todo - fix up cast!
-#xlat_purify <ipv4prefix>192.168.0.0/16 > 192.168.1.2
-#match true
+xlat_purify <ipv4prefix>192.168.0.0/16 > 192.168.1.2
+match true
xlat_purify <ipv4prefix>&NAS-IP-Address == 192.168.0.0/24
match ((ipv4prefix)&NAS-IP-Address == 192.168.0.0/24)
#
# This is allowed and means "the list is not empty"
#
-# @todo - we need a "parse as condition" flag!
xlat_purify (&reply)
match &reply
#
# Attributes with a protocol namespace
#
-# @todo - if the explicit namespace is the same as the implicit one, we can omit
+# @todo - normalization - if the explicit namespace is the same as the implicit one, we can omit
# the explicit one? But this is largely due to the printing fixes, where we just
# print the tmpl name as-is.
xlat_purify &radius.User-Name == 'bob'
xlat_purify 1 || 2 || (&User-Name == "bob")
match 1
-#
-# @todo - this is arguably incorrect. It could return
-# "true", or "1".
-#
xlat_purify (&User-Name == "bob") || 1 || 2
match 1
match true
count
-match 330
+match 332
xlat_purify (&User-Name == /foo/)
match ERROR offset 16: Unexpected regular expression
-# @todo - this should be allowed?
xlat_purify &User-Name =~ &Filter-Id
match ERROR offset 15: Expected regular expression
match true
#
-# @todo - for exec, xlat, etc., if we're doing an existence check of
+# @todo - peephole - for exec, xlat, etc., if we're doing an existence check of
# string / octets, then the check is for "length>0", NOT for parsing
# the contents of the data type.
#