From e2982e7f6f0b624a773ec5a58885ee80fab46d34 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Sun, 7 Jan 2018 11:47:30 +0100 Subject: Update ND_PRINT() as a variadic macro --- print-pppoe.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'print-pppoe.c') 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