X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/1182dc9a70fe6ba402c4a254dc93af98ba78d741..296d466cd6bbf2f7e75e15bb6a01268e88c76ed0:/print-dhcp6.c diff --git a/print-dhcp6.c b/print-dhcp6.c index 7e7d1246..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,10 +337,10 @@ dhcp6opt_print(netdissect_options *ndo, ND_PRINT(" ?)"); } break; - case 2: - if (optlen >= 2 + 8) { - ND_PRINT(" vid "); - for (i = 2; i < 2 + 8; i++) + case DUID_EN: + if (optlen >= 2 + 4) { + ND_PRINT(" enterprise %u ", GET_BE_U_4(tp + 2)); + for (i = 2 + 4; i < optlen; i++) ND_PRINT("%02x", GET_U_1(tp + 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;