aboutsummaryrefslogtreecommitdiffstats
path: root/epan/print.c
AgeCommit message (Collapse)AuthorFilesLines
2014-11-29Clean up routine names, don't pass capture_file into libwireshark.Guy Harris1-36/+18
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>
2014-11-22Get rid of another global in the print code.Guy Harris1-5/+5
Pass the "output only these protocols" hash table as an argument, instead. Change-Id: Id8540943037e7b9bbfe377120c3f60dbe54fe0f1 Reviewed-on: https://code.wireshark.org/review/5440 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-22Get rid of write_headers global variable.Guy Harris1-33/+22
Have write_psml_preamble() and write_csv_preamble() take a capture_file * as an argument, so they can print the column titles themselves, rather than having to defer it to the routine that prints packet data. Change-Id: Ifd1b7a13062be8ad46846315976922a752778153 Reviewed-on: https://code.wireshark.org/review/5438 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-22Split the low-level print stream code into a separate file.Guy Harris1-352/+16
Put the low-level print stream code from epan/print.c into epan/print_stream.c, leaving the higher-level stuff in print.c Change-Id: Iae961f168ec655a29f434257b1af0937fca9f025 Reviewed-on: https://code.wireshark.org/review/5436 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-01print: do not try to add an empty hex stream to PDML output for a text only hfPascal Quantin1-2/+4
Bug: 10651 Change-Id: If38af2879b9a20f4755a7843f20c7327d66c95b1 Reviewed-on: https://code.wireshark.org/review/5054 Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-10Add editor modelines; Adjust whitespace as needed.Bill Meier1-0/+12
Change-Id: I3dc57f4c2ca57585103e3b71503ac4c332903e50 Reviewed-on: https://code.wireshark.org/review/4594 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06Revert "Qt: Try to fix a Visual C++ encoding warning."Gerald Combs1-1/+1
Revert gafa8c02 since it didn't work on Windows. Use a pragma to squelch Visual C++ instead. Qt's rich text renderer doesn't handle "&apos;". Replace it with "&#x27;". Remove a QDebug include. Change-Id: I0e6308efda74a4bc0e67ce841a50a0a9b68f4a8b Reviewed-on: https://code.wireshark.org/review/4511 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-06-27If we have no fields, don't try to iterate through them.Evan Huus1-0/+4
Otherwise glib throws an assertion since the array we pass it is NULL. Change-Id: I9159c1f5ad99b280c040cd790df3cf352738601f Reviewed-on: https://code.wireshark.org/review/2680 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-27Check the validity of fields given to tshark with "-e": complain and exit ifJeff Morriss1-0/+26
they aren't valid. Should help avoid confusion like that in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10201 Bug: 10201 Change-Id: Iff7f51ae042ca1a92d1c803b6cb61aa5d81ce205 Reviewed-on: https://code.wireshark.org/review/2654 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-22Add a routine to return a version string including VCS information.Guy Harris1-1/+1
Add a routine get_ws_vcs_version_info() that, for builds from a tree checked out from Wireshark's version control system, returns a string that includes both the Wireshark version number and an indication of what particular VCS version was checked out, and just returns Wireshark's version number for other builds. Use that routine rather than manually gluing VERSION and the Git version number together. ("vcs", not "git", just in case we do something bizarre or mercurial some day. :-)) Change-Id: Ie5c6dc83b9d3f56655eaef30fec3ec9916b6320d Reviewed-on: https://code.wireshark.org/review/2529 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-16Convert a bunch of time_to_str functions to wmemEvan Huus1-1/+6
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-19Use g_ alloced memory (instead of emem) when printing fields. emem ↵Michael Mann1-48/+21
shouldn't be used for GUI functions anyway. emem was exposed because of its memory limits trying to output PDML for a very large byte field in a capture file. When converting from proto_construct_match_selected_string to fvalue_to_string_repr remember proto_construct_match_selected_string includes fieldname + value, not just value bug:10081 Change-Id: I4fc6ea7fd1f63cff410207c8b30562771af40ada Reviewed-on: https://code.wireshark.org/review/1578 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-09Revert "Use g_ alloced memory (instead of emem) when printing fields. emem ↵Evan Huus1-16/+20
shouldn't be used for GUI functions." It's causing a few different test failures - I've tracked down at least one of them, but the others are weirder and will require more digging. This reverts commit 9edba650d11776fa1d5aefe4820890898380c1c2. Change-Id: I897f8cf1cfbb2a189b2054e5002f59757befa47f Reviewed-on: https://code.wireshark.org/review/1575 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-09Squelch compiler warnings.Guy Harris1-4/+4
Some are legitimate warnings - get_node_field_value() now returns a value that the callers are expected to g_free(), so we'd better not return a string constant. Change-Id: I937254316119044691c1d9a3da8c9615763e2e5a Reviewed-on: https://code.wireshark.org/review/1571 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09Use g_ alloced memory (instead of emem) when printing fields. emem ↵Michael Mann1-19/+15
shouldn't be used for GUI functions. emem was exposed because of its memory limits trying to output PDML for a very large byte field in a capture file. bug:10081 Change-Id: I6346dfdfb5f6381e16761a99291c4be7851185d9 Reviewed-on: https://code.wireshark.org/review/1566 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-02-25Fix crash when exporting dissection summaries to a CSV file.Guy Harris1-2/+3
The while loop in question ends with tmp_str being NULL; the next loop processes the same string, so you have to set tmp_str to csv_str before looping. Fix some comments while we're at it. Change-Id: I69dd7dc276e0cb11226eceee7921be87e3cc7534 Reviewed-on: https://code.wireshark.org/review/352 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-01-29Fix display of right arrow in CSV exportPascal Quantin1-1/+11
Changeset 1d8a895fa4d7c16d213bda50b1177eccbb54326e introduced the use of UTF-8 righ arrow to indicate the direction in TCP dissector. While it displays nicely in Wireshark GUI or in a text export of packets, an export to CSV results in an escaped string. This patch is a naive attempt to display the right arrow in a more friendly way when exporting to CSV. Any smarter fix is welcome. Change-Id: Ife787268696fa69dafc24a5cf9706af4c4832831
2013-12-21Drop isprint.h use g_ascii_isprint() when this include hack was enabled.Jakub Zawadzki1-2/+1
svn path=/trunk/; revision=54327
2013-12-19Rename more to_str functions to have ep_ in the name if they return ephemeralEvan Huus1-1/+1
buffers. Remove two unused functions. svn path=/trunk/; revision=54250
2013-11-17Move the epan/filesystem.c routines to wsutil; they're not specific toGuy Harris1-1/+1
packet dissection, they're specific to the entire Wireshark suite of programs. svn path=/trunk/; revision=53377
2013-11-10Move struct _ftype_t + callback typedefs + free macro to ftypes-int.hJakub Zawadzki1-0/+1
svn path=/trunk/; revision=53223
2013-11-09Include <epan/to_str.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53189
2013-10-13When printing PDML, don't assume that all values with bitmasks are representedEvan Huus1-1/+23
as guint32 internally - they may be signed and/or 64-bit. svn path=/trunk/; revision=52587
2013-10-09Make column "filter name" prefixed with _ws. to be the same as other "*shark ↵Michael Mann1-1/+1
application filters" created in r52462. svn path=/trunk/; revision=52474
2013-07-18Try to fix error: ignoring return value of 'fwrite', declared with attribute ↵Pascal Quantin1-3/+6
warn_unused_result svn path=/trunk/; revision=50722
2013-07-17Optimize print_line_textJakub Zawadzki1-11/+13
- fill spaces[] array once - use fwrite() svn path=/trunk/; revision=50705
2013-07-17Optimize proto_tree_print_node() + fix possible memleak when -O is usedJakub Zawadzki1-13/+10
svn path=/trunk/; revision=50699
2013-07-12Move the print modules into epan.Jeff Morriss1-0/+1809
svn path=/trunk/; revision=50526