diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-11-29 14:43:22 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-11-29 22:44:29 +0000 |
commit | 81ab6012fe1ae14b9d7719035b8156368fa48c7e (patch) | |
tree | b49d0f01b1ab64432444bc882bf61d7d57c91381 /tshark.c | |
parent | 05516b0c928ca7178ba4285dd8381b63e772cb53 (diff) |
Clean up routine names, don't pass capture_file into libwireshark.
Give all routines in epan/print.c that write a particular format a name
beginning with write_{formatname}.
If routines write columns, rather than the raw protocol tree, don't give
it a name containing proto_tree.
Get rid of empty preamble/finale routines.
For CSV, the preamble routine writes out column titles, so call it
write_csv_column_titles().
For C arrays, the body routine writes out raw hex data, so call it
write_carrays_hex_data().
capture_file isn't a structure defined by libwireshark, so don't make it
an argument passed into libwireshark.
Change-Id: I5a7e04de9382cf51a59d9d9802f815b8b3558332
Reviewed-on: https://code.wireshark.org/review/5536
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -2182,7 +2182,7 @@ main(int argc, char *argv[]) print_packet_counts = TRUE; if (print_packet_info) { - if (!write_preamble(NULL)) { + if (!write_preamble(&cfile)) { show_print_file_io_error(errno); return 2; } @@ -3592,13 +3592,13 @@ write_preamble(capture_file *cf) switch (output_action) { case WRITE_TEXT: - return print_preamble(print_stream, cf ? cf->filename : NULL, get_ws_vcs_version_info()); + return print_preamble(print_stream, cf->filename, get_ws_vcs_version_info()); case WRITE_XML: if (print_details) - write_pdml_preamble(stdout, cf ? cf->filename : NULL); + write_pdml_preamble(stdout, cf->filename); else - write_psml_preamble(cf, stdout); + write_psml_preamble(&cf->cinfo, stdout); return !ferror(stdout); case WRITE_FIELDS: @@ -3903,7 +3903,7 @@ print_packet(capture_file *cf, epan_dissect_t *edt) break; case WRITE_XML: - proto_tree_write_psml(edt, stdout); + write_psml_columns(edt, stdout); return !ferror(stdout); case WRITE_FIELDS: /*No non-verbose "fields" format */ g_assert_not_reached(); @@ -3937,11 +3937,11 @@ print_packet(capture_file *cf, epan_dissect_t *edt) break; case WRITE_XML: - proto_tree_write_pdml(edt, stdout); + write_pdml_proto_tree(edt, stdout); printf("\n"); return !ferror(stdout); case WRITE_FIELDS: - proto_tree_write_fields(output_fields, edt, &cf->cinfo, stdout); + write_fields_proto_tree(output_fields, edt, &cf->cinfo, stdout); printf("\n"); return !ferror(stdout); } |