FR_PROTO_TRACE("decode context %s -> %s", parent->name, da->name);
- return fr_pair_tlvs_from_network(ctx, out, da, data + 4, data_len - 4, decode_ctx, decode_option, NULL, false);
+ return fr_pair_tlvs_from_network(ctx, out, da, data + 4, data_len - 4, decode_ctx, decode_option, NULL, true);
}
static ssize_t decode_option(TALLOC_CTX *ctx, fr_pair_list_t *out,
slen = decode_vsa(ctx, out, da, data + 4, len, decode_ctx);
} else if (da->type == FR_TYPE_TLV) {
- slen = fr_pair_tlvs_from_network(ctx, out, da, data + 4, len, decode_ctx, decode_option, NULL, false);
+ slen = fr_pair_tlvs_from_network(ctx, out, da, data + 4, len, decode_ctx, decode_option, NULL, true);
} else {
slen = decode_value(ctx, out, da, data + 4, len, decode_ctx);
proto-dictionary dhcpv6
fuzzer-out dhcpv6
-decode-proto 0c0126058600000680000000000000000000fe80000000000000025056fffea353fe000900c40c0000000000000000000000000000000000fe80000000000000025056fffea353fe0012001c4c41424f4c54322065746820312f312f30352f30312f32382f312f310009007e011141d70001000e0001000126b1b7f1005056a353fe0012001c4c41424f4c54322065746820312f312f30352f30312f32382f312f310006000200180008000200000003002856a353fe00000e1000001518000500182605860000064000000000000000000100001c2000002a300019000c56a353fe00000e1000001518002500120000197f0001000126b1b7f1005056a353fe0011002a0000197f0001000a4c41424f4c54322d6e610002000a4c41424f4c54322d7064000300013f0004000140
-match Packet-Type = Relay-Forward, Hop-Count = 1, Relay-Link-Address = 2605:8600:6:8000::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Relay-Message = { Packet-Type = Relay-Forward, Hop-Count = 0, Relay-Link-Address = ::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Relay-Message = { Packet-Type = Solicit, Transaction-ID = 0x1141d7, Client-ID = { DUID = LLT, DUID.LLT = { Hardware-Type = Ethernet, Time = "Jul 27 2020 16:06:09 UTC", Hardware-Type.Ethernet = { Address = 00:50:56:a3:53:fe } } }, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Option-Request = Domain-List, Elapsed-Time = 0, IA-NA = { IAID = 1453544446, T1 = 3600, T2 = 5400, Options = { IA-Addr = { IPv6-Address = 2605:8600:6:4000::1, Preferred-Lifetime = 7200, Valid-Lifetime = 10800 } } }, IA-PD = { IAID = 1453544446, T1 = 3600, T2 = 5400 } } }, Relay-Agent-Remote-ID = { Vendor = 6527, Value = 0x0001000126b1b7f1005056a353fe }, Vendor-Opts.Nokia-SR.WAN-Pool = "LABOLT2-na", Vendor-Opts.Nokia-SR.PFX-Pool = "LABOLT2-pd", Vendor-Opts.Nokia-SR.PFX-Len = 63, Vendor-Opts.Nokia-SR.Reserved-NA-Len = 64
+encode-pair Vendor-Opts.Nokia-SR = { WAN-Pool = "LABOLT2-na", PFX-Pool = "LABOLT2-pd", PFX-Len = 63, Reserved-NA-Len = 64 }
+match 00 11 00 2a 00 00 19 7f 00 01 00 0a 4c 41 42 4f 4c 54 32 2d 6e 61 00 02 00 0a 4c 41 42 4f 4c 54 32 2d 70 64 00 03 00 01 3f 00 04 00 01 40
+
+decode-pair -
+match Vendor-Opts.Nokia-SR = { WAN-Pool = "LABOLT2-na", PFX-Pool = "LABOLT2-pd", PFX-Len = 63, Reserved-NA-Len = 64 }
+
+encode-pair Vendor-Opts.Nokia-SR = { WAN-Pool = "LABOLT2-na" }, Vendor-Opts.Nokia-SR = { PFX-Pool = "LABOLT2-pd" }, Vendor-Opts.Nokia-SR = { PFX-Len = 63 }, Vendor-Opts.Nokia-SR = { Reserved-NA-Len = 64 }
+match 00 11 00 12 00 00 19 7f 00 01 00 0a 4c 41 42 4f 4c 54 32 2d 6e 61 00 11 00 12 00 00 19 7f 00 02 00 0a 4c 41 42 4f 4c 54 32 2d 70 64 00 11 00 09 00 00 19 7f 00 03 00 01 3f 00 11 00 09 00 00 19 7f 00 04 00 01 40
+
+#
+# @todo - the Nokia vendor opts should be decoded into the parent Vendor-Opts
+#
+decode-pair -
+match Vendor-Opts.Nokia-SR = { WAN-Pool = "LABOLT2-na" }, Vendor-Opts.Nokia-SR = { PFX-Pool = "LABOLT2-pd" }, Vendor-Opts.Nokia-SR = { PFX-Len = 63 }, Vendor-Opts.Nokia-SR = { Reserved-NA-Len = 64 }
+
+decode-proto 0c 01 26 05 86 00 00 06 80 00 00 00 00 00 00 00 00 00 fe 80 00 00 00 00 00 00 02 50 56 ff fe a3 53 fe 00 09 00 c4 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fe 80 00 00 00 00 00 00 02 50 56 ff fe a3 53 fe 00 12 00 1c 4c 41 42 4f 4c 54 32 20 65 74 68 20 31 2f 31 2f 30 35 2f 30 31 2f 32 38 2f 31 2f 31 00 09 00 7e 01 11 41 d7 00 01 00 0e 00 01 00 01 26 b1 b7 f1 00 50 56 a3 53 fe 00 12 00 1c 4c 41 42 4f 4c 54 32 20 65 74 68 20 31 2f 31 2f 30 35 2f 30 31 2f 32 38 2f 31 2f 31 00 06 00 02 00 18 00 08 00 02 00 00 00 03 00 28 56 a3 53 fe 00 00 0e 10 00 00 15 18 00 05 00 18 26 05 86 00 00 06 40 00 00 00 00 00 00 00 00 01 00 00 1c 20 00 00 2a 30 00 19 00 0c 56 a3 53 fe 00 00 0e 10 00 00 15 18 00 25 00 12 00 00 19 7f 00 01 00 01 26 b1 b7 f1 00 50 56 a3 53 fe 00 11 00 2a 00 00 19 7f 00 01 00 0a 4c 41 42 4f 4c 54 32 2d 6e 61 00 02 00 0a 4c 41 42 4f 4c 54 32 2d 70 64 00 03 00 01 3f 00 04 00 01 40
+match Packet-Type = Relay-Forward, Hop-Count = 1, Relay-Link-Address = 2605:8600:6:8000::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Relay-Message = { Packet-Type = Relay-Forward, Hop-Count = 0, Relay-Link-Address = ::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Relay-Message = { Packet-Type = Solicit, Transaction-ID = 0x1141d7, Client-ID = { DUID = LLT, DUID.LLT = { Hardware-Type = Ethernet, Time = "Jul 27 2020 16:06:09 UTC", Hardware-Type.Ethernet = { Address = 00:50:56:a3:53:fe } } }, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Option-Request = Domain-List, Elapsed-Time = 0, IA-NA = { IAID = 1453544446, T1 = 3600, T2 = 5400, Options = { IA-Addr = { IPv6-Address = 2605:8600:6:4000::1, Preferred-Lifetime = 7200, Valid-Lifetime = 10800 } } }, IA-PD = { IAID = 1453544446, T1 = 3600, T2 = 5400 } } }, Relay-Agent-Remote-ID = { Vendor = 6527, Value = 0x0001000126b1b7f1005056a353fe }, Vendor-Opts.Nokia-SR = { WAN-Pool = "LABOLT2-na", PFX-Pool = "LABOLT2-pd", PFX-Len = 63, Reserved-NA-Len = 64 }
+
+#
+# @todo - encoding the above attributes results not in the input hex string, but the subsequent one. The Nokia-SR options are encoded differently.
+# instead of encoding them all in one DHCPv6 option, they are encoded as separate ones.
+#
+#encode-proto -
+#match 0c 01 26 05 86 00 00 06 80 00 00 00 00 00 00 00 00 00 fe 80 00 00 00 00 00 00 02 50 56 ff fe a3 53 fe 00 09 00 c4 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fe 80 00 00 00 00 00 00 02 50 56 ff fe a3 53 fe 00 12 00 1c 4c 41 42 4f 4c 54 32 20 65 74 68 20 31 2f 31 2f 30 35 2f 30 31 2f 32 38 2f 31 2f 31 00 09 00 7e 01 11 41 d7 00 01 00 0e 00 01 00 01 26 b1 b7 f1 00 50 56 a3 53 fe 00 12 00 1c 4c 41 42 4f 4c 54 32 20 65 74 68 20 31 2f 31 2f 30 35 2f 30 31 2f 32 38 2f 31 2f 31 00 06 00 02 00 18 00 08 00 02 00 00 00 03 00 28 56 a3 53 fe 00 00 0e 10 00 00 15 18 00 05 00 18 26 05 86 00 00 06 40 00 00 00 00 00 00 00 00 01 00 00 1c 20 00 00 2a 30 00 19 00 0c 56 a3 53 fe 00 00 0e 10 00 00 15 18 00 25 00 12 00 00 19 7f 00 01 00 01 26 b1 b7 f1 00 50 56 a3 53 fe 00 11 00 2a 00 00 19 7f 00 01 00 0a 4c 41 42 4f 4c 54 32 2d 6e 61 00 02 00 0a 4c 41 42 4f 4c 54 32 2d 70 64 00 03 00 01 3f 00 04 00 01 40
+
+decode-proto 0c 01 26 05 86 00 00 06 80 00 00 00 00 00 00 00 00 00 fe 80 00 00 00 00 00 00 02 50 56 ff fe a3 53 fe 00 09 00 c4 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fe 80 00 00 00 00 00 00 02 50 56 ff fe a3 53 fe 00 12 00 1c 4c 41 42 4f 4c 54 32 20 65 74 68 20 31 2f 31 2f 30 35 2f 30 31 2f 32 38 2f 31 2f 31 00 09 00 7e 01 11 41 d7 00 01 00 0e 00 01 00 01 26 b1 b7 f1 00 50 56 a3 53 fe 00 12 00 1c 4c 41 42 4f 4c 54 32 20 65 74 68 20 31 2f 31 2f 30 35 2f 30 31 2f 32 38 2f 31 2f 31 00 06 00 02 00 18 00 08 00 02 00 00 00 03 00 28 56 a3 53 fe 00 00 0e 10 00 00 15 18 00 05 00 18 26 05 86 00 00 06 40 00 00 00 00 00 00 00 00 01 00 00 1c 20 00 00 2a 30 00 19 00 0c 56 a3 53 fe 00 00 0e 10 00 00 15 18 00 25 00 12 00 00 19 7f 00 01 00 01 26 b1 b7 f1 00 50 56 a3 53 fe 00 11 00 12 00 00 19 7f 00 01 00 0a 4c 41 42 4f 4c 54 32 2d 6e 61 00 11 00 12 00 00 19 7f 00 02 00 0a 4c 41 42 4f 4c 54 32 2d 70 64 00 11 00 09 00 00 19 7f 00 03 00 01 3f 00 11 00 09 00 00 19 7f 00 04 00 01 40
+match Packet-Type = Relay-Forward, Hop-Count = 1, Relay-Link-Address = 2605:8600:6:8000::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Relay-Message = { Packet-Type = Relay-Forward, Hop-Count = 0, Relay-Link-Address = ::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Relay-Message = { Packet-Type = Solicit, Transaction-ID = 0x1141d7, Client-ID = { DUID = LLT, DUID.LLT = { Hardware-Type = Ethernet, Time = "Jul 27 2020 16:06:09 UTC", Hardware-Type.Ethernet = { Address = 00:50:56:a3:53:fe } } }, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Option-Request = Domain-List, Elapsed-Time = 0, IA-NA = { IAID = 1453544446, T1 = 3600, T2 = 5400, Options = { IA-Addr = { IPv6-Address = 2605:8600:6:4000::1, Preferred-Lifetime = 7200, Valid-Lifetime = 10800 } } }, IA-PD = { IAID = 1453544446, T1 = 3600, T2 = 5400 } } }, Relay-Agent-Remote-ID = { Vendor = 6527, Value = 0x0001000126b1b7f1005056a353fe }, Vendor-Opts.Nokia-SR = { WAN-Pool = "LABOLT2-na" }, Vendor-Opts.Nokia-SR = { PFX-Pool = "LABOLT2-pd" }, Vendor-Opts.Nokia-SR = { PFX-Len = 63 }, Vendor-Opts.Nokia-SR = { Reserved-NA-Len = 64 }
encode-proto -
match 0c 01 26 05 86 00 00 06 80 00 00 00 00 00 00 00 00 00 fe 80 00 00 00 00 00 00 02 50 56 ff fe a3 53 fe 00 09 00 c4 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fe 80 00 00 00 00 00 00 02 50 56 ff fe a3 53 fe 00 12 00 1c 4c 41 42 4f 4c 54 32 20 65 74 68 20 31 2f 31 2f 30 35 2f 30 31 2f 32 38 2f 31 2f 31 00 09 00 7e 01 11 41 d7 00 01 00 0e 00 01 00 01 26 b1 b7 f1 00 50 56 a3 53 fe 00 12 00 1c 4c 41 42 4f 4c 54 32 20 65 74 68 20 31 2f 31 2f 30 35 2f 30 31 2f 32 38 2f 31 2f 31 00 06 00 02 00 18 00 08 00 02 00 00 00 03 00 28 56 a3 53 fe 00 00 0e 10 00 00 15 18 00 05 00 18 26 05 86 00 00 06 40 00 00 00 00 00 00 00 00 01 00 00 1c 20 00 00 2a 30 00 19 00 0c 56 a3 53 fe 00 00 0e 10 00 00 15 18 00 25 00 12 00 00 19 7f 00 01 00 01 26 b1 b7 f1 00 50 56 a3 53 fe 00 11 00 12 00 00 19 7f 00 01 00 0a 4c 41 42 4f 4c 54 32 2d 6e 61 00 11 00 12 00 00 19 7f 00 02 00 0a 4c 41 42 4f 4c 54 32 2d 70 64 00 11 00 09 00 00 19 7f 00 03 00 01 3f 00 11 00 09 00 00 19 7f 00 04 00 01 40
# Yes, this is exactly the same massive text blob as above. :)
#
decode-proto -
-match Packet-Type = Relay-Forward, Hop-Count = 1, Relay-Link-Address = 2605:8600:6:8000::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Relay-Message = { Packet-Type = Relay-Forward, Hop-Count = 0, Relay-Link-Address = ::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Relay-Message = { Packet-Type = Solicit, Transaction-ID = 0x1141d7, Client-ID = { DUID = LLT, DUID.LLT = { Hardware-Type = Ethernet, Time = "Jul 27 2020 16:06:09 UTC", Hardware-Type.Ethernet = { Address = 00:50:56:a3:53:fe } } }, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Option-Request = Domain-List, Elapsed-Time = 0, IA-NA = { IAID = 1453544446, T1 = 3600, T2 = 5400, Options = { IA-Addr = { IPv6-Address = 2605:8600:6:4000::1, Preferred-Lifetime = 7200, Valid-Lifetime = 10800 } } }, IA-PD = { IAID = 1453544446, T1 = 3600, T2 = 5400 } } }, Relay-Agent-Remote-ID = { Vendor = 6527, Value = 0x0001000126b1b7f1005056a353fe }, Vendor-Opts.Nokia-SR.WAN-Pool = "LABOLT2-na", Vendor-Opts.Nokia-SR.PFX-Pool = "LABOLT2-pd", Vendor-Opts.Nokia-SR.PFX-Len = 63, Vendor-Opts.Nokia-SR.Reserved-NA-Len = 64
+match Packet-Type = Relay-Forward, Hop-Count = 1, Relay-Link-Address = 2605:8600:6:8000::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Relay-Message = { Packet-Type = Relay-Forward, Hop-Count = 0, Relay-Link-Address = ::, Relay-Peer-Address = fe80::250:56ff:fea3:53fe, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Relay-Message = { Packet-Type = Solicit, Transaction-ID = 0x1141d7, Client-ID = { DUID = LLT, DUID.LLT = { Hardware-Type = Ethernet, Time = "Jul 27 2020 16:06:09 UTC", Hardware-Type.Ethernet = { Address = 00:50:56:a3:53:fe } } }, Interface-ID = 0x4c41424f4c54322065746820312f312f30352f30312f32382f312f31, Option-Request = Domain-List, Elapsed-Time = 0, IA-NA = { IAID = 1453544446, T1 = 3600, T2 = 5400, Options = { IA-Addr = { IPv6-Address = 2605:8600:6:4000::1, Preferred-Lifetime = 7200, Valid-Lifetime = 10800 } } }, IA-PD = { IAID = 1453544446, T1 = 3600, T2 = 5400 } } }, Relay-Agent-Remote-ID = { Vendor = 6527, Value = 0x0001000126b1b7f1005056a353fe }, Vendor-Opts.Nokia-SR = { WAN-Pool = "LABOLT2-na" }, Vendor-Opts.Nokia-SR = { PFX-Pool = "LABOLT2-pd" }, Vendor-Opts.Nokia-SR = { PFX-Len = 63 }, Vendor-Opts.Nokia-SR = { Reserved-NA-Len = 64 }
count
-match 9
+match 19