summaryrefslogtreecommitdiffstats
path: root/print-zeromq.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:52:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:52:33 +0000
commit7ba700b7f6e5fb17d280e2b8a3ae28866777715f (patch)
tree2f538ff3d975beabb6c371d999b1ee6e8b91cfb5 /print-zeromq.c
parentReleasing progress-linux version 4.99.4-4~progress7.99u1. (diff)
downloadtcpdump-7ba700b7f6e5fb17d280e2b8a3ae28866777715f.tar.xz
tcpdump-7ba700b7f6e5fb17d280e2b8a3ae28866777715f.zip
Merging upstream version 4.99.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--print-zeromq.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/print-zeromq.c b/print-zeromq.c
index c702046..8201047 100644
--- a/print-zeromq.c
+++ b/print-zeromq.c
@@ -26,10 +26,9 @@
*/
/* \summary: ZeroMQ Message Transport Protocol (ZMTP) printer */
+/* specification: https://rfc.zeromq.org/spec/13/ */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
@@ -42,6 +41,18 @@
*/
#define VBYTES 128
+static const struct tok flags_bm[] = {
+ { 0x01, "MORE" },
+ { 0x02, "R1" },
+ { 0x04, "R2" },
+ { 0x08, "R3" },
+ { 0x10, "R4" },
+ { 0x20, "R5" },
+ { 0x40, "R6" },
+ { 0x80, "R7" },
+ { 0, NULL }
+};
+
/*
* Below is an excerpt from the "13/ZMTP" specification:
*
@@ -104,16 +115,7 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep)
if (ndo->ndo_vflag) {
uint64_t body_len_printed = ND_MIN(body_len_captured, body_len_declared);
- ND_PRINT(" (%s|%s|%s|%s|%s|%s|%s|%s)",
- flags & 0x80 ? "MBZ" : "-",
- flags & 0x40 ? "MBZ" : "-",
- flags & 0x20 ? "MBZ" : "-",
- flags & 0x10 ? "MBZ" : "-",
- flags & 0x08 ? "MBZ" : "-",
- flags & 0x04 ? "MBZ" : "-",
- flags & 0x02 ? "MBZ" : "-",
- flags & 0x01 ? "MORE" : "-");
-
+ ND_PRINT(" (%s)", bittok2str(flags_bm, "none", flags));
if (ndo->ndo_vflag == 1)
body_len_printed = ND_MIN(VBYTES + 1, body_len_printed);
if (body_len_printed > 1) {