]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Move nd_trunc_longjmp() to netdissect.h with the other nd_ functions.
authorGuy Harris <[email protected]>
Mon, 28 Mar 2022 19:44:50 +0000 (12:44 -0700)
committerGuy Harris <[email protected]>
Mon, 28 Mar 2022 19:44:50 +0000 (12:44 -0700)
It's not particularly tied to the data-extraction functions; this makes
it available elsewhere.

extract.h
netdissect.h

index c355c4d97be554c804cdf51fbb079202ffb1a84b..685fe95ec25f106947b30416a838ea508f07badb 100644 (file)
--- a/extract.h
+++ b/extract.h
@@ -576,20 +576,6 @@ EXTRACT_IPV4_TO_NETWORK_ORDER(const void *p)
 #define ND_TTEST_16(p) ND_TTEST_LEN((p), 16)
 #define ND_TCHECK_16(p) ND_TCHECK_LEN((p), 16)
 
-static inline NORETURN void
-nd_trunc_longjmp(netdissect_options *ndo)
-{
-       longjmp(ndo->ndo_early_end, ND_TRUNCATED);
-#ifdef _AIX
-       /*
-        * In AIX <setjmp.h> decorates longjmp() with "#pragma leaves", which tells
-        * XL C that the function is noreturn, but GCC remains unaware of that and
-        * yields a "'noreturn' function does return" warning.
-        */
-       ND_UNREACHABLE
-#endif /* _AIX */
-}
-
 /* get_u_1 and get_s_1 */
 
 static inline uint8_t
index 867be794032c78e84fe1f85258faf6ff35557f20..e2b778601bc5d87010340d49bb91c0fb67203832 100644 (file)
@@ -269,6 +269,20 @@ extern void nd_change_snapend(netdissect_options *, const u_char *);
 extern void nd_pop_packet_info(netdissect_options *);
 extern void nd_pop_all_packet_info(netdissect_options *);
 
+static inline NORETURN void
+nd_trunc_longjmp(netdissect_options *ndo)
+{
+       longjmp(ndo->ndo_early_end, ND_TRUNCATED);
+#ifdef _AIX
+       /*
+        * In AIX <setjmp.h> decorates longjmp() with "#pragma leaves", which tells
+        * XL C that the function is noreturn, but GCC remains unaware of that and
+        * yields a "'noreturn' function does return" warning.
+        */
+       ND_UNREACHABLE
+#endif /* _AIX */
+}
+
 #define PT_VAT         1       /* Visual Audio Tool */
 #define PT_WB          2       /* distributed White Board */
 #define PT_RPC         3       /* Remote Procedure Call */