Skip to content

Commit

Permalink
convert IA-PD-Options to data type 'group'
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Jan 17, 2020
1 parent 71ee51b commit 92edc9b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions share/dictionary/dhcpv6/dictionary.rfc3633
Expand Up @@ -13,13 +13,13 @@ ATTRIBUTE IA-PD 25 struct
MEMBER IA-PD-IAID uint32
MEMBER IA-PD-T1 time_delta # time delta from "now" in seconds
MEMBER IA-PD-T2 time_delta # time delta from "now" in seconds
MEMBER IA-PD-Options octets # really "group" of IA-Prefix and other options
MEMBER IA-PD-Options group # of IA-PD-Prefix and other options

# An IA_PD Prefix option may appear only in an IA_PD option
ATTRIBUTE IA-PD-Prefix 26 struct
MEMBER IA-PD-Prefix-Preferred-Lifetime time_delta # time delta from "now" in seconds
MEMBER IA-PD-Prefix-Valid-Lifetime time_delta # time delta from "now" in seconds
MEMBER IA-PD-Prefix-IPv6-Prefix-Length uint8
MEMBER IA-PD-Prefix-IPv6-Prefix ipv6addr # MUST be 16 bytes
MEMBER IA-PD-Prefix-Options octets # really "group" of IA-PD-Prefix and ot
MEMBER IA-PD-Prefix-Options group # of other options associated with this prefix

6 changes: 3 additions & 3 deletions src/tests/unit/protocols/dhcpv6/packet_AFTR-Name-rfc6334.txt
Expand Up @@ -97,7 +97,7 @@ match Packet-Type = Solicit, Transaction-ID = 0xd81eb8, Client-ID-DUID = Client-
# data = '\taftr-name\x08mydomain\x03net\x00'
#
decode-proto 02 d8 1e b8 00 19 00 29 02 03 04 05 00 00 00 96 00 00 00 fa 00 1a 00 19 00 00 00 fa 00 00 01 2c 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 3f 4e f0 00 11 22 33 44 55 00 07 00 01 0a 00 17 00 10 2a 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 40 00 18 09 61 66 74 72 2d 6e 61 6d 65 08 6d 79 64 6f 6d 61 69 6e 03 6e 65 74 00
match Packet-Type = Advertise, Transaction-ID = 0xd81eb8, IA-PD-IAID = 33752069, IA-PD-T1 = 150, IA-PD-T2 = 250, IA-PD-Options = 0x001a0019000000fa0000012c382a000001000101000000000000000000, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 21 2012 08:36:00 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455, Preference = 10, DNS-Servers = 2a01::1, AFTR-Name = "aftr-name.mydomain.net"
match Packet-Type = Advertise, Transaction-ID = 0xd81eb8, IA-PD-IAID = 33752069, IA-PD-T1 = 150, IA-PD-T2 = 250, IA-PD-Options = { IA-PD-Prefix-Preferred-Lifetime = 250, IA-PD-Prefix-Valid-Lifetime = 300, IA-PD-Prefix-IPv6-Prefix-Length = 56, IA-PD-Prefix-IPv6-Prefix = 2a00:1:1:100:: }, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 21 2012 08:36:00 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455, Preference = 10, DNS-Servers = 2a01::1, AFTR-Name = "aftr-name.mydomain.net"

#
# 3.
Expand Down Expand Up @@ -147,7 +147,7 @@ match Packet-Type = Advertise, Transaction-ID = 0xd81eb8, IA-PD-IAID = 33752069,
# | iaprefopts= ''
#
decode-proto 03 1e 29 1d 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 3f 4e f0 00 11 22 33 44 55 00 06 00 04 00 17 00 40 00 08 00 02 00 00 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 1c 20 00 00 1d 4c 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00
match Packet-Type = Request, Transaction-ID = 0x1e291d, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 21 2012 08:36:00 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455, Option-Request = DNS-Servers, Option-Request = AFTR-Name, Elapsed-Time = 0, IA-PD-IAID = 33752069, IA-PD-T1 = 3600, IA-PD-T2 = 5400, IA-PD-Options = 0x001a001900001c2000001d4c382a000001000101000000000000000000
match Packet-Type = Request, Transaction-ID = 0x1e291d, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 21 2012 08:36:00 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455, Option-Request = DNS-Servers, Option-Request = AFTR-Name, Elapsed-Time = 0, IA-PD-IAID = 33752069, IA-PD-T1 = 3600, IA-PD-T2 = 5400, IA-PD-Options = { IA-PD-Prefix-Preferred-Lifetime = 7200, IA-PD-Prefix-Valid-Lifetime = 7500, IA-PD-Prefix-IPv6-Prefix-Length = 56, IA-PD-Prefix-IPv6-Prefix = 2a00:1:1:100:: }

