diff options
-rw-r--r-- | doc/tshark.pod | 11 | ||||
-rw-r--r-- | ui/cli/tap-follow.c | 13 |
2 files changed, 19 insertions, 5 deletions
diff --git a/doc/tshark.pod b/doc/tshark.pod index 4e14c7b98d..f50211987e 100644 --- a/doc/tshark.pod +++ b/doc/tshark.pod @@ -1024,12 +1024,13 @@ I<prot> specifies the transport protocol. It can be one of: I<mode> specifies the output mode. It can be one of: - ascii ASCII output with dots for non-printable characters - hex Hexadecimal and ASCII data with offsets - raw Hexadecimal data + ascii ASCII output with dots for non-printable characters + ebcdic EBCDIC output with dots for non-printable characters + hex Hexadecimal and ASCII data with offsets + raw Hexadecimal data -Since the output in B<ascii> mode may contain newlines, the length of each section -of output plus a newline precedes each section of output. +Since the output in B<ascii> or B<ebcdic> mode may contain newlines, the length +of each section of output plus a newline precedes each section of output. I<filter> specifies the stream to be displayed. UDP/TCP streams are selected with either the stream index or IP address plus port pairs. SSL streams are diff --git a/ui/cli/tap-follow.c b/ui/cli/tap-follow.c index a658f4170a..4a7d27eb10 100644 --- a/ui/cli/tap-follow.c +++ b/ui/cli/tap-follow.c @@ -36,6 +36,7 @@ #include <glib.h> #include <epan/addr_resolv.h> +#include <epan/charsets.h> #include <epan/epan_dissect.h> #include <epan/follow.h> #include <epan/stat_tap_ui.h> @@ -66,6 +67,7 @@ typedef enum { mode_HEX, mode_ASCII, + mode_EBCDIC, mode_RAW } mode_e; @@ -96,6 +98,7 @@ typedef struct #define STR_HEX ",hex" #define STR_ASCII ",ascii" +#define STR_EBCDIC ",ebcdic" #define STR_RAW ",raw" static void @@ -133,6 +136,7 @@ followStrMode( { case mode_HEX: return "hex"; case mode_ASCII: return "ascii"; + case mode_EBCDIC: return "ebcdic"; case mode_RAW: return "raw"; } @@ -632,6 +636,7 @@ followDraw( break; case mode_ASCII: + case mode_EBCDIC: printf("%s%u\n", node ? "\t" : "", sc.dlen); break; @@ -659,6 +664,7 @@ followDraw( break; case mode_ASCII: + case mode_EBCDIC: for (ii = 0; ii < len; ii++) { switch (bin[ii]) @@ -677,6 +683,9 @@ followDraw( data[ii++] = '\n'; } data[ii] = 0; + if (fp->mode == mode_EBCDIC) { + EBCDIC_to_ASCII(data, ii); + } printf("%s", data); break; @@ -752,6 +761,10 @@ followArgMode( { fp->mode = mode_ASCII; } + else if (followArgStrncmp(opt_argp, STR_EBCDIC)) + { + fp->mode = mode_EBCDIC; + } else if (followArgStrncmp(opt_argp, STR_RAW)) { fp->mode = mode_RAW; |