X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e2982e7f6f0b624a773ec5a58885ee80fab46d34..878c29b576d3842ddbe105fd5362bf9d37c9c5f0:/print-zephyr.c?ds=sidebyside diff --git a/print-zephyr.c b/print-zephyr.c index 2addd388..3edbeea4 100644 --- a/print-zephyr.c +++ b/print-zephyr.c @@ -23,10 +23,10 @@ /* \summary: Zephyr printer */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif -#include +#include "netdissect-stdinc.h" #include #include @@ -119,7 +119,7 @@ z_triple(const char *class, const char *inst, const char *recipient) { if (!*recipient) recipient = "*"; - snprintf(z_buf, sizeof(z_buf), "<%s,%s,%s>", class, inst, recipient); + nd_snprintf(z_buf, sizeof(z_buf), "<%s,%s,%s>", class, inst, recipient); z_buf[sizeof(z_buf)-1] = '\0'; return z_buf; } @@ -144,22 +144,34 @@ str_to_lower(const char *string) void zephyr_print(netdissect_options *ndo, const u_char *cp, int length) { - struct z_packet z; + 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 */ - z.kind = 0; - z.class = 0; - z.inst = 0; - z.opcode = 0; - z.sender = 0; - z.recipient = 0; - #define PARSE_STRING \ s = parse_field(ndo, &parse, &parselen, &truncated); \ if (truncated) goto trunc; \