mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-23 10:04:05 +08:00
Use more the ND_TTEST_1() macro
This commit is contained in:
parent
09393e2faa
commit
1a04b92e36
12
print-fr.c
12
print-fr.c
@ -802,7 +802,7 @@ q933_print(netdissect_options *ndo,
|
||||
|
||||
ND_PRINT((ndo, "%s", ndo->ndo_eflag ? "" : "Q.933"));
|
||||
|
||||
if (length == 0 || !ND_TTEST(*p)) {
|
||||
if (length == 0 || !ND_TTEST_1(p)) {
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT((ndo, ", "));
|
||||
ND_PRINT((ndo, "length %u", length));
|
||||
@ -821,7 +821,7 @@ q933_print(netdissect_options *ndo,
|
||||
* Get the call reference value.
|
||||
*/
|
||||
for (i = 0; i < call_ref_length; i++) {
|
||||
if (length == 0 || !ND_TTEST(*p)) {
|
||||
if (length == 0 || !ND_TTEST_1(p)) {
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT((ndo, ", "));
|
||||
ND_PRINT((ndo, "length %u", olen));
|
||||
@ -835,7 +835,7 @@ q933_print(netdissect_options *ndo,
|
||||
/*
|
||||
* Get the message type.
|
||||
*/
|
||||
if (length == 0 || !ND_TTEST(*p)) {
|
||||
if (length == 0 || !ND_TTEST_1(p)) {
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT((ndo, ", "));
|
||||
ND_PRINT((ndo, "length %u", olen));
|
||||
@ -851,7 +851,7 @@ q933_print(netdissect_options *ndo,
|
||||
non_locking_shift = 0;
|
||||
unshift_codeset = codeset;
|
||||
if (length != 0) {
|
||||
if (!ND_TTEST(*p)) {
|
||||
if (!ND_TTEST_1(p)) {
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT((ndo, ", "));
|
||||
ND_PRINT((ndo, "length %u", olen));
|
||||
@ -952,7 +952,7 @@ q933_print(netdissect_options *ndo,
|
||||
/*
|
||||
* Get the first octet of the IE.
|
||||
*/
|
||||
if (!ND_TTEST(*p)) {
|
||||
if (!ND_TTEST_1(p)) {
|
||||
if (!ndo->ndo_vflag) {
|
||||
ND_PRINT((ndo, ", length %u", olen));
|
||||
}
|
||||
@ -995,7 +995,7 @@ q933_print(netdissect_options *ndo,
|
||||
/*
|
||||
* No. Get the IE length.
|
||||
*/
|
||||
if (length == 0 || !ND_TTEST(*p)) {
|
||||
if (length == 0 || !ND_TTEST_1(p)) {
|
||||
if (!ndo->ndo_vflag) {
|
||||
ND_PRINT((ndo, ", length %u", olen));
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ again:
|
||||
switch (ipds->nh) {
|
||||
|
||||
case IPPROTO_AH:
|
||||
if (!ND_TTEST(*ipds->cp)) {
|
||||
if (!ND_TTEST_1(ipds->cp)) {
|
||||
ND_PRINT((ndo, "[|AH]"));
|
||||
break;
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ struct isis_tlv_lsp {
|
||||
void
|
||||
isoclns_print(netdissect_options *ndo, const uint8_t *p, u_int length)
|
||||
{
|
||||
if (!ND_TTEST(*p)) { /* enough bytes on the wire ? */
|
||||
if (!ND_TTEST_1(p)) { /* enough bytes on the wire ? */
|
||||
ND_PRINT((ndo, "|OSI"));
|
||||
return;
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ pimv1_print(netdissect_options *ndo,
|
||||
ND_PRINT((ndo, " %s", tok2str(pimv1_type_str, "[type %u]", type)));
|
||||
switch (type) {
|
||||
case PIMV1_TYPE_QUERY:
|
||||
if (ND_TTEST(bp[8])) {
|
||||
if (ND_TTEST_1(bp + 8)) {
|
||||
switch (EXTRACT_U_1(bp + 8) >> 4) {
|
||||
case 0:
|
||||
ND_PRINT((ndo, " Dense-mode"));
|
||||
|
@ -1410,7 +1410,7 @@ ppp_hdlc(netdissect_options *ndo,
|
||||
* Do this so that we dont overwrite the original packet
|
||||
* contents.
|
||||
*/
|
||||
for (s = p, t = b, i = length; i != 0 && ND_TTEST(*s); i--) {
|
||||
for (s = p, t = b, i = length; i != 0 && ND_TTEST_1(s); i--) {
|
||||
c = EXTRACT_U_1(s);
|
||||
s++;
|
||||
if (c == 0x7d) {
|
||||
|
@ -691,7 +691,7 @@ fetch_token(netdissect_options *ndo, const u_char *pptr, u_int idx, u_int len,
|
||||
size_t toklen = 0;
|
||||
|
||||
for (; idx < len; idx++) {
|
||||
if (!ND_TTEST(*(pptr + idx))) {
|
||||
if (!ND_TTEST_1(pptr + idx)) {
|
||||
/* ran past end of captured data */
|
||||
return (0);
|
||||
}
|
||||
@ -725,7 +725,7 @@ fetch_token(netdissect_options *ndo, const u_char *pptr, u_int idx, u_int len,
|
||||
* an end-of-line (CR or LF).
|
||||
*/
|
||||
for (; idx < len; idx++) {
|
||||
if (!ND_TTEST(*(pptr + idx))) {
|
||||
if (!ND_TTEST_1(pptr + idx)) {
|
||||
/* ran past end of captured data */
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user