]> The Tcpdump Group git mirrors - tcpdump/blobdiff - netdissect.h
Makefile.in: don't remove configure and config.h.in in make distclean.
[tcpdump] / netdissect.h
index a10ffa3b6b566e765ed628f465cde1680dbf1a86..d953a464ea112172acfb5472d8763ed1380f6eec 100644 (file)
@@ -32,6 +32,7 @@
 #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
@@ -176,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
@@ -262,13 +263,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 */
@@ -423,6 +437,9 @@ extern void ts_print(netdissect_options *, const struct timeval *);
 extern void signed_relts_print(netdissect_options *, int32_t);
 extern void unsigned_relts_print(netdissect_options *, uint32_t);
 
+extern const char *nd_format_time(char *buf, size_t bufsize,
+    const char *format, const struct tm *timeptr);
+
 extern void fn_print_char(netdissect_options *, u_char);
 extern void fn_print_str(netdissect_options *, const u_char *);
 extern u_int nd_printztn(netdissect_options *, const u_char *, u_int, const u_char *);
@@ -445,7 +462,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?
@@ -603,7 +620,7 @@ extern void calm_fast_print(netdissect_options *, const u_char *, u_int, const s
 extern void carp_print(netdissect_options *, const u_char *, u_int, u_int);
 extern void cdp_print(netdissect_options *, const u_char *, u_int);
 extern void cfm_print(netdissect_options *, const u_char *, u_int);
-extern u_int chdlc_print(netdissect_options *, const u_char *, u_int);
+extern void chdlc_print(netdissect_options *, const u_char *, u_int);
 extern void cisco_autorp_print(netdissect_options *, const u_char *, u_int);
 extern void cnfp_print(netdissect_options *, const u_char *);
 extern void dccp_print(netdissect_options *, const u_char *, const u_char *, u_int);
@@ -710,9 +727,9 @@ extern void resp_print(netdissect_options *, const u_char *, u_int);
 extern void rip_print(netdissect_options *, const u_char *, u_int);
 extern void ripng_print(netdissect_options *, const u_char *, unsigned int);
 extern void rpki_rtr_print(netdissect_options *, const u_char *, u_int);
-extern void rrcp_print(netdissect_options *, const u_char *, u_int, const struct lladdr_info *, const struct lladdr_info *);
 extern void rsvp_print(netdissect_options *, const u_char *, u_int);
 extern int rt6_print(netdissect_options *, const u_char *, const u_char *);
+extern void rtl_print(netdissect_options *, const u_char *, u_int, const struct lladdr_info *, const struct lladdr_info *);
 extern void rtsp_print(netdissect_options *, const u_char *, u_int);
 extern void rx_print(netdissect_options *, const u_char *, u_int, uint16_t, uint16_t, const u_char *);
 extern void sctp_print(netdissect_options *, const u_char *, const u_char *, u_int);
@@ -750,7 +767,6 @@ extern void zmtp1_datagram_print(netdissect_options *, const u_char *, const u_i
 extern void zmtp1_print(netdissect_options *, const u_char *, u_int);
 
 /* checksum routines */
-extern void init_checksum(void);
 extern uint16_t verify_crc10_cksum(uint16_t, const u_char *, int);
 extern uint16_t create_osi_cksum(const uint8_t *, int, int);