]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-zephyr.c
Always define check_and_add_compiler_option().
[tcpdump] / print-zephyr.c
index 8bf7fb52de3c80fac20aa398ea8c994d996af117..10aaf2166ce99aaa269bfcaee187096775c44c4c 100644 (file)
 /* \summary: Zephyr printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -134,7 +134,7 @@ str_to_lower(const char *string)
 
     zb_string = z_buf;
     while (*zb_string) {
-       *zb_string = tolower((unsigned char)(*zb_string));
+       *zb_string = ND_TOLOWER((unsigned char)(*zb_string));
        zb_string++;
     }
 
@@ -144,13 +144,32 @@ str_to_lower(const char *string)
 void
 zephyr_print(netdissect_options *ndo, const u_char *cp, int length)
 {
-    struct z_packet z = {0};
+    struct z_packet z = {
+        NULL,  /* version */
+        0,     /* numfields */
+        0,     /* kind */
+        NULL,  /* uid */
+        0,     /* port */
+        0,     /* auth */
+        0,     /* authlen */
+        NULL,  /* authdata */
+        NULL,  /* class */
+        NULL,  /* inst */
+        NULL,  /* opcode */
+        NULL,  /* sender */
+        NULL,  /* recipient */
+        NULL,  /* format */
+        0,     /* cksum */
+        0,     /* multi */
+        NULL   /* multi_uid */
+    };
     const char *parse = (const char *) cp;
     int parselen = length;
     const char *s;
     int lose = 0;
     int truncated = 0;
 
+    ndo->ndo_protocol = "zephyr";
     /* squelch compiler warnings */
 
 #define PARSE_STRING                                           \
@@ -324,6 +343,6 @@ zephyr_print(netdissect_options *ndo, const u_char *cp, int length)
     return;
 
 trunc:
-    ND_PRINT(" [|zephyr] (%d)", length);
+    nd_print_trunc(ndo);
     return;
 }