diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-04-28 14:39:27 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-04-28 14:39:27 +0200 |
commit | fa97e6417eed3b7acffc014209a1691588cb8acd (patch) | |
tree | b23f8fa657df7bb43d9219ed2a8d248a99b150ae /src/utils.cpp | |
parent | 0616c12772c4995d0a22b803127af156a37a3a7d (diff) | |
download | etisnoop-fa97e6417eed3b7acffc014209a1691588cb8acd.tar.gz etisnoop-fa97e6417eed3b7acffc014209a1691588cb8acd.tar.bz2 etisnoop-fa97e6417eed3b7acffc014209a1691588cb8acd.zip |
Adapt FIG1/x to new result struct, improve FIG filter
Diffstat (limited to 'src/utils.cpp')
-rw-r--r-- | src/utils.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/utils.cpp b/src/utils.cpp index 75aa880..3e741c9 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -83,6 +83,38 @@ void printbuf(std::string header, printbuf(header, disp, buffer, size, desc); } +void printfig(string header, + const display_settings_t &disp, + uint8_t* buffer, + size_t size, + string desc) +{ + if (disp.print) { + for (int i = 0; i < disp.indent; i++) { + printf("\t"); + } + + printf("%s", header.c_str()); + + if (verbosity > 1) { + if (size != 0) { + printf(": "); + } + + for (size_t i = 0; i < size; i++) { + printf("%02x ", buffer[i]); + } + } + + if (desc != "") { + printf(" [%s] ", desc.c_str()); + } + + printf("\n"); + } +} + + void printbuf(string header, const display_settings_t &disp, uint8_t* buffer, |