summaryrefslogtreecommitdiff
path: root/print-hncp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-18 11:52:52 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-18 13:56:40 +0100
commit577621026df8d4a33a34d4e125f9ec964fc0e53c (patch)
treea25ed4b22461cbb115c9e112935c28bcd57406bc /print-hncp.c
parent0e854b0937199956478686ae610ff9f794aafc6b (diff)
downloadtcpdump-577621026df8d4a33a34d4e125f9ec964fc0e53c.tar.gz
Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()
It indicates clearly that these macros are used to extract big-endian integral values.
Diffstat (limited to 'print-hncp.c')
-rw-r--r--print-hncp.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/print-hncp.c b/print-hncp.c
index af219c67..d606116d 100644
--- a/print-hncp.c
+++ b/print-hncp.c
@@ -173,10 +173,10 @@ format_256(const u_char *data)
static int i = 0;
i = (i + 1) % 4;
snprintf(buf[i], sizeof(buf[i]), "%016" PRIx64 "%016" PRIx64 "%016" PRIx64 "%016" PRIx64,
- EXTRACT_64BITS(data),
- EXTRACT_64BITS(data + 8),
- EXTRACT_64BITS(data + 16),
- EXTRACT_64BITS(data + 24)
+ EXTRACT_BE_64BITS(data),
+ EXTRACT_BE_64BITS(data + 8),
+ EXTRACT_BE_64BITS(data + 16),
+ EXTRACT_BE_64BITS(data + 24)
);
return buf[i];
}
@@ -325,8 +325,8 @@ dhcpv6_print(netdissect_options *ndo,
if (i + 4 > length)
return -1;
tlv = cp + i;
- type = EXTRACT_16BITS(tlv);
- optlen = EXTRACT_16BITS(tlv + 2);
+ type = EXTRACT_BE_16BITS(tlv);
+ optlen = EXTRACT_BE_16BITS(tlv + 2);
value = tlv + 4;
ND_PRINT((ndo, "\n"));
@@ -426,8 +426,8 @@ hncp_print_rec(netdissect_options *ndo,
if (i + 4 > length)
goto invalid;
- type = EXTRACT_16BITS(tlv);
- bodylen = EXTRACT_16BITS(tlv + 2);
+ type = EXTRACT_BE_16BITS(tlv);
+ bodylen = EXTRACT_BE_16BITS(tlv + 2);
value = tlv + 4;
ND_TCHECK2(*value, bodylen);
if (i + bodylen + 4 > length)
@@ -499,7 +499,7 @@ hncp_print_rec(netdissect_options *ndo,
break;
}
node_identifier = format_nid(value);
- endpoint_identifier = EXTRACT_32BITS(value + 4);
+ endpoint_identifier = EXTRACT_BE_32BITS(value + 4);
ND_PRINT((ndo, " NID: %s EPID: %08x",
node_identifier,
endpoint_identifier
@@ -513,7 +513,7 @@ hncp_print_rec(netdissect_options *ndo,
ND_PRINT((ndo, " %s", istr));
break;
}
- hash = EXTRACT_64BITS(value);
+ hash = EXTRACT_BE_64BITS(value);
ND_PRINT((ndo, " hash: %016" PRIx64, hash));
}
break;
@@ -527,9 +527,9 @@ hncp_print_rec(netdissect_options *ndo,
break;
}
node_identifier = format_nid(value);
- sequence_number = EXTRACT_32BITS(value + 4);
- interval = format_interval(EXTRACT_32BITS(value + 8));
- hash = EXTRACT_64BITS(value + 12);
+ sequence_number = EXTRACT_BE_32BITS(value + 4);
+ interval = format_interval(EXTRACT_BE_32BITS(value + 8));
+ hash = EXTRACT_BE_64BITS(value + 12);
ND_PRINT((ndo, " NID: %s seqno: %u %s hash: %016" PRIx64,
node_identifier,
sequence_number,
@@ -548,8 +548,8 @@ hncp_print_rec(netdissect_options *ndo,
break;
}
peer_node_identifier = format_nid(value);
- peer_endpoint_identifier = EXTRACT_32BITS(value + 4);
- endpoint_identifier = EXTRACT_32BITS(value + 8);
+ peer_endpoint_identifier = EXTRACT_BE_32BITS(value + 4);
+ endpoint_identifier = EXTRACT_BE_32BITS(value + 8);
ND_PRINT((ndo, " Peer-NID: %s Peer-EPID: %08x Local-EPID: %08x",
peer_node_identifier,
peer_endpoint_identifier,
@@ -565,8 +565,8 @@ hncp_print_rec(netdissect_options *ndo,
ND_PRINT((ndo, " %s", istr));
break;
}
- endpoint_identifier = EXTRACT_32BITS(value);
- interval = format_interval(EXTRACT_32BITS(value + 4));
+ endpoint_identifier = EXTRACT_BE_32BITS(value);
+ interval = format_interval(EXTRACT_BE_32BITS(value + 4));
ND_PRINT((ndo, " EPID: %08x Interval: %s",
endpoint_identifier,
interval
@@ -593,7 +593,7 @@ hncp_print_rec(netdissect_options *ndo,
ND_PRINT((ndo, " %s", istr));
break;
}
- capabilities = EXTRACT_16BITS(value + 2);
+ capabilities = EXTRACT_BE_16BITS(value + 2);
M = (uint8_t)((capabilities >> 12) & 0xf);
P = (uint8_t)((capabilities >> 8) & 0xf);
H = (uint8_t)((capabilities >> 4) & 0xf);
@@ -618,8 +618,8 @@ hncp_print_rec(netdissect_options *ndo,
break;
}
ND_PRINT((ndo, " VLSO: %s PLSO: %s Prefix: ",
- format_interval(EXTRACT_32BITS(value)),
- format_interval(EXTRACT_32BITS(value + 4))
+ format_interval(EXTRACT_BE_32BITS(value)),
+ format_interval(EXTRACT_BE_32BITS(value + 4))
));
l = print_prefix(ndo, value + 8, bodylen - 8);
if (l == -1) {
@@ -730,7 +730,7 @@ hncp_print_rec(netdissect_options *ndo,
}
prty = value[4] & 0xf;
ND_PRINT((ndo, " EPID: %08x Prty: %u",
- EXTRACT_32BITS(value),
+ EXTRACT_BE_32BITS(value),
prty
));
ND_PRINT((ndo, " Prefix: "));
@@ -753,7 +753,7 @@ hncp_print_rec(netdissect_options *ndo,
ND_PRINT((ndo, " %s", istr));
break;
}
- endpoint_identifier = EXTRACT_32BITS(value);
+ endpoint_identifier = EXTRACT_BE_32BITS(value);
ip_address = format_ip6addr(ndo, value + 4);
ND_PRINT((ndo, " EPID: %08x IP Address: %s",
endpoint_identifier,