summaryrefslogtreecommitdiff
path: root/print-nsh.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-01-07 11:47:30 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-01-07 13:36:41 +0100
commite2982e7f6f0b624a773ec5a58885ee80fab46d34 (patch)
tree52c8e511ccaff8ef09dc3337b213273865522162 /print-nsh.c
parent8ab5c3a4e75a3ce8da691cd6ca6a9945082827af (diff)
downloadtcpdump-e2982e7f6f0b624a773ec5a58885ee80fab46d34.tar.gz
Update ND_PRINT() as a variadic macro
Diffstat (limited to 'print-nsh.c')
-rw-r--r--print-nsh.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/print-nsh.c b/print-nsh.c
index 2734382c..0ad1364c 100644
--- a/print-nsh.c
+++ b/print-nsh.c
@@ -82,20 +82,20 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len)
service_index = EXTRACT_U_1(bp);
bp += 1;
- ND_PRINT((ndo, "NSH, "));
+ ND_PRINT("NSH, ");
if (ndo->ndo_vflag > 1) {
- ND_PRINT((ndo, "ver %d, ", ver));
+ ND_PRINT("ver %d, ", ver);
}
- ND_PRINT((ndo, "flags [%s], ", bittok2str_nosep(nsh_flags, "none", flags)));
+ ND_PRINT("flags [%s], ", bittok2str_nosep(nsh_flags, "none", flags));
if (ndo->ndo_vflag > 2) {
- ND_PRINT((ndo, "length %d, ", length));
- ND_PRINT((ndo, "md type 0x%x, ", md_type));
+ ND_PRINT("length %d, ", length);
+ ND_PRINT("md type 0x%x, ", md_type);
}
if (ndo->ndo_vflag > 1) {
- ND_PRINT((ndo, "next-protocol 0x%x, ", next_protocol));
+ ND_PRINT("next-protocol 0x%x, ", next_protocol);
}
- ND_PRINT((ndo, "service-path-id 0x%06x, ", service_path_id));
- ND_PRINT((ndo, "service-index 0x%x", service_index));
+ ND_PRINT("service-path-id 0x%06x, ", service_path_id);
+ ND_PRINT("service-index 0x%x", service_index);
/* Make sure we have all the headers */
if (len < length * NSH_HDR_WORD_SIZE)
@@ -119,7 +119,7 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len)
for (n = 0; n < length - 2; n++) {
ctx = EXTRACT_BE_U_4(bp);
bp += NSH_HDR_WORD_SIZE;
- ND_PRINT((ndo, "\n Context[%02d]: 0x%08x", n, ctx));
+ ND_PRINT("\n Context[%02d]: 0x%08x", n, ctx);
}
}
else if (md_type == 0x02) {
@@ -132,33 +132,33 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len)
tlv_len = EXTRACT_U_1(bp);
bp += 1;
- ND_PRINT((ndo, "\n TLV Class %d, Type %d, Len %d",
- tlv_class, tlv_type, tlv_len));
+ ND_PRINT("\n TLV Class %d, Type %d, Len %d",
+ tlv_class, tlv_type, tlv_len);
n += 1;
if (length - 2 < n + tlv_len) {
- ND_PRINT((ndo, " ERROR: invalid-tlv-length"));
+ ND_PRINT(" ERROR: invalid-tlv-length");
return;
}
for (vn = 0; vn < tlv_len; vn++) {
ctx = EXTRACT_BE_U_4(bp);
bp += NSH_HDR_WORD_SIZE;
- ND_PRINT((ndo, "\n Value[%02d]: 0x%08x", vn, ctx));
+ ND_PRINT("\n Value[%02d]: 0x%08x", vn, ctx);
}
n += tlv_len;
}
}
else {
- ND_PRINT((ndo, "ERROR: unknown-next-protocol"));
+ ND_PRINT("ERROR: unknown-next-protocol");
return;
}
}
else {
bp += (length - 2) * NSH_HDR_WORD_SIZE;
}
- ND_PRINT((ndo, ndo->ndo_vflag ? "\n " : ": "));
+ ND_PRINT(ndo->ndo_vflag ? "\n " : ": ");
/* print Next Protocol */
next_len = len - length * NSH_HDR_WORD_SIZE;
@@ -173,13 +173,13 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len)
ether_print(ndo, bp, next_len, ndo->ndo_snapend - bp, NULL, NULL);
break;
default:
- ND_PRINT((ndo, "ERROR: unknown-next-protocol"));
+ ND_PRINT("ERROR: unknown-next-protocol");
return;
}
return;
trunc:
- ND_PRINT((ndo, "%s", tstr));
+ ND_PRINT("%s", tstr);
}