#include "ascii_strcasecmp.h"
#include "timeval-operations.h"
-/* invalid string to print '(invalid)' for malformed or corrupted packets */
-const char istr[] = " (invalid)";
-
#define TOKBUFSIZE 128
-
enum date_flag { WITHOUT_DATE = 0, WITH_DATE = 1 };
enum time_flag { UTC_TIME = 0, LOCAL_TIME = 1 };
static void
ts_unix_print(netdissect_options *ndo, int sec, int usec)
{
+ if ((unsigned)sec & 0x80000000) {
+ ND_PRINT("[Error converting time]");
+ return;
+ }
+
ND_PRINT("%u", (unsigned)sec);
ts_frac_print(ndo, usec);
}
ND_PRINT(" [|%s]", ndo->ndo_protocol);
}
+/* Print the invalid string */
+void nd_print_invalid(netdissect_options *ndo)
+{
+ ND_PRINT(" (invalid)");
+}
+
/*
* this is a generic routine for printing unknown data;
* we pass on the linefeed plus indentation string to
/* Capitalize the protocol name */
for (pnp = protoname; *pnp != '\0'; pnp++)
- ND_PRINT("%c", toupper((u_char)*pnp));
+ ND_PRINT("%c", ND_TOUPPER((u_char)*pnp));
if (print_this) {
/*