diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-19 20:03:47 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-19 21:44:52 +0100 |
commit | dc30bd8fad5507054357d75da45880964e15713b (patch) | |
tree | 12a7084ba7c611931236ea0cf0a5a1af7beb1594 | |
parent | fd0f2891cea2e639e2a8597a0578ca7631ac3af3 (diff) | |
download | tcpdump-dc30bd8fad5507054357d75da45880964e15713b.tar.gz |
Use more the EXTRACT_8BITS() macro to fetch a one-byte value (10/n)
In tok2str() calls (step 2).
-rw-r--r-- | print-aoe.c | 2 | ||||
-rw-r--r-- | print-isoclns.c | 4 | ||||
-rw-r--r-- | print-lldp.c | 6 | ||||
-rw-r--r-- | print-rsvp.c | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/print-aoe.c b/print-aoe.c index 633be0e8..19d301b9 100644 --- a/print-aoe.c +++ b/print-aoe.c @@ -227,7 +227,7 @@ aoev1_query_print(netdissect_options *ndo, /* AoE/CCmd */ ND_TCHECK2(*cp, 1); ND_PRINT((ndo, ", AoE: %u, CCmd: %s", (*cp & 0xF0) >> 4, - tok2str(aoev1_ccmd_str, "Unknown (0x02x)", *cp & 0x0F))); + tok2str(aoev1_ccmd_str, "Unknown (0x02x)", EXTRACT_8BITS(cp) & 0x0F))); cp += 1; /* Config String Length */ ND_TCHECK2(*cp, 2); diff --git a/print-isoclns.c b/print-isoclns.c index d4d04008..0eef0611 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -981,7 +981,7 @@ clnp_print(netdissect_options *ndo, return (0); } ND_PRINT((ndo, "\n\t Format Code: %s", - tok2str(clnp_option_scope_values, "Reserved", *tptr&CLNP_OPTION_SCOPE_MASK))); + tok2str(clnp_option_scope_values, "Reserved", EXTRACT_8BITS(tptr) & CLNP_OPTION_SCOPE_MASK))); if ((*tptr&CLNP_OPTION_SCOPE_MASK) == CLNP_OPTION_SCOPE_GLOBAL) ND_PRINT((ndo, "\n\t QoS Flags [%s]", @@ -996,7 +996,7 @@ clnp_print(netdissect_options *ndo, return (0); } ND_PRINT((ndo, "\n\t Format Code: %s, Security-Level %u", - tok2str(clnp_option_scope_values,"Reserved",*tptr&CLNP_OPTION_SCOPE_MASK), + tok2str(clnp_option_scope_values,"Reserved",EXTRACT_8BITS(tptr) & CLNP_OPTION_SCOPE_MASK), *(tptr+1))); break; 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) { diff --git a/print-rsvp.c b/print-rsvp.c index 8f0d7129..1e0972a6 100644 --- a/print-rsvp.c +++ b/print-rsvp.c @@ -1118,7 +1118,7 @@ rsvp_obj_print(netdissect_options *ndo, *(obj_tptr+2), tok2str(rsvp_ctype_values, "Unknown", - *(obj_tptr+3) + 256*RSVP_OBJ_RRO), + EXTRACT_8BITS((obj_tptr + 3)) + (256 * RSVP_OBJ_RRO)), *(obj_tptr+3), EXTRACT_BE_32BITS(obj_tptr + 4))); } |