proto radius
proto-dictionary radius
load-dictionary dictionary.test
fuzzer-out radius

encode-pair Extended-Attribute-1 = { Unit-Ext-241-Struct2 = { Unit-Struct2-Int1 = 1, Unit-Struct2-Short = 4 } }
match f1 09 f8 00 00 00 01 00 04

#
#  Structs in RADIUS
#
encode-pair Extended-Attribute-1.Unit-Ext-241-Struct1.Unit-Struct1-Int1 = 1, Extended-Attribute-1.Unit-Ext-241-Struct1.Unit-Struct1-Int2 = 2, Extended-Attribute-1.Unit-Ext-241-Struct1.Unit-Struct1-Short = 4, Extended-Attribute-1.Unit-Ext-241-Struct1.Unit-Struct1-String = "foo"
match f1 10 f7 00 00 00 01 00 00 00 02 00 04 66 6f 6f

decode-pair -
match Extended-Attribute-1 = { Unit-Ext-241-Struct1 = { Unit-Struct1-Int1 = 1, Unit-Struct1-Int2 = 2, Unit-Struct1-Short = 4, Unit-Struct1-String = "foo" } }

encode-pair -
match f1 10 f7 00 00 00 01 00 00 00 02 00 04 66 6f 6f

pair Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-Int1 = 1, Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-Short = 4, Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-TLV.Unit-Struct2-TLV-Int1 = 6, Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-TLV.Unit-Struct2-TLV-Int2 = 7, Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-TLV.Unit-Struct2-TLV-String = "foo"
match Extended-Attribute-1 = { Unit-Ext-241-Struct2 = { Unit-Struct2-Int1 = 1, Unit-Struct2-Short = 4, Unit-Struct2-TLV = { Unit-Struct2-TLV-Int1 = 6, Unit-Struct2-TLV-Int2 = 7, Unit-Struct2-TLV-String = "foo" } } }

encode-pair Extended-Attribute-1 = { Unit-Ext-241-Struct2 = { Unit-Struct2-Int1 = 1, Unit-Struct2-Short = 4 } }
match f1 09 f8 00 00 00 01 00 04

encode-pair Extended-Attribute-1 = { Unit-Ext-241-Struct2 = { Unit-Struct2-Int1 = 1, Unit-Struct2-Short = 4, Unit-Struct2-TLV = { Unit-Struct2-TLV-Int1 = 6, Unit-Struct2-TLV-Int2 = 7, Unit-Struct2-TLV-String = "foo" } } }
match f1 1a f8 00 00 00 01 00 04 01 06 00 00 00 06 02 06 00 00 00 07 03 05 66 6f 6f

#
# And structs where the last part is a TLV.
#
#  Note that we don't encode the TLV itself, only the children.
#
encode-pair Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-Int1 = 1, Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-Short = 4, Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-TLV.Unit-Struct2-TLV-Int1 = 6, Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-TLV.Unit-Struct2-TLV-Int2 = 7, Extended-Attribute-1.Unit-Ext-241-Struct2.Unit-Struct2-TLV.Unit-Struct2-TLV-String = "foo"
match f1 1a f8 00 00 00 01 00 04 01 06 00 00 00 06 02 06 00 00 00 07 03 05 66 6f 6f

decode-pair -
match Extended-Attribute-1 = { Unit-Ext-241-Struct2 = { Unit-Struct2-Int1 = 1, Unit-Struct2-Short = 4, Unit-Struct2-TLV = { Unit-Struct2-TLV-Int1 = 6, Unit-Struct2-TLV-Int2 = 7, Unit-Struct2-TLV-String = "foo" } } }

encode-pair -
match f1 1a f8 00 00 00 01 00 04 01 06 00 00 00 06 02 06 00 00 00 07 03 05 66 6f 6f

encode-pair Extended-Attribute-1.Unit-Ext-241-Struct3.Unit-Struct3-Int = 1, Extended-Attribute-1.Unit-Ext-241-Struct3.Unit-Struct3-TLV.Unit-Struct3a.Unit-Struct3a-Ipaddr1 = 127.0.0.1, Extended-Attribute-1.Unit-Ext-241-Struct3.Unit-Struct3-TLV.Unit-Struct3a.Unit-Struct3a-Ipaddr2 = 8.8.8.8
match f1 11 f9 00 00 00 01 01 0a 7f 00 00 01 08 08 08 08

decode-pair -
match Extended-Attribute-1 = { Unit-Ext-241-Struct3 = { Unit-Struct3-Int = 1, Unit-Struct3-TLV = { Unit-Struct3a = { Unit-Struct3a-Ipaddr1 = 127.0.0.1, Unit-Struct3a-Ipaddr2 = 8.8.8.8 } } } }

#
#  Fixed size struct
#
encode-pair Extended-Attribute-1.Unit-Ext-241-Struct4.Unit-Struct4-Int1 = 1, Extended-Attribute-1.Unit-Ext-241-Struct4.Unit-Struct4-Int2 = 2, Extended-Attribute-1.Unit-Ext-241-Struct4.Unit-Struct4-Short = 4
match f1 0d fa 00 00 00 01 00 00 00 02 00 04

decode-pair -
match Extended-Attribute-1 = { Unit-Ext-241-Struct4 = { Unit-Struct4-Int1 = 1, Unit-Struct4-Int2 = 2, Unit-Struct4-Short = 4 } }

#
#  Wrong-sized struct (last field missing), it just decodes what it can.
#
decode-pair f1 0b fa 00 00 00 01 00 00 00 02
match Extended-Attribute-1 = { Unit-Ext-241-Struct4 = { Unit-Struct4-Int1 = 1, Unit-Struct4-Int2 = 2 } }

#
#  Wrong-sized struct (last two fields missing), it just decodes what it can.
#
decode-pair f1 07 fa 00 00 00 01
match Extended-Attribute-1 = { Unit-Ext-241-Struct4 = { Unit-Struct4-Int1 = 1 } }

#
#  Wrong-sized struct (data is too long), we ignore the extra data.
#
decode-pair f1 0e fa 00 00 00 01 00 00 00 02 00 04 00
match Extended-Attribute-1 = { Unit-Ext-241-Struct4 = { Unit-Struct4-Int1 = 1, Unit-Struct4-Int2 = 2, Unit-Struct4-Short = 4 } }

decode-pair ff 09 01 00 00 1a 99 05 06
match Test-Struct = { Key-Field = ::Sub-Struct, Filler = 6809, Key-Field.Sub-Struct = { Nested-Sub1 = 5, Nested-Sub2 = 6 } }

encode-pair -
match ff 09 01 00 00 1a 99 05 06

#
#  Key field with unknown value.  The rest of the struct gets decoded
#  as an unknown attribute.
#
decode-pair ff 0d 02 00 00 1a 99 ff fe fd fc fb fa
match Test-Struct = { Key-Field = 2, Filler = 6809, raw.Key-Field.0 = 0xfffefdfcfbfa }

encode-pair -
match ff 0d 02 00 00 1a 99 ff fe fd fc fb fa

count
match 46
