]> The Tcpdump Group git mirrors - tcpdump/blobdiff - netdissect.h
DNS: Sync types with IANA
[tcpdump] / netdissect.h
index 37cce592b3469f784cf00a2fe7be6675806f48ac..5c16be660cd3e185f5d6de411e0d3ca42c15fed7 100644 (file)
@@ -31,6 +31,8 @@
 #include <sys/types.h>
 #include <setjmp.h>
 #include "status-exit-codes.h"
+#include "funcattrs.h" /* for PRINTFLIKE_FUNCPTR() */
+#include "diag-control.h" /* for ND_UNREACHABLE */
 
 /*
  * Data types corresponding to multi-byte integral values within data
@@ -175,7 +177,7 @@ typedef void (*if_printer) IF_PRINTER_ARGS;
  * buffer, we free the current buffer and pop the previous one off the
  * stack.
  *
- * A buffer has a beginnning and end pointer, and a link to the previous
+ * A buffer has a beginning and end pointer, and a link to the previous
  * buffer on the stack.
  *
  * In other cases, we temporarily adjust the snapshot end to reflect a
@@ -260,13 +262,26 @@ struct netdissect_options {
                      PRINTFLIKE_FUNCPTR(2, 3);
 };
 
-extern int nd_push_buffer(netdissect_options *, u_char *, const u_char *,
-    const u_char *);
-extern int nd_push_snapend(netdissect_options *, const u_char *);
-extern void nd_change_snapend(netdissect_options *, const u_char *);
+extern WARN_UNUSED_RESULT int nd_push_buffer(netdissect_options *, u_char *, const u_char *, const u_int);
+extern WARN_UNUSED_RESULT int nd_push_snaplen(netdissect_options *, const u_char *, const u_int);
+extern void nd_change_snaplen(netdissect_options *, const u_char *, const u_int);
 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 */
@@ -429,7 +444,7 @@ extern void txtproto_print(netdissect_options *, const u_char *, u_int,
     (defined(__s390__) || defined(__s390x__) || defined(__zarch__)) || \
     defined(__vax__)
 /*
- * The procesor natively handles unaligned loads, so just use memcpy()
+ * The processor natively handles unaligned loads, so just use memcpy()
  * and memcmp(), to enable those optimizations.
  *
  * XXX - are those all the x86 tests we need?
@@ -488,9 +503,9 @@ extern void ap1394_if_print IF_PRINTER_ARGS;
 extern void arcnet_if_print IF_PRINTER_ARGS;
 extern void arcnet_linux_if_print IF_PRINTER_ARGS;
 extern void atm_if_print IF_PRINTER_ARGS;
-extern void bt_if_print IF_PRINTER_ARGS;
 extern void brcm_tag_if_print IF_PRINTER_ARGS;
 extern void brcm_tag_prepend_if_print IF_PRINTER_ARGS;
+extern void bt_if_print IF_PRINTER_ARGS;
 extern void chdlc_if_print IF_PRINTER_ARGS;
 extern void cip_if_print IF_PRINTER_ARGS;
 extern void dsa_if_print IF_PRINTER_ARGS;
@@ -505,8 +520,8 @@ extern void ieee802_11_radio_if_print IF_PRINTER_ARGS;
 extern void ieee802_15_4_if_print IF_PRINTER_ARGS;
 extern void ieee802_15_4_tap_if_print IF_PRINTER_ARGS;
 extern void ipfc_if_print IF_PRINTER_ARGS;
-extern void ipoib_if_print IF_PRINTER_ARGS;
 extern void ipnet_if_print IF_PRINTER_ARGS;
+extern void ipoib_if_print IF_PRINTER_ARGS;
 extern void juniper_atm1_if_print IF_PRINTER_ARGS;
 extern void juniper_atm2_if_print IF_PRINTER_ARGS;
 extern void juniper_chdlc_if_print IF_PRINTER_ARGS;
@@ -539,8 +554,8 @@ extern void prism_if_print IF_PRINTER_ARGS;
 extern void raw_if_print IF_PRINTER_ARGS;
 extern void sl_bsdos_if_print IF_PRINTER_ARGS;
 extern void sl_if_print IF_PRINTER_ARGS;
-extern void sll_if_print IF_PRINTER_ARGS;
 extern void sll2_if_print IF_PRINTER_ARGS;
+extern void sll_if_print IF_PRINTER_ARGS;
 extern void sunatm_if_print IF_PRINTER_ARGS;
 extern void symantec_if_print IF_PRINTER_ARGS;
 extern void token_if_print IF_PRINTER_ARGS;
@@ -721,11 +736,12 @@ extern void udld_print(netdissect_options *, const u_char *, u_int);
 extern void udp_print(netdissect_options *, const u_char *, u_int, const u_char *, int, u_int);
 extern int vjc_print(netdissect_options *, const u_char *, u_short);
 extern void vqp_print(netdissect_options *, const u_char *, u_int);
-extern void vrrp_print(netdissect_options *, const u_char *, u_int, const u_char *, int);
+extern void vrrp_print(netdissect_options *, const u_char *, u_int, const u_char *, int, int);
 extern void vtp_print(netdissect_options *, const u_char *, const u_int);
 extern void vxlan_gpe_print(netdissect_options *, const u_char *, u_int);
 extern void vxlan_print(netdissect_options *, const u_char *, u_int);
 extern void wb_print(netdissect_options *, const u_char *, u_int);
+extern void whois_print(netdissect_options *, const u_char *, u_int);
 extern void zep_print(netdissect_options *, const u_char *, u_int);
 extern void zephyr_print(netdissect_options *, const u_char *, u_int);
 extern void zmtp1_print(netdissect_options *, const u_char *, u_int);