mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-23 10:04:05 +08:00
DHCPv6: Add DUID-UUID printing (RFC6355)
Define DUID_LLT, DUID_EN, DUID_LL and DUID_UUID. Add a test file.
This commit is contained in:
parent
46c1b8d227
commit
1e3b959bf0
@ -121,6 +121,10 @@ struct dhcp6_relay {
|
||||
/* options */
|
||||
#define DH6OPT_CLIENTID 1
|
||||
#define DH6OPT_SERVERID 2
|
||||
# define DUID_LLT 1 /* RFC8415 */
|
||||
# define DUID_EN 2 /* RFC8415 */
|
||||
# define DUID_LL 3 /* RFC8415 */
|
||||
# define DUID_UUID 4 /* RFC6355 */
|
||||
#define DH6OPT_IA_NA 3
|
||||
#define DH6OPT_IA_TA 4
|
||||
#define DH6OPT_IA_ADDR 5
|
||||
@ -320,7 +324,7 @@ dhcp6opt_print(netdissect_options *ndo,
|
||||
}
|
||||
tp = (const u_char *)(dh6o + 1);
|
||||
switch (GET_BE_U_2(tp)) {
|
||||
case 1:
|
||||
case DUID_LLT:
|
||||
if (optlen >= 2 + 6) {
|
||||
ND_PRINT(" hwaddr/time type %u time %u ",
|
||||
GET_BE_U_2(tp + 2),
|
||||
@ -335,7 +339,7 @@ dhcp6opt_print(netdissect_options *ndo,
|
||||
ND_PRINT(" ?)");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case DUID_EN:
|
||||
if (optlen >= 2 + 4) {
|
||||
ND_PRINT(" enterprise %u ", GET_BE_U_4(tp + 2));
|
||||
for (i = 2 + 4; i < optlen; i++)
|
||||
@ -348,7 +352,7 @@ dhcp6opt_print(netdissect_options *ndo,
|
||||
ND_PRINT(" ?)");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case DUID_LL:
|
||||
if (optlen >= 2 + 2) {
|
||||
ND_PRINT(" hwaddr type %u ",
|
||||
GET_BE_U_2(tp + 2));
|
||||
@ -362,6 +366,19 @@ dhcp6opt_print(netdissect_options *ndo,
|
||||
ND_PRINT(" ?)");
|
||||
}
|
||||
break;
|
||||
case DUID_UUID:
|
||||
ND_PRINT(" uuid ");
|
||||
if (optlen == 2 + 16) {
|
||||
for (i = 2; i < optlen; i++)
|
||||
ND_PRINT("%02x",
|
||||
GET_U_1(tp + i));
|
||||
/*(*/
|
||||
ND_PRINT(")");
|
||||
} else {
|
||||
/*(*/
|
||||
ND_PRINT(" ?)");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ND_PRINT(" type %u)", GET_BE_U_2(tp));
|
||||
break;
|
||||
|
@ -259,6 +259,7 @@ dhcpv6-ntp-server dhcpv6-ntp-server.pcap dhcpv6-ntp-server.out -v
|
||||
dhcpv6-sip-server-d dhcpv6-sip-server-d.pcap dhcpv6-sip-server-d.out -v
|
||||
dhcpv6-domain-list dhcpv6-domain-list.pcap dhcpv6-domain-list.out -v
|
||||
dhcpv6-mud dhcpv6-mud.pcap dhcpv6-mud.out -vv
|
||||
dhcpv6-rfc6355-duid-uuid dhcpv6-rfc6355-duid-uuid.pcap dhcpv6-rfc6355-duid-uuid.out -v
|
||||
|
||||
# ZeroMQ/PGM tests
|
||||
# ZMTP/1.0 over TCP
|
||||
|
2
tests/dhcpv6-rfc6355-duid-uuid.out
Normal file
2
tests/dhcpv6-rfc6355-duid-uuid.out
Normal file
@ -0,0 +1,2 @@
|
||||
1 11:19:08.826971 IP6 (flowlabel 0xd92bc, hlim 1, next-header UDP (17) payload length: 112) fe80::7e39:bc67:f367:8def.546 > ff02::1:2.547: [udp sum ok] dhcp6 renew (xid=9f56b (client-ID uuid a256e92e40abd0d2a3ab3b3ff2ff8998) (server-ID hwaddr type 1 a021b7e0d871) (option-request DNS-server DNS-search-list DNS-server DNS-search-list client-ID) (elapsed-time 0) (IA_NA IAID:971445380 T1:3600 T2:5400 (IA_ADDR 2a02:2788:7c8:4dd:4a5b:39ff:fee7:1484 pltime:7200 vltime:7500)))
|
||||
2 11:19:08.827665 IP6 (hlim 128, next-header UDP (17) payload length: 140) fe80::a221:b7ff:fee0:d871.547 > fe80::7e39:bc67:f367:8def.546: [udp sum ok] dhcp6 reply (xid=9f56b (client-ID uuid a256e92e40abd0d2a3ab3b3ff2ff8998) (IA_NA IAID:971445380 T1:15 T2:45 (IA_ADDR 2a02:2788:7c8:4dd:4a5b:39ff:fee7:1484 pltime:30 vltime:60)) (DNS-server 2a02:2788:fff0:7::3 2a02:2788:fff0:5::140) (DNS-search-list voo.be.) (server-ID hwaddr type 1 a021b7e0d871))
|
BIN
tests/dhcpv6-rfc6355-duid-uuid.pcap
Normal file
BIN
tests/dhcpv6-rfc6355-duid-uuid.pcap
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user