#
# 4.
Expand Down Expand Up @@ -201,7 +201,7 @@ match Packet-Type = Request, Transaction-ID = 0x1e291d, Client-ID-DUID = Client-
# data = '\taftr-name\x08mydomain\x03net\x00'
#
decode-proto 07 1e 29 1d 00 19 00 29 02 03 04 05 00 00 00 96 00 00 00 fa 00 1a 00 19 00 00 00 fa 00 00 01 2c 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 3f 4e f0 00 11 22 33 44 55 00 07 00 01 0a 00 17 00 10 2a 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 40 00 18 09 61 66 74 72 2d 6e 61 6d 65 08 6d 79 64 6f 6d 61 69 6e 03 6e 65 74 00
match Packet-Type = Reply, Transaction-ID = 0x1e291d, IA-PD-IAID = 33752069, IA-PD-T1 = 150, IA-PD-T2 = 250, IA-PD-Options = 0x001a0019000000fa0000012c382a000001000101000000000000000000, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 21 2012 08:36:00 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455, Preference = 10, DNS-Servers = 2a01::1, AFTR-Name = "aftr-name.mydomain.net"
match Packet-Type = Reply, Transaction-ID = 0x1e291d, IA-PD-IAID = 33752069, IA-PD-T1 = 150, IA-PD-T2 = 250, IA-PD-Options = { IA-PD-Prefix-Preferred-Lifetime = 250, IA-PD-Prefix-Valid-Lifetime = 300, IA-PD-Prefix-IPv6-Prefix-Length = 56, IA-PD-Prefix-IPv6-Prefix = 2a00:1:1:100:: }, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 21 2012 08:36:00 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455, Preference = 10, DNS-Servers = 2a01::1, AFTR-Name = "aftr-name.mydomain.net"

count
match 10
Expand Down
6 changes: 3 additions & 3 deletions src/tests/unit/protocols/dhcpv6/packet_client_server.txt
Expand Up @@ -101,11 +101,11 @@ match Packet-Type = Reply, Transaction-ID = 0xc0ffee, Server-ID-DUID = Server-ID
# Elapsed time
# Identity Association for Prefix Delegation
#
encode-proto Packet-Type = Release, Transaction-ID = 0x00b33f, Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f, Server-ID-DUID = Server-ID-DUID-UUID, Server-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f, Option-Request = DNS-Servers, Option-Request = Domain-List, Elapsed-Time = 45887, IA-PD-IAID = 2864434397, IA-PD-T1 = 54093, IA-PD-T2 = 45887, IA-PD-Options = 0x006001ad
match 08 00 b3 3f 00 01 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 00 02 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 00 06 00 04 00 17 00 18 00 08 00 02 b3 3f 00 19 00 10 aa bb cc dd 00 00 d3 4d 00 00 b3 3f 00 60 01 ad
encode-proto Packet-Type = Release, Transaction-ID = 0x00b33f, Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f, Server-ID-DUID = Server-ID-DUID-UUID, Server-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f, Option-Request = DNS-Servers, Option-Request = Domain-List, Elapsed-Time = 45887, IA-PD-IAID = 2864434397, IA-PD-T1 = 54093, IA-PD-T2 = 45887, IA-PD-Options = { Preference = 1 }
match 08 00 b3 3f 00 01 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 00 02 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 00 06 00 04 00 17 00 18 00 08 00 02 b3 3f 00 19 00 11 aa bb cc dd 00 00 d3 4d 00 00 b3 3f 00 07 00 01 01

