while (cp < ep) {
/* Option no */
ND_TCHECK_1(cp);
- option_no = *cp;
+ option_no = EXTRACT_U_1(cp);
cp += 1;
ND_PRINT((ndo, "\n\t %s", tok2str(ahcp1_opt_str, "Unknown-%u", option_no)));
if (option_no == AHCP1_OPT_PAD || option_no == AHCP1_OPT_MANDATORY)
if (cp + 1 > ep)
goto invalid;
ND_TCHECK_1(cp);
- option_len = *cp;
+ option_len = EXTRACT_U_1(cp);
cp += 1;
if (cp + option_len > ep)
goto invalid;
goto invalid;
/* Type */
ND_TCHECK_1(cp);
- type = *cp;
+ type = EXTRACT_U_1(cp);
cp += 1;
/* MBZ */
ND_TCHECK_1(cp);
- mbz = *cp;
+ mbz = EXTRACT_U_1(cp);
cp += 1;
/* Length */
ND_TCHECK_2(cp);
cp += 1;
/* Version */
ND_TCHECK_1(cp);
- version = *cp;
+ version = EXTRACT_U_1(cp);
cp += 1;
switch (version) {
case AHCP_VERSION_1: {
* and then fetch it.
*/
ND_TCHECK_1(dat);
- msg_type = *dat;
+ msg_type = EXTRACT_U_1(dat);
ND_PRINT((ndo, " aodv"));
switch (msg_type) {
cp += 1;
/* Dir Count */
ND_TCHECK_1(cp);
- dircount = *cp;
+ dircount = EXTRACT_U_1(cp);
cp += 1;
ND_PRINT((ndo, ", Dir Count: %u", dircount));
if (AOEV1_MAC_ARG_LEN + dircount * 8 > len)
cp += 1;
/* NMacs (correlated with the length) */
ND_TCHECK_1(cp);
- nmacs = *cp;
+ nmacs = EXTRACT_U_1(cp);
cp += 1;
ND_PRINT((ndo, ", NMacs: %u", nmacs));
if (AOEV1_RESERVE_ARG_LEN + nmacs * ETHER_ADDR_LEN != len)
cp += 1;
/* Command */
ND_TCHECK_1(cp);
- command = *cp;
+ command = EXTRACT_U_1(cp);
cp += 1;
ND_PRINT((ndo, ", Command: %s", tok2str(cmdcode_str, "Unknown (0x%02x)", command)));
/* Tag */
/*
* Resolve the MD fields.
*/
- md_nameformat = *namesp;
+ md_nameformat = EXTRACT_U_1(namesp);
namesp++;
names_data_remaining--; /* We know this is != 0 */
if (md_nameformat != CFM_CCM_MD_FORMAT_NONE) {
- md_namelength = *namesp;
+ md_namelength = EXTRACT_U_1(namesp);
namesp++;
names_data_remaining--; /* We know this is !=0 */
ND_PRINT((ndo, "\n\t MD Name Format %s (%u), MD Name length %u",
/*
* Resolve the MA fields.
*/
- ma_nameformat = *namesp;
+ ma_nameformat = EXTRACT_U_1(namesp);
namesp++;
names_data_remaining--; /* We know this is != 0 */
- ma_namelength = *namesp;
+ ma_namelength = EXTRACT_U_1(namesp);
namesp++;
names_data_remaining--; /* We know this is != 0 */
ND_PRINT((ndo, "\n\t MA Name-Format %s (%u), MA name length %u",
switch (eap->type) {
case EAP_FRAME_TYPE_PACKET:
ND_TCHECK_1(tptr);
- type = *(tptr);
+ type = EXTRACT_U_1(tptr);
ND_TCHECK_2(tptr + 2);
len = EXTRACT_BE_U_2(tptr + 2);
ND_PRINT((ndo, ", %s (%u), id %u, len %u",
int tt;
ND_TCHECK_1(cp);
- tt = *cp;
+ tt = EXTRACT_U_1(cp);
if (tt == IPOPT_EOL)
break;
else if (tt == IPOPT_NOP)
sep = ",";
ND_TCHECK_1(cp);
- option_code = *cp;
+ option_code = EXTRACT_U_1(cp);
ND_PRINT((ndo, "%s",
tok2str(ip_option_values,"unknown %u",option_code)));
ND_PRINT((ndo, "[|AH]"));
break;
}
- ipds->nh = *ipds->cp;
+ ipds->nh = EXTRACT_U_1(ipds->cp);
ipds->advance = ah_print(ndo, ipds->cp);
if (ipds->advance <= 0)
break;
*/
ND_TCHECK_2(cp);
advance = (EXTRACT_U_1(cp + 1) + 1) << 3;
- nh = *cp;
+ nh = EXTRACT_U_1(cp);
break;
case IPPROTO_FRAGMENT:
*/
ND_TCHECK_1(cp);
advance = sizeof(struct ip6_frag);
- nh = *cp;
+ nh = EXTRACT_U_1(cp);
break;
case IPPROTO_ROUTING:
ND_TCHECK_3(sp);
/* See if we think we're at the beginning of a compound packet */
- type = *sp;
+ type = EXTRACT_U_1(sp);
len = EXTRACT_BE_U_2(sp + 1);
if (len > 1500 || len < 3 || type == 0 || type > MSDP_TYPE_MAX)
goto trunc; /* not really truncated, but still not decodable */
ND_PRINT((ndo, " msdp:"));
while (length > 0) {
ND_TCHECK_3(sp);
- type = *sp;
+ type = EXTRACT_U_1(sp);
len = EXTRACT_BE_U_2(sp + 1);
if (len > 1400 || ndo->ndo_vflag)
ND_PRINT((ndo, " [len %u]", len));
cp += 1;
/* nw_proto */
ND_TCHECK_1(cp);
- nw_proto = *cp;
+ nw_proto = EXTRACT_U_1(cp);
cp += 1;
if (! (wildcards & OFPFW_NW_PROTO)) {
field_name = ! (wildcards & OFPFW_DL_TYPE) && dl_type == ETHERTYPE_ARP
goto invalid;
/* version */
ND_TCHECK_1(cp);
- version = *cp;
+ version = EXTRACT_U_1(cp);
cp += 1;
/* type */
ND_TCHECK_1(cp);
- type = *cp;
+ type = EXTRACT_U_1(cp);
cp += 1;
/* length */
ND_TCHECK_2(cp);
ND_TCHECK2(*p, tag_len);
for (v = p; v < p + tag_len && tag_str_len < MAXTAGPRINT-1; v++)
if (*v >= 32 && *v < 127) {
- tag_str[tag_str_len++] = *v;
+ tag_str[tag_str_len++] = EXTRACT_U_1(v);
ascii_count++;
} else {
tag_str[tag_str_len++] = '.';
while (length >= 2) {
ND_TCHECK_2(data);
- vendor_type = *(data);
+ vendor_type = EXTRACT_U_1(data);
vendor_length = EXTRACT_U_1(data + 1);
if (vendor_length < 2)
if (obj_tlen < 4)
return 0;
- parameter_id = *(tptr);
+ parameter_id = EXTRACT_U_1(tptr);
ND_TCHECK_2(tptr + 2);
parameter_length = EXTRACT_BE_U_2(tptr + 2)<<2; /* convert wordcount to bytecount */
if (len < 1)
goto tooshort;
ND_TCHECK_1(pptr);
- subtype = *pptr;
+ subtype = EXTRACT_U_1(pptr);
/*
* Sanity checking of the header.
return -1;
}
ND_TCHECK_1(p);
- elem->asnlen = *p;
+ elem->asnlen = EXTRACT_U_1(p);
p++; len--; hdr++;
if (elem->asnlen & ASN_BIT8) {
uint32_t noct = elem->asnlen % ASN_BIT8;
while (tptr < (pptr+length)) {
ND_TCHECK_1(tptr);
- len = *tptr;
+ len = EXTRACT_U_1(tptr);
if (len == 0)
break;
if (len < 2)
goto trunc;
ND_TCHECK_2(tptr);
- type = *tptr;
+ type = EXTRACT_U_1(tptr);
tlv_len = EXTRACT_U_1(tptr + 1);
ND_PRINT((ndo, "\n\t\t%s (0x%04x) TLV",
ND_TCHECK2(*bp, VXLAN_GPE_HDR_LEN);
- flags = *bp;
+ flags = EXTRACT_U_1(bp);
bp += 3;
- next_protocol = *bp;
+ next_protocol = EXTRACT_U_1(bp);
bp += 1;
vni = EXTRACT_BE_U_3(bp);
ND_TCHECK2(*bp, VXLAN_HDR_LEN);
- flags = *bp;
+ flags = EXTRACT_U_1(bp);
bp += 4;
vni = EXTRACT_BE_U_3(bp);
return(NULL); /* name goes past the end of the buffer */
ND_TCHECK_1(p);
- c = *p;
+ c = EXTRACT_U_1(p);
/* XXX - this should use the same code that the DNS dissector does */
if ((c & 0xC0) == 0xC0) {
if (s >= maxbuf)
return(-1); /* name goes past the end of the buffer */
ND_TCHECK_1(s);
- c = *s;
+ c = EXTRACT_U_1(s);
if ((c & 0xC0) == 0xC0)
return(2);
while (*s) {