]> The Tcpdump Group git mirrors - tcpdump/blobdiff - netdissect.h
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / netdissect.h
index fde2ea4856b80c2a7b1262315b274564b8be1d36..ca2b566537d38b4bcf4fcabf03f5a12bf6e8d873 100644 (file)
@@ -386,9 +386,15 @@ NORETURN void nd_trunc_longjmp(netdissect_options *ndo);
 
 /* Bail out if "l" bytes from "p" were not captured */
 #ifdef ND_LONGJMP_FROM_TCHECK
-#define ND_TCHECK_LEN(p, l) if (!ND_TTEST_LEN(p, l)) nd_trunc_longjmp(ndo)
+#define ND_TCHECK_LEN(p, l) \
+do { \
+if (!ND_TTEST_LEN(p, l)) nd_trunc_longjmp(ndo); \
+} while (0)
 #else
-#define ND_TCHECK_LEN(p, l) if (!ND_TTEST_LEN(p, l)) goto trunc
+#define ND_TCHECK_LEN(p, l) \
+do { \
+if (!ND_TTEST_LEN(p, l)) goto trunc; \
+} while (0)
 #endif
 
 /* Bail out if "*(p)" was not captured */
@@ -410,10 +416,12 @@ NORETURN void nd_trunc_longjmp(netdissect_options *ndo);
  * a custom message, format %u
  */
 #define ND_ICHECKMSG_U(message, expression_1, operator, expression_2) \
+do { \
 if ((expression_1) operator (expression_2)) { \
 ND_PRINT(" [%s %u %s %u]", (message), (expression_1), (#operator), (expression_2)); \
 goto invalid; \
-}
+} \
+} while (0)
 
 /*
  * Check (expression_1 operator expression_2) for invalid packet with
@@ -427,10 +435,12 @@ ND_ICHECKMSG_U((#expression_1), (expression_1), operator, (expression_2))
  * a custom message, format %zu
  */
 #define ND_ICHECKMSG_ZU(message, expression_1, operator, expression_2) \
+do { \
 if ((expression_1) operator (expression_2)) { \
 ND_PRINT(" [%s %u %s %zu]", (message), (expression_1), (#operator), (expression_2)); \
 goto invalid; \
-}
+} \
+} while (0)
 
 /*
  * Check (expression_1 operator expression_2) for invalid packet with
@@ -455,6 +465,7 @@ extern u_int nd_printztn(netdissect_options *, const u_char *, u_int, const u_ch
 extern int nd_printn(netdissect_options *, const u_char *, u_int, const u_char *);
 extern void nd_printjn(netdissect_options *, const u_char *, u_int);
 extern void nd_printjnp(netdissect_options *, const u_char *, u_int);
+extern void nd_print_bytes_hex(netdissect_options *, const u_char *, u_int);
 
 /*
  * Flags for txtproto_print().
@@ -642,8 +653,8 @@ extern void eap_print(netdissect_options *, const u_char *, const u_int);
 extern void eapol_print(netdissect_options *, const u_char *);
 extern void egp_print(netdissect_options *, const u_char *, u_int);
 extern void eigrp_print(netdissect_options *, const u_char *, u_int);
-extern void erspan_print_i_ii(netdissect_options *, uint16_t, const u_char *, u_int);
-extern void erspan_print_iii(netdissect_options *, const u_char *, u_int);
+extern void erspan_i_ii_print(netdissect_options *, uint16_t, const u_char *, u_int);
+extern void erspan_iii_print(netdissect_options *, const u_char *, u_int);
 extern void esp_print(netdissect_options *, const u_char *, u_int, const u_char *, u_int, int, u_int);
 extern u_int ether_print(netdissect_options *, const u_char *, u_int, u_int, void (*)(netdissect_options *, const u_char *), const u_char *);
 extern u_int ether_switch_tag_print(netdissect_options *, const u_char *, u_int, u_int, void (*)(netdissect_options *, const u_char *), u_int);