summaryrefslogtreecommitdiff
path: root/print-pppoe.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-pppoe.c
parent8ab5c3a4e75a3ce8da691cd6ca6a9945082827af (diff)
downloadtcpdump-e2982e7f6f0b624a773ec5a58885ee80fab46d34.tar.gz
Update ND_PRINT() as a variadic macro
Diffstat (limited to 'print-pppoe.c')
-rw-r--r--print-pppoe.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/print-pppoe.c b/print-pppoe.c
index fe108396..189e1b8a 100644
--- a/print-pppoe.c
+++ b/print-pppoe.c
@@ -98,7 +98,7 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length)
const u_char *pppoe_packet, *pppoe_payload;
if (length < PPPOE_HDRLEN) {
- ND_PRINT((ndo, "truncated-pppoe %u", length));
+ ND_PRINT("truncated-pppoe %u", length);
return (length);
}
length -= PPPOE_HDRLEN;
@@ -112,22 +112,22 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length)
pppoe_payload = pppoe_packet + PPPOE_HDRLEN;
if (pppoe_ver != 1) {
- ND_PRINT((ndo, " [ver %d]",pppoe_ver));
+ ND_PRINT(" [ver %d]",pppoe_ver);
}
if (pppoe_type != 1) {
- ND_PRINT((ndo, " [type %d]",pppoe_type));
+ ND_PRINT(" [type %d]",pppoe_type);
}
- ND_PRINT((ndo, "PPPoE %s", tok2str(pppoecode2str, "PAD-%x", pppoe_code)));
+ ND_PRINT("PPPoE %s", tok2str(pppoecode2str, "PAD-%x", pppoe_code));
if (pppoe_code == PPPOE_PADI && pppoe_length > 1484 - PPPOE_HDRLEN) {
- ND_PRINT((ndo, " [len %u!]",pppoe_length));
+ ND_PRINT(" [len %u!]",pppoe_length);
}
if (pppoe_length > length) {
- ND_PRINT((ndo, " [len %u > %u!]", pppoe_length, length));
+ ND_PRINT(" [len %u > %u!]", pppoe_length, length);
pppoe_length = length;
}
if (pppoe_sessionid) {
- ND_PRINT((ndo, " [ses 0x%x]", pppoe_sessionid));
+ ND_PRINT(" [ses 0x%x]", pppoe_sessionid);
}
if (pppoe_code) {
@@ -166,24 +166,24 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length)
tag_str[tag_str_len] = 0;
if (ascii_count > garbage_count) {
- ND_PRINT((ndo, " [%s \"%*.*s\"]",
+ ND_PRINT(" [%s \"%*.*s\"]",
tok2str(pppoetag2str, "TAG-0x%x", tag_type),
(int)tag_str_len,
(int)tag_str_len,
- tag_str));
+ tag_str);
} else {
/* Print hex, not fast to abuse printf but this doesn't get used much */
- ND_PRINT((ndo, " [%s 0x", tok2str(pppoetag2str, "TAG-0x%x", tag_type)));
+ ND_PRINT(" [%s 0x", tok2str(pppoetag2str, "TAG-0x%x", tag_type));
for (v=p; v<p+tag_len; v++) {
- ND_PRINT((ndo, "%02X", EXTRACT_U_1(v)));
+ ND_PRINT("%02X", EXTRACT_U_1(v));
}
- ND_PRINT((ndo, "]"));
+ ND_PRINT("]");
}
} else
- ND_PRINT((ndo, " [%s]", tok2str(pppoetag2str,
- "TAG-0x%x", tag_type)));
+ ND_PRINT(" [%s]", tok2str(pppoetag2str,
+ "TAG-0x%x", tag_type));
p += tag_len;
/* p points to next tag */
@@ -191,11 +191,11 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length)
return (0);
} else {
/* PPPoE data */
- ND_PRINT((ndo, " "));
+ ND_PRINT(" ");
return (PPPOE_HDRLEN + ppp_print(ndo, pppoe_payload, pppoe_length));
}
trunc:
- ND_PRINT((ndo, "[|pppoe]"));
+ ND_PRINT("[|pppoe]");
return (PPPOE_HDRLEN);
}