]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-syslog.c
DCCP: Fix printing "Timestamp" and "Timestamp Echo" options
[tcpdump] / print-syslog.c
index cdb81148063d3369a7d577b59e3eaad56e381512..0c5005b35605651d1589baf5d6de23536507caf1 100644 (file)
@@ -25,7 +25,6 @@
 #include "netdissect.h"
 #include "extract.h"
 
-static const char tstr[] = "[|syslog]";
 
 /*
  * tokenlists and #defines taken from Ethereal - Network traffic analyzer
@@ -84,6 +83,7 @@ syslog_print(netdissect_options *ndo,
     uint16_t pri = 0;
     uint16_t facility,severity;
 
+    ndo->ndo_protocol = "syslog";
     /* extract decimal figures that are
      * encapsulated within < > tags
      * based on this decimal figure extract the
@@ -102,12 +102,12 @@ syslog_print(netdissect_options *ndo,
             ND_TCHECK_1(pptr + msg_off);
         }
         if (EXTRACT_U_1(pptr + msg_off) != '>') {
-            ND_PRINT("%s", tstr);
+            nd_print_trunc(ndo);
             return;
         }
         msg_off++;
     } else {
-        ND_PRINT("%s", tstr);
+        nd_print_trunc(ndo);
         return;
     }
 
@@ -133,7 +133,7 @@ syslog_print(netdissect_options *ndo,
     /* print the syslog text in verbose mode */
     for (; msg_off < len; msg_off++) {
         ND_TCHECK_1(pptr + msg_off);
-        safeputchar(ndo, EXTRACT_U_1(pptr + msg_off));
+        fn_print_char(ndo, EXTRACT_U_1(pptr + msg_off));
     }
 
     if (ndo->ndo_vflag > 1)
@@ -142,5 +142,5 @@ syslog_print(netdissect_options *ndo,
     return;
 
 trunc:
-    ND_PRINT("%s", tstr);
+    nd_print_trunc(ndo);
 }