aboutsummaryrefslogtreecommitdiff
path: root/print-lldp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-19 20:03:47 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-19 21:44:52 +0100
commitdc30bd8fad5507054357d75da45880964e15713b (patch)
tree12a7084ba7c611931236ea0cf0a5a1af7beb1594 /print-lldp.c
parentfd0f2891cea2e639e2a8597a0578ca7631ac3af3 (diff)
downloadtcpdump-dc30bd8fad5507054357d75da45880964e15713b.tar.gz
Use more the EXTRACT_8BITS() macro to fetch a one-byte value (10/n)
In tok2str() calls (step 2).
Diffstat (limited to 'print-lldp.c')
-rw-r--r--print-lldp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/print-lldp.c b/print-lldp.c
index 4c924d12..f3441f25 100644
--- a/print-lldp.c
+++ b/print-lldp.c
@@ -1031,7 +1031,7 @@ lldp_private_tia_print(netdissect_options *ndo,
ND_PRINT((ndo, "\n\t Longitude resolution %u, longitude value %" PRIu64,
(*(tptr + 10) >> 2), lldp_extract_latlon(tptr + 10)));
ND_PRINT((ndo, "\n\t Altitude type %s (%u)",
- tok2str(lldp_tia_location_altitude_type_values, "unknown",(*(tptr+15)>>4)),
+ tok2str(lldp_tia_location_altitude_type_values, "unknown",EXTRACT_8BITS((tptr + 15)) >> 4),
(*(tptr + 15) >> 4)));
ND_PRINT((ndo, "\n\t Altitude resolution %u, altitude value 0x%x",
(EXTRACT_BE_16BITS(tptr + 15)>>6)&0x3f,
@@ -1110,9 +1110,9 @@ lldp_private_tia_print(netdissect_options *ndo,
ND_PRINT((ndo, "\n\t Power type [%s]",
(*(tptr + 4) & 0xC0 >> 6) ? "PD device" : "PSE device"));
ND_PRINT((ndo, ", Power source [%s]",
- tok2str(lldp_tia_power_source_values, "none", (*(tptr + 4) & 0x30) >> 4)));
+ tok2str(lldp_tia_power_source_values, "none", (EXTRACT_8BITS((tptr + 4)) & 0x30) >> 4)));
ND_PRINT((ndo, "\n\t Power priority [%s] (0x%02x)",
- tok2str(lldp_tia_power_priority_values, "none", *(tptr+4)&0x0f),
+ tok2str(lldp_tia_power_priority_values, "none", EXTRACT_8BITS((tptr + 4)) & 0x0f),
*(tptr + 4) & 0x0f));
power_val = EXTRACT_BE_16BITS(tptr + 5);
if (power_val < LLDP_TIA_POWER_VAL_MAX) {