X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/481fe6080d17dc7e820ba0f335454f6b9dcc5a02..0023eaa78f123676bfa9c5fba72ea4b8a59aaa70:/print-dhcp6.c diff --git a/print-dhcp6.c b/print-dhcp6.c index 8dfcb7bf..c196ad74 100644 --- a/print-dhcp6.c +++ b/print-dhcp6.c @@ -43,9 +43,7 @@ * RFC6334: Dual-Stack Lite option, */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -121,6 +119,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 +322,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 +337,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 +350,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 +364,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;