u_int authinfolen, authrealmlen;
int remain_len; /* Length of remaining options */
int label_len; /* Label length */
uint16_t subopt_code;
uint16_t subopt_len;
u_int authinfolen, authrealmlen;
int remain_len; /* Length of remaining options */
int label_len; /* Label length */
uint16_t subopt_code;
uint16_t subopt_len;
ND_PRINT((ndo, " (%s", tok2str(dh6opt_str, "opt_%u", opttype)));
ND_PRINT((ndo, " (%s", tok2str(dh6opt_str, "opt_%u", opttype)));
- EXTRACT_16BITS(&tp[2]),
- EXTRACT_32BITS(&tp[4])));
+ EXTRACT_BE_U_2(tp + 2),
+ EXTRACT_BE_U_4(tp + 4)));
if (optlen >= 2 + 8) {
ND_PRINT((ndo, " vid "));
for (i = 2; i < 2 + 8; i++)
if (optlen >= 2 + 8) {
ND_PRINT((ndo, " vid "));
for (i = 2; i < 2 + 8; i++)
- ND_PRINT((ndo, " %s", ip6addr_string(ndo, &tp[0])));
+ ND_PRINT((ndo, " %s", ip6addr_string(ndo, tp)));
- EXTRACT_32BITS(&tp[16]),
- EXTRACT_32BITS(&tp[20])));
+ EXTRACT_BE_U_4(tp + 16),
+ EXTRACT_BE_U_4(tp + 20)));
if (optlen > 24) {
/* there are sub-options */
dhcp6opt_print(ndo, tp + 24, tp + optlen);
if (optlen > 24) {
/* there are sub-options */
dhcp6opt_print(ndo, tp + 24, tp + optlen);
switch (auth_proto) {
case DH6OPT_AUTHPROTO_DELAYED:
ND_PRINT((ndo, " proto: delayed"));
switch (auth_proto) {
case DH6OPT_AUTHPROTO_DELAYED:
ND_PRINT((ndo, " proto: delayed"));
case DH6OPT_AUTHALG_HMACMD5:
/* XXX: may depend on the protocol */
ND_PRINT((ndo, ", alg: HMAC-MD5"));
break;
default:
case DH6OPT_AUTHALG_HMACMD5:
/* XXX: may depend on the protocol */
ND_PRINT((ndo, ", alg: HMAC-MD5"));
break;
default:
- ND_PRINT((ndo, ", alg: %d", *tp));
+ ND_PRINT((ndo, ", alg: %d", auth_alg));
case DH6OPT_AUTHRDM_MONOCOUNTER:
ND_PRINT((ndo, ", RDM: mono"));
break;
default:
case DH6OPT_AUTHRDM_MONOCOUNTER:
ND_PRINT((ndo, ", RDM: mono"));
break;
default:
- ND_PRINT((ndo, ", RDM: %d", *tp));
+ ND_PRINT((ndo, ", RDM: %d", auth_rdm));
break;
}
tp++;
ND_PRINT((ndo, ", RD:"));
for (i = 0; i < 4; i++, tp += 2)
break;
}
tp++;
ND_PRINT((ndo, ", RD:"));
for (i = 0; i < 4; i++, tp += 2)
ND_PRINT((ndo, ", realm: "));
}
for (i = 0; i < authrealmlen; i++, tp++)
ND_PRINT((ndo, ", realm: "));
}
for (i = 0; i < authrealmlen; i++, tp++)
- ND_PRINT((ndo, "%02x", *tp));
- ND_PRINT((ndo, ", key ID: %08x", EXTRACT_32BITS(tp)));
+ ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp)));
+ ND_PRINT((ndo, ", key ID: %08x", EXTRACT_BE_U_4(tp)));
tp += 4;
ND_PRINT((ndo, ", HMAC-MD5:"));
for (i = 0; i < 4; i++, tp+= 4)
tp += 4;
ND_PRINT((ndo, ", HMAC-MD5:"));
for (i = 0; i < 4; i++, tp+= 4)
case DH6OPT_AUTHRECONFIG_KEY:
ND_PRINT((ndo, " reconfig-key"));
break;
case DH6OPT_AUTHRECONFIG_KEY:
ND_PRINT((ndo, " reconfig-key"));
break;
ND_PRINT((ndo, " value:"));
for (i = 0; i < 4; i++, tp+= 4)
ND_PRINT((ndo, " value:"));
for (i = 0; i < 4; i++, tp+= 4)
- ND_PRINT((ndo, " %s", ip6addr_string(ndo, &tp[i])));
+ ND_PRINT((ndo, " %s", ip6addr_string(ndo, tp + i)));
}
tp = (const u_char *)(dh6o + 1);
ND_PRINT((ndo, " IAID:%u T1:%u T2:%u",
}
tp = (const u_char *)(dh6o + 1);
ND_PRINT((ndo, " IAID:%u T1:%u T2:%u",
- EXTRACT_32BITS(&tp[0]),
- EXTRACT_32BITS(&tp[4]),
- EXTRACT_32BITS(&tp[8])));
+ EXTRACT_BE_U_4(tp),
+ EXTRACT_BE_U_4(tp + 4),
+ EXTRACT_BE_U_4(tp + 8)));
if (optlen > 12) {
/* there are sub-options */
dhcp6opt_print(ndo, tp + 12, tp + optlen);
if (optlen > 12) {
/* there are sub-options */
dhcp6opt_print(ndo, tp + 12, tp + optlen);
if (optlen > 4) {
/* there are sub-options */
dhcp6opt_print(ndo, tp + 4, tp + optlen);
if (optlen > 4) {
/* there are sub-options */
dhcp6opt_print(ndo, tp + 4, tp + optlen);
- ND_PRINT((ndo, " %s/%d", ip6addr_string(ndo, &tp[9]), tp[8]));
+ ND_PRINT((ndo, " %s/%d", ip6addr_string(ndo, tp + 9), EXTRACT_U_1(tp + 8)));
if (optlen > 25) {
/* there are sub-options */
dhcp6opt_print(ndo, tp + 25, tp + optlen);
if (optlen > 25) {
/* there are sub-options */
dhcp6opt_print(ndo, tp + 25, tp + optlen);
- ND_PRINT((ndo, " %s", ip6addr_string(ndo, &tp[1])));
+ ND_PRINT((ndo, " %s", ip6addr_string(ndo, tp + 1)));
if (optlen > 17) {
/* there are query-options */
dhcp6opt_print(ndo, tp + 17, tp + optlen);
if (optlen > 17) {
/* there are query-options */
dhcp6opt_print(ndo, tp + 17, tp + optlen);
- ND_PRINT((ndo, " %s ", ip6addr_string(ndo, &tp[0])));
+ ND_PRINT((ndo, " %s ", ip6addr_string(ndo, tp)));
- ND_PRINT((ndo, " %s", ip6addr_string(ndo, &tp[0])));
+ ND_PRINT((ndo, " %s", ip6addr_string(ndo, tp)));
if (label_len < remain_len - 1) {
(void)fn_printn(ndo, tp, label_len, NULL);
tp += label_len;
remain_len -= (label_len + 1);
if (label_len < remain_len - 1) {
(void)fn_printn(ndo, tp, label_len, NULL);
tp += label_len;
remain_len -= (label_len + 1);
- name = tok2str(dh6_msgtype_str, "msgtype-%u", dh6->dh6_msgtype);
+ msgtype = EXTRACT_U_1(dh6->dh6_msgtype);
+ name = tok2str(dh6_msgtype_str, "msgtype-%u", msgtype);
/* XXX relay agent messages have to be handled differently */
ND_PRINT((ndo, " %s (", name)); /*)*/
/* XXX relay agent messages have to be handled differently */
ND_PRINT((ndo, " %s (", name)); /*)*/
- if (dh6->dh6_msgtype != DH6_RELAY_FORW &&
- dh6->dh6_msgtype != DH6_RELAY_REPLY) {
- ND_PRINT((ndo, "xid=%x", EXTRACT_32BITS(&dh6->dh6_xid) & DH6_XIDMASK));
+ if (msgtype != DH6_RELAY_FORW && msgtype != DH6_RELAY_REPLY) {
+ ND_PRINT((ndo, "xid=%x", EXTRACT_BE_U_4(dh6->dh6_xid) & DH6_XIDMASK));
extp = (const u_char *)(dh6 + 1);
dhcp6opt_print(ndo, extp, ep);
} else { /* relay messages */
extp = (const u_char *)(dh6 + 1);
dhcp6opt_print(ndo, extp, ep);
} else { /* relay messages */