]> The Tcpdump Group git mirrors - tcpdump/blobdiff - netdissect.c
Revert "autotools: don't link with -lcrypto twice."
[tcpdump] / netdissect.c
index 61aa2c2b4931df7f331f24795b8b404212a4e4e3..548989b76545f74960d908199cb8be1763e4cfa5 100644 (file)
@@ -22,9 +22,7 @@
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 #include "netdissect.h"
 #include <smi.h>
 #endif
 
+#ifdef _AIX
+#include "diag-control.h"
+#endif /* _AIX */
+
 /*
  * Initialize anything that must be initialized before dissecting
  * packets.
@@ -81,7 +83,7 @@ nd_init(char *errbuf, size_t errbuf_size)
 }
 
 /*
- * Clean up anything that ndo_init() did.
+ * Clean up anything that nd_init() did.
  */
 void
 nd_cleanup(void)
@@ -149,7 +151,7 @@ nd_smi_version_string(void)
 
 int
 nd_push_buffer(netdissect_options *ndo, u_char *new_buffer,
-              const u_char *new_packetp, u_int newlen)
+              const u_char *new_packetp, const u_int newlen)
 {
        struct netdissect_saved_packet_info *ndspi;
 
@@ -182,7 +184,7 @@ nd_push_buffer(netdissect_options *ndo, u_char *new_buffer,
  *    set the snapshot end to that new value.
  */
 int
-nd_push_snaplen(netdissect_options *ndo, const u_char *bp, u_int newlen)
+nd_push_snaplen(netdissect_options *ndo, const u_char *bp, const u_int newlen)
 {
        struct netdissect_saved_packet_info *ndspi;
        u_int snaplen_remaining;
@@ -242,7 +244,7 @@ nd_push_snaplen(netdissect_options *ndo, const u_char *bp, u_int newlen)
  * atop which the current one was pushed, however.
  */
 void
-nd_change_snaplen(netdissect_options *ndo, const u_char *bp, u_int newlen)
+nd_change_snaplen(netdissect_options *ndo, const u_char *bp, const u_int newlen)
 {
        struct netdissect_saved_packet_info *ndspi;
        const u_char *previous_snapend;
@@ -299,3 +301,17 @@ nd_pop_all_packet_info(netdissect_options *ndo)
        while (ndo->ndo_packet_info_stack != NULL)
                nd_pop_packet_info(ndo);
 }
+
+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_NOT_REACHABLE
+#endif /* _AIX */
+}