Assignment, one operator.
if (len < AOEV1_COMMON_HDR_LEN)
goto invalid;
/* Flags */
- flags = *cp & 0x0F;
+ flags = EXTRACT_8BITS(cp) & 0x0F;
ND_PRINT((ndo, ", Flags: [%s]", bittok2str(aoev1_flag_str, "none", flags)));
cp += 1;
if (! ndo->ndo_vflag)
{
uint64_t latlon;
- latlon = *tptr & 0x3;
+ latlon = EXTRACT_8BITS(tptr) & 0x3;
latlon = (latlon << 32) | EXTRACT_BE_32BITS(tptr + 1);
return latlon;
case MPCP_OPCODE_GATE:
ND_TCHECK2(*tptr, MPCP_GRANT_NUMBER_LEN);
- grant_numbers = *tptr & MPCP_GRANT_NUMBER_MASK;
+ grant_numbers = EXTRACT_8BITS(tptr) & MPCP_GRANT_NUMBER_MASK;
ND_PRINT((ndo, "\n\tGrant Numbers %u, Flags [ %s ]",
grant_numbers,
bittok2str(mpcp_grant_flag_values,
if (i <= 1 || !ND_TTEST(*s))
break;
i--;
- c = *s++ ^ 0x20;
+ c = EXTRACT_8BITS(s) ^ 0x20;
+ s++;
}
*t++ = c;
}
#endif
#include "netdissect.h"
+#include "extract.h"
#undef OPAQUE /* defined in <wingdi.h> */
* +---+---+---+---+---+---+---+---+
* 7 6 5 4 3 2 1 0
*/
- id = *p & ASN_ID_BITS; /* lower 5 bits, range 00-1f */
+ id = EXTRACT_8BITS(p) & ASN_ID_BITS; /* lower 5 bits, range 00-1f */
#ifdef notdef
form = (*p & 0xe0) >> 5; /* move upper 3 bits to lower 3 */
class = form >> 1; /* bits 7&6 -> bits 1&0, range 0-3 */