summaryrefslogtreecommitdiff
path: root/tshark.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-03-17 23:30:37 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-03-17 23:30:37 +0000
commit3c3c2224f937e599beb69b40500c45a65b9faf0d (patch)
tree6f57405837d9db28122a20ef2e0be66d0693efde /tshark.c
parent30b7c91158ade4c4616572387c59f9f99134a8ed (diff)
downloadwireshark-3c3c2224f937e599beb69b40500c45a65b9faf0d.tar.gz
Allow tshark to print custom columns.
svn path=/trunk/; revision=24678
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tshark.c b/tshark.c
index fd5c1a70b9..3a0d0fd3e1 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1410,6 +1410,11 @@ main(int argc, char *argv[])
for (i = 0; i < cfile.cinfo.num_cols; i++) {
cfile.cinfo.col_fmt[i] = get_column_format(i);
cfile.cinfo.col_title[i] = g_strdup(get_column_title(i));
+ if (cfile.cinfo.col_fmt[i] == COL_CUSTOM) {
+ cfile.cinfo.col_custom_field[i] = g_strdup(get_column_custom_field(i));
+ } else {
+ cfile.cinfo.col_custom_field[i] = NULL;
+ }
cfile.cinfo.fmt_matx[i] = (gboolean *) g_malloc0(sizeof(gboolean) *
NUM_COL_FMTS);
get_column_format_matches(cfile.cinfo.fmt_matx[i], cfile.cinfo.col_fmt[i]);
@@ -2422,7 +2427,7 @@ process_packet(capture_file *cf, gint64 offset, const struct wtap_pkthdr *whdr,
}
passed = TRUE;
- if (cf->rfcode || verbose || num_tap_filters!=0)
+ if (cf->rfcode || verbose || num_tap_filters!=0 || have_custom_cols(&cf->cinfo))
create_proto_tree = TRUE;
else
create_proto_tree = FALSE;
@@ -2437,6 +2442,8 @@ process_packet(capture_file *cf, gint64 offset, const struct wtap_pkthdr *whdr,
if (cf->rfcode)
epan_dissect_prime_dfilter(edt, cf->rfcode);
+ col_custom_prime_edt(edt, &cf->cinfo);
+
tap_queue_init(edt);
/* We only need the columns if we're printing packet info but we're