aboutsummaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2011-04-29 06:53:29 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2011-04-29 06:53:29 +0000
commit65910b24799e242a5cddc7b6821f2962b13e56f2 (patch)
treecd82fa5149447e71a7719ca415dd99026f4f7d87 /print.c
parent664c69dbaa47dfbe01baaee7ff5236b8b5c21d76 (diff)
From Edwin Groothuis via bug 5870:
The supplied patch adds a new option -O, which specifies a list of protocols (names can be found with the "-G protocols" option) to be fully decoded while the others only show the layer header. svn path=/trunk/; revision=36947
Diffstat (limited to 'print.c')
-rw-r--r--print.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/print.c b/print.c
index 603acd09c0..1de8bbfde5 100644
--- a/print.c
+++ b/print.c
@@ -31,6 +31,8 @@
#include <stdio.h>
#include <string.h>
+#include <glib.h>
+
#include <epan/epan.h>
#include <epan/epan_dissect.h>
#include <epan/tvbuff.h>
@@ -83,6 +85,8 @@ struct _output_fields {
gchar quote;
};
+GHashTable *output_only_tables = NULL;
+
static gboolean write_headers = FALSE;
static const gchar* get_field_hex_value(GSList* src_list, field_info *fi);
@@ -188,6 +192,16 @@ void proto_tree_print_node(proto_node *node, gpointer data)
return;
}
+ /*
+ * If -O is specified, only display the protocols which are in the
+ * lookup table.
+ */
+ if (output_only_tables != NULL
+ && g_hash_table_lookup(output_only_tables, fi->hfinfo->abbrev) == NULL) {
+ pdata->success = TRUE;
+ return;
+ }
+
if (PROTO_ITEM_IS_GENERATED(node)) {
g_free(label_ptr);
}