]> The Tcpdump Group git mirrors - tcpdump/blobdiff - util-print.c
Translate UDP/1700 as RADIUS
[tcpdump] / util-print.c
index f11155ad2eb42664887546c78ae56441346ba781..bcb143373237926029d04ff45e8b2409a4398f56 100644 (file)
@@ -66,6 +66,23 @@ int32_t thiszone;            /* seconds offset from gmt to local time */
 
 #define TOKBUFSIZE 128
 
+/*
+ * Print out a character, filtering out the non-printable ones
+ */
+void
+fn_print_char(netdissect_options *ndo, u_char c)
+{
+       if (!ND_ISASCII(c)) {
+               c = ND_TOASCII(c);
+               ND_PRINT((ndo, "M-"));
+       }
+       if (!ND_ISPRINT(c)) {
+               c ^= 0x40;      /* DEL to ?, others to alpha */
+               ND_PRINT((ndo, "^"));
+       }
+       ND_PRINT((ndo, "%c", c));
+}
+
 /*
  * Print out a null-terminated filename (or other ascii string).
  * If ep is NULL, assume no truncation check is needed.