summaryrefslogtreecommitdiff
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-23 16:48:17 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-24 03:38:21 +0000
commite52c95c6c8cdac34eccdba9b49d68a6982685f1a (patch)
treefc479aac517dbee8b5a6a82ea33ec40a482cc248 /tshark.c
parent751e078d2bc6adf1179de164291eb743abd8732b (diff)
downloadwireshark-e52c95c6c8cdac34eccdba9b49d68a6982685f1a.tar.gz
Move UI-only stuff out of libwireshark.
Packet ranges are used only in the UI; move the packet range stuff into libui. Don't pass a print_args_t structure to libwireshark packet-printing routines, just pass the few parameters they need. Move the declaration of print_args_t into file.h. Change-Id: Icff5991eea7d7d56f33b4716105895263d275bcf Reviewed-on: https://code.wireshark.org/review/21308 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/tshark.c b/tshark.c
index 2989460182..7fc5938385 100644
--- a/tshark.c
+++ b/tshark.c
@@ -3779,8 +3779,6 @@ print_columns(capture_file *cf)
static gboolean
print_packet(capture_file *cf, epan_dissect_t *edt)
{
- print_args_t print_args;
-
if (print_summary || output_fields_has_cols(output_fields)) {
/* Just fill in the columns. */
epan_dissect_fill_in_columns(edt, FALSE, TRUE);
@@ -3811,19 +3809,8 @@ print_packet(capture_file *cf, epan_dissect_t *edt)
switch (output_action) {
case WRITE_TEXT:
- /* Only initialize the fields that are actually used in proto_tree_print.
- * This is particularly important for .range, as that's heap memory which
- * we would otherwise have to g_free().
- print_args.to_file = TRUE;
- print_args.format = print_format;
- print_args.print_summary = print_summary;
- print_args.print_formfeed = FALSE;
- packet_range_init(&print_args.range, &cfile);
- */
- print_args.print_hex = print_hex;
- print_args.print_dissections = print_details ? print_dissections_expanded : print_dissections_none;
-
- if (!proto_tree_print(&print_args, edt, output_only_tables, print_stream))
+ if (!proto_tree_print(print_details ? print_dissections_expanded : print_dissections_none,
+ print_hex, edt, output_only_tables, print_stream))
return FALSE;
if (!print_hex) {
if (!print_line(print_stream, 0, separator))
@@ -3840,20 +3827,19 @@ print_packet(capture_file *cf, epan_dissect_t *edt)
printf("\n");
return !ferror(stdout);
case WRITE_JSON:
- print_args.print_dissections = print_dissections_expanded;
- print_args.print_hex = print_hex;
- write_json_proto_tree(output_fields, &print_args, protocolfilter, protocolfilter_flags, edt, stdout);
+ write_json_proto_tree(output_fields, print_dissections_expanded,
+ print_hex, protocolfilter, protocolfilter_flags,
+ edt, stdout);
printf("\n");
return !ferror(stdout);
case WRITE_JSON_RAW:
- print_args.print_dissections = print_dissections_none;
- print_args.print_hex = TRUE;
- write_json_proto_tree(output_fields, &print_args, protocolfilter, protocolfilter_flags, edt, stdout);
+ write_json_proto_tree(output_fields, print_dissections_none, TRUE,
+ protocolfilter, protocolfilter_flags, edt, stdout);
printf("\n");
return !ferror(stdout);
case WRITE_EK:
- print_args.print_hex = print_hex;
- write_ek_proto_tree(output_fields, &print_args, protocolfilter, protocolfilter_flags, edt, stdout);
+ write_ek_proto_tree(output_fields, print_hex, protocolfilter,
+ protocolfilter_flags, edt, stdout);
return !ferror(stdout);
}
}