decode-proto -
match Packet-Type = Release, Transaction-ID = 0x00b33f, Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f, Server-ID-DUID = Server-ID-DUID-UUID, Server-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f, Option-Request = DNS-Servers, Option-Request = Domain-List, Elapsed-Time = 45887, IA-PD-IAID = 2864434397, IA-PD-T1 = 54093, IA-PD-T2 = 45887, IA-PD-Options = 0x006001ad
match Packet-Type = Release, Transaction-ID = 0x00b33f, Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f, Server-ID-DUID = Server-ID-DUID-UUID, Server-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f, Option-Request = DNS-Servers, Option-Request = Domain-List, Elapsed-Time = 45887, IA-PD-IAID = 2864434397, IA-PD-T1 = 54093, IA-PD-T2 = 45887, IA-PD-Options = { Preference = 1 }

#
# 6. Reply (Server -> Client)
Expand Down
6 changes: 3 additions & 3 deletions src/tests/unit/protocols/dhcpv6/packet_ia-pd.txt
Expand Up @@ -85,7 +85,7 @@ match Packet-Type = Solicit, Transaction-ID = 0xe1e093, Client-ID-DUID = Client-
# | lladdr = 00:11:22:33:44:55
#
decode-proto 02 e1 e0 93 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 11 94 00 00 1c 20 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 46 49 99 00 11 22 33 44 55
match Packet-Type = Advertise, Transaction-ID = 0xe1e093, IA-PD-IAID = 33752069, IA-PD-T1 = 3600, IA-PD-T2 = 5400, IA-PD-Options = 0x001a00190000119400001c20382a000001000101000000000000000000, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 26 2012 15:39:05 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455
match Packet-Type = Advertise, Transaction-ID = 0xe1e093, IA-PD-IAID = 33752069, IA-PD-T1 = 3600, IA-PD-T2 = 5400, IA-PD-Options = { IA-PD-Prefix-Preferred-Lifetime = 4500, IA-PD-Prefix-Valid-Lifetime = 7200, IA-PD-Prefix-IPv6-Prefix-Length = 56, IA-PD-Prefix-IPv6-Prefix = 2a00:1:1:100:: }, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 26 2012 15:39:05 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455

#
# 3.
Expand Down Expand Up @@ -135,7 +135,7 @@ match Packet-Type = Advertise, Transaction-ID = 0xe1e093, IA-PD-IAID = 33752069,
# | iaprefopts= ''
#
decode-proto 03 12 b0 8a 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 46 49 99 00 11 22 33 44 55 00 06 00 04 00 17 00 18 00 08 00 02 00 00 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 1c 20 00 00 1d 4c 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00
match Packet-Type = Request, Transaction-ID = 0x12b08a, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 26 2012 15:39:05 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455, Option-Request = DNS-Servers, Option-Request = Domain-List, Elapsed-Time = 0, IA-PD-IAID = 33752069, IA-PD-T1 = 3600, IA-PD-T2 = 5400, IA-PD-Options = 0x001a001900001c2000001d4c382a000001000101000000000000000000
match Packet-Type = Request, Transaction-ID = 0x12b08a, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 26 2012 15:39:05 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455, Option-Request = DNS-Servers, Option-Request = Domain-List, Elapsed-Time = 0, IA-PD-IAID = 33752069, IA-PD-T1 = 3600, IA-PD-T2 = 5400, IA-PD-Options = { IA-PD-Prefix-Preferred-Lifetime = 7200, IA-PD-Prefix-Valid-Lifetime = 7500, IA-PD-Prefix-IPv6-Prefix-Length = 56, IA-PD-Prefix-IPv6-Prefix = 2a00:1:1:100:: }

#
# 4.
Expand Down Expand Up @@ -177,7 +177,7 @@ match Packet-Type = Request, Transaction-ID = 0x12b08a, Client-ID-DUID = Client-
# | lladdr = 00:11:22:33:44:55
#
decode-proto 07 12 b0 8a 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 11 94 00 00 1c 20 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 46 49 99 00 11 22 33 44 55
match Packet-Type = Reply, Transaction-ID = 0x12b08a, IA-PD-IAID = 33752069, IA-PD-T1 = 3600, IA-PD-T2 = 5400, IA-PD-Options = 0x001a00190000119400001c20382a000001000101000000000000000000, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 26 2012 15:39:05 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455
match Packet-Type = Reply, Transaction-ID = 0x12b08a, IA-PD-IAID = 33752069, IA-PD-T1 = 3600, IA-PD-T2 = 5400, IA-PD-Options = { IA-PD-Prefix-Preferred-Lifetime = 4500, IA-PD-Prefix-Valid-Lifetime = 7200, IA-PD-Prefix-IPv6-Prefix-Length = 56, IA-PD-Prefix-IPv6-Prefix = 2a00:1:1:100:: }, Client-ID-DUID = Client-ID-DUID-LL, Client-ID-DUID-LL-Hardware-Type = 1, Client-ID-DUID-LL-Address = 0x000102030405, Server-ID-DUID = Server-ID-DUID-LLT, Server-ID-DUID-LLT-Hardware-Type = 1, Server-ID-DUID-LLT-Time = "Nov 26 2012 15:39:05 UTC", Server-ID-DUID-LLT-Link-Layer-Address = 0x001122334455

count
match 10
Expand Down
12 changes: 6 additions & 6 deletions src/tests/unit/protocols/dhcpv6/rfc8415.txt
Expand Up @@ -831,11 +831,11 @@ match Reconf-Accept = 0x
# variable-length field (12 octets less than
# the value in the option-len field).
#
encode-pair IA-PD-IAID = 2864434397, IA-PD-T1 = 54093, IA-PD-T2 = 45887, IA-PD-Options = 0x006001ad
match 00 19 00 10 aa bb cc dd 00 00 d3 4d 00 00 b3 3f 00 60 01 ad
encode-pair IA-PD-IAID = 2864434397, IA-PD-T1 = 54093, IA-PD-T2 = 45887, IA-PD-Options = { Preference = 1 }
match 00 19 00 11 aa bb cc dd 00 00 d3 4d 00 00 b3 3f 00 07 00 01 01

decode-pair -
match IA-PD-IAID = 2864434397, IA-PD-T1 = 54093, IA-PD-T2 = 45887, IA-PD-Options = 0x006001ad
match IA-PD-IAID = 2864434397, IA-PD-T1 = 54093, IA-PD-T2 = 45887, IA-PD-Options = { Preference = 1 }

#
# 21.22. IA Prefix Option
Expand Down Expand Up @@ -892,11 +892,11 @@ match IA-PD-IAID = 2864434397, IA-PD-T1 = 54093, IA-PD-T2 = 45887, IA-PD-Options
# variable-length field (25 octets less than
# the value in the option-len field).
#
encode-pair IA-PD-Prefix-Preferred-Lifetime = 29425646, IA-PD-Prefix-Valid-Lifetime = 46202862, IA-PD-Prefix-IPv6-Prefix-Length = 128, IA-PD-Prefix-IPv6-Prefix = ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff, IA-PD-Prefix-Options = 0x006001ad
match 00 1a 00 1d 01 c0 ff ee 02 c0 ff ee 80 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 60 01 ad
encode-pair IA-PD-Prefix-Preferred-Lifetime = 29425646, IA-PD-Prefix-Valid-Lifetime = 46202862, IA-PD-Prefix-IPv6-Prefix-Length = 128, IA-PD-Prefix-IPv6-Prefix = ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff, IA-PD-Options = { Preference = 1 }
match 00 1a 00 19 01 c0 ff ee 02 c0 ff ee 80 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 19 00 11 00 00 00 00 00 00 00 00 00 00 00 00 00 07 00 01 01

decode-pair -
match IA-PD-Prefix-Preferred-Lifetime = 29425646, IA-PD-Prefix-Valid-Lifetime = 46202862, IA-PD-Prefix-IPv6-Prefix-Length = 128, IA-PD-Prefix-IPv6-Prefix = ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff, IA-PD-Prefix-Options = 0x006001ad
match IA-PD-Prefix-Preferred-Lifetime = 29425646, IA-PD-Prefix-Valid-Lifetime = 46202862, IA-PD-Prefix-IPv6-Prefix-Length = 128, IA-PD-Prefix-IPv6-Prefix = ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff, IA-PD-IAID = 0, IA-PD-T1 = 0, IA-PD-T2 = 0, IA-PD-Options = { Preference = 1 }

#
# 21.23. Information Refresh Time Option
Expand Down

0 comments on commit 92edc9b

Please sign in to comment.