condition (ipaddr)127.0.0.1 == &Filter-Id
match (127.0.0.1 == &Filter-Id)
-condition &Tmp-uint64-0 == &request.Foo-Stuff-Bar
-match (&Tmp-uint64-0 == &request.Foo-Stuff-Bar)
+condition &Acct-Input-Octets64 == &request.Foo-Stuff-Bar
+match (&Acct-Input-Octets64 == &request.Foo-Stuff-Bar)
-condition &Tmp-uint64-0 == &reply.Foo-Stuff-Bar
-match (&Tmp-uint64-0 == &reply.Foo-Stuff-Bar)
+condition &Acct-Input-Octets64 == &reply.Foo-Stuff-Bar
+match (&Acct-Input-Octets64 == &reply.Foo-Stuff-Bar)
#
# Casting attributes of different size
#
-condition (ipaddr)&Tmp-uint64-0 == &Framed-IP-Address
+condition (ipaddr)&Acct-Input-Octets64 == &Framed-IP-Address
match ERROR offset 9: Cannot cast type 'uint64' to 'ipaddr'
#
match ((ipaddr)&PMIP6-Home-IPv4-HoA == &Framed-IP-Address)
# but these are allowed
-condition (ether)&Tmp-uint64-0 == "%interpreter('foo')"
-match ((ether)&Tmp-uint64-0 == %cast(string, "%interpreter('foo')"))
+condition (ether)&Acct-Input-Octets64 == "%interpreter('foo')"
+match ((ether)&Acct-Input-Octets64 == %cast(string, "%interpreter('foo')"))
condition (ipaddr)&Filter-Id == &Framed-IP-Address
match ((ipaddr)&Filter-Id == &Framed-IP-Address)
proto-dictionary dhcpv6
tmpl-rules allow_unresolved=no allow_unknown=no
-condition &IA-NA.Options.Tmp-String-0 == 'foo'
-match (&IA-NA.Options.Tmp-String-0 == 'foo')
+condition &IA-NA.Options.Stripped-User-Name == 'foo'
+match (&IA-NA.Options.Stripped-User-Name == 'foo')
# Seen in the wild. Array subscript on child produced an error
condition &IA-NA.Options.IA-Addr[0].IPv6-Address == ::
#
# Non-integer types get cast to string.
#
-condition &Tmp-Integer-0 =~ /%{Tmp-Integer-0}/
-match <string>&Tmp-Integer-0 =~ /%{Tmp-Integer-0}/
+condition &NAS-Port =~ /%{NAS-Port}/
+match <string>&NAS-Port =~ /%{NAS-Port}/
#
# Cannot add a bad cast
#
-condition <integer>&Tmp-String-0 =~ /foo/
+condition <integer>&Filter-Id =~ /foo/
match ERROR offset 10: Casts cannot be used with regular expressions
-condition &Tmp-String-0 =~ <integer>/foo/
+condition &Filter-Id =~ <integer>/foo/
match ERROR offset 28: Casts cannot be used with regular expressions
#
# The BFD packet is exactly the same, but we also have a 3 octet string "foo", which is encoded via the internal dictionary, after the packet.
#
-encode-proto Packet = { version = 1, diagnostic = none, state = up, poll = false, final = false, control-plane-independent = false, auth-present = false, demand = false, multipoint = false, detect-multi = 3, my-discriminator = 0xdeadbeef, your-discriminator = 0x21126809, desired-min-tx-interval = 31us, required-min-tx-interval = 127us, required-min-echo-interval = 255us }, Additional-Data = { Tmp-String-0 = "foo" }
-match 20 c0 03 18 de ad be ef 21 12 68 09 00 00 00 1f 00 00 00 7f 00 00 00 ff 21 40 06 ae 03 66 6f 6f
+encode-proto Packet = { version = 1, diagnostic = none, state = up, poll = false, final = false, control-plane-independent = false, auth-present = false, demand = false, multipoint = false, detect-multi = 3, my-discriminator = 0xdeadbeef, your-discriminator = 0x21126809, desired-min-tx-interval = 31us, required-min-tx-interval = 127us, required-min-echo-interval = 255us }, Additional-Data = { Stripped-User-Name = "foo" }
+match 20 c0 03 18 de ad be ef 21 12 68 09 00 00 00 1f 00 00 00 7f 00 00 00 ff 21 40 03 e8 03 66 6f 6f
decode-proto -
-match Packet-Type = Up, Packet = { version = 1, diagnostic = none, state = up, poll = no, final = no, control-plane-independent = no, auth-present = no, demand = no, multipoint = no, detect-multi = 3, length = 24, my-discriminator = 3735928559, your-discriminator = 554854409, desired-min-tx-interval = 31, required-min-tx-interval = 127, required-min-echo-interval = 255 }, Additional-Data = { Tmp-String-0 = "foo" }
+match Packet-Type = Up, Packet = { version = 1, diagnostic = none, state = up, poll = no, final = no, control-plane-independent = no, auth-present = no, demand = no, multipoint = no, detect-multi = 3, length = 24, my-discriminator = 3735928559, your-discriminator = 554854409, desired-min-tx-interval = 31, required-min-tx-interval = 127, required-min-echo-interval = 255 }, Additional-Data = { Stripped-User-Name = "foo" }
count
match 11
match ERROR offset 44: Unexpected text after enum value. Expected operator
# and text immediately after a variable expansion
-xlat_argv echo hello %{Tmp-String-0}:1234 world
-match [0]{ echo }, [1]{ hello }, [2]{ %{Tmp-String-0}:1234 }, [3]{ world }
+xlat_argv echo hello %{Filter-Id}:1234 world
+match [0]{ echo }, [1]{ hello }, [2]{ %{Filter-Id}:1234 }, [3]{ world }
xlat %debug(5)
match %debug(5)
xlat_purify (ipaddr)127.0.0.1 == &Filter-Id
match (127.0.0.1 == &Filter-Id)
-xlat_purify &Tmp-uint64-0 == &request.Tmp-String-0
-match (&Tmp-uint64-0 == &request.Tmp-String-0)
+xlat_purify &Acct-Input-Octets64 == &request.Callback-Id
+match (&Acct-Input-Octets64 == &request.Callback-Id)
-xlat_purify &Tmp-uint64-0 == &reply.Tmp-String-0
-match (&Tmp-uint64-0 == &reply.Tmp-String-0)
+xlat_purify &Acct-Input-Octets64 == &reply.Callback-Id
+match (&Acct-Input-Octets64 == &reply.Callback-Id)
#
# Casting attributes of different size
#
-xlat_purify (ipaddr)&Tmp-uint64-0 == &Framed-IP-Address
+xlat_purify (ipaddr)&Acct-Input-Octets64 == &Framed-IP-Address
match ERROR offset 9: Cannot cast type 'uint64' to 'ipaddr'
#
match ((ipaddr)&PMIP6-Home-IPv4-HoA == &Framed-IP-Address)
# but these are allowed
-xlat_purify (ether)&Tmp-uint64-0 == "%interpreter('foo')"
-match ((ether)&Tmp-uint64-0 == %cast(string, "%interpreter('foo')"))
+xlat_purify (ether)&Acct-Input-Octets64 == "%interpreter('foo')"
+match ((ether)&Acct-Input-Octets64 == %cast(string, "%interpreter('foo')"))
xlat_purify (ipaddr)&Filter-Id == &Framed-IP-Address
match ((ipaddr)&Filter-Id == &Framed-IP-Address)
match (&Acct-Input-Octets > &Session-Timeout)
# Separate types aren't optimized
-xlat_purify &Tmp-uint64-0 > &Session-Timeout
-match (&Tmp-uint64-0 > &Session-Timeout)
+xlat_purify &Acct-Input-Octets64 > &Session-Timeout
+match (&Acct-Input-Octets64 > &Session-Timeout)
#
# Parse OIDs into known attributes, where possible.
xlat_purify &User-Name =~ /^([^\\]*)\\(.*)$/
match (&User-Name =~ /^([^\\]*)\\(.*)$/)
-xlat_purify &Tmp-Integer-0 =~ /%{Tmp-Integer-1} foo/
-match (&Tmp-Integer-0 =~ /%{Tmp-Integer-1} foo/)
+xlat_purify &NAS-Port =~ /%{Login-TCP-Port} foo/
+match (&NAS-Port =~ /%{Login-TCP-Port} foo/)
#
# If they're dumb enough to add a cast, then it will be just cast again
# to "string" before the regular expression is evaluated.
#
-xlat_purify (integer)&Tmp-String-0 =~ /foo/
-match ((uint32)&Tmp-String-0 =~ /foo/)
+xlat_purify (integer)&Filter-Id =~ /foo/
+match ((uint32)&Filter-Id =~ /foo/)
-xlat_purify &Tmp-String-0 =~ <integer>/foo/
-match ERROR offset 18: Expected regular expression
+xlat_purify &Filter-Id =~ <integer>/foo/
+match ERROR offset 15: Expected regular expression
xlat_expr %{33}
match ERROR offset 3: Invalid regex reference. Must be in range 0-32