aboutsummaryrefslogtreecommitdiffstats
path: root/epan/print.h
AgeCommit message (Collapse)AuthorFilesLines
2023-02-16tshark: Support multiple -j and -J options, including mixedJohn Thacker1-5/+3
Store the field filter strings in a wmem_map pointing to the field flags for each string. This allows specifying multiple filter options (-j or -J) on the command line, including some of both. Fix #17470
2022-10-08Move print_hex_data_buffer() to wsutilJoão Valverde1-11/+0
Move this generic function to wsutil so it can be used by other libraries.
2022-01-13tshark: Add new long option --hexdump <hexoption>Jim Young1-1/+23
2021-11-29Add files with WS_DLL_PUBLIC to DoxygenMoshe Kaplan1-1/+1
Add @file markers for most files that contain functions exported with WS_DLL_PUBLIC so that Doxygen will generate documentation for them.
2019-01-03epan: use json_dumper for json outputs.Dario Lombardo1-4/+5
They include -Tjson, -Tjsonraw, -Tek. Change-Id: Ib3d700482ce5c29727c3f778cc3c46a1bf7756c4 Reviewed-on: https://code.wireshark.org/review/31000 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-02-08epan: use SPDX indentifiers.Dario Lombardo1-13/+1
Skipping dissectors dir for now. Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa Reviewed-on: https://code.wireshark.org/review/25694 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-02Add columns (_ws.col) to output formats json, ek, pdmlMerlin Chlosta1-2/+4
Bug: 13020 Change-Id: Ia83797a4e390be7cc59a9718735edc1c7f9a5712 Reviewed-on: https://code.wireshark.org/review/24928 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-15Tshark: Optional packet summary for ElasticsearchChristoph Wurm1-0/+1
Currently, the Elasticsearch output exports the packet details and, if -x is specified, the raw hex data. This change adds the option of exporting the packet summary as well. The default stays the same (packet details only), but now the existing -P switch turns on printing of the packet summary. It also turns off printing packet details, which can be turned back on with -V to print both, and combined with -x to print all three: summary, details and raw hex. The packet summary is especially useful when exploring and visualizing the data in Kibana, e.g. by displaying the summary "Info" field/column in a table, as in the Wireshark GUI. Change-Id: I2030490cfdd905572397bc3d5457ba49d805a5c4 Reviewed-on: https://code.wireshark.org/review/22716 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-22Add --no-duplicate-keys tshark option.Daan De Meyer1-1/+11
Adds the --no-duplicate-keys option to tshark. If -T json is specified, this option can be specified in order to transform the duplicate keys produced by -T json into single keys with as value a json array of all separate values. Specifying --no-duplicate-keys changes the function which groups node children that is passed to write_json_proto_tree. Instead of a function that puts each node in a separate group (proto_node_group_children_by_unique) a function is passed that groups children that have the same json key together (proto_node_group_children_by_json_key). This will lead to some groups having multiple values. Groups with multiple values are written to the output as a json array. This includes normal json keys but also keys with the "_raw" and "_tree" suffix. If --no-duplicate-keys is specified with an option other than "-T json" or "-T jsonraw" or without -T an error is shown and tshark will exit. "Export Packet Dissections -> As JSON" in the GUI is hardcoded to use the duplicated keys format. Fixes one regression in the output where a filtered json key (-j) with both a value and children would not have the "_tree" suffix added to the json key containing the children. Includes a little code cleanup (removes one instance of code duplication and simplifies a while loop). Fixes a memory leak (I thought this fix was already included in the previous refactor patch but something must have gone wrong when updating the patch so I'm including it again in this patch). Bug: 12958 Change-Id: I401f8fc877b5c590686567c3c44cdb832e9e7dfe Reviewed-on: https://code.wireshark.org/review/22166 Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-12Add support for color xml attributes in psml and pdml formats.Michael Mann1-2/+2
Bug: 6682 Change-Id: I19330d06aa3d5692503c61369c3c650d595971f5 Reviewed-on: https://code.wireshark.org/review/22077 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stephen Donnelly <stephen.donnelly@endace.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-24Move UI-only stuff out of libwireshark.Guy Harris1-29/+13
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>
2017-02-20print(.h): fix commas at the end of enumerator lists are a C++11 extension ↵Alexis La Goutte1-1/+1
[-Wc++11-extensions] Change-Id: Iedffbd72c855340ab77157df954366c8e479c7df Reviewed-on: https://code.wireshark.org/review/20193 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-02-05PDML: protocol filter incorrectly filters desired subfieldsMartin Kacer1-3/+8
Bug: 12847 Change-Id: I8a560dc44dceb06123d8bcecd512d132ee4ebb0d Reviewed-on: https://code.wireshark.org/review/19671 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-12-16Rename packet-range.[ch] to packet_range.[ch]Michael Mann1-1/+1
The check*.pl scripts presume that files with the prefix "packet-" are dissector files and therefore have different rules than other files. Rather than trying to clarify that more with additional directory information, just make any non-dissector file with "packet-" filename prefix conform if it fails a "dissector specific" check from the scripts. Change-Id: I7cb52e1fad4ea62320492bb690904260f958aeb4 Reviewed-on: https://code.wireshark.org/review/19304 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-29tshark fields filter added for other outputsMartin Kacer1-3/+10
-e fields filter addded to ek|json|pdml output. Bug: 12529 Change-Id: I1f0f8772eefceb5b71927925ce0c34af483571b9 Reviewed-on: https://code.wireshark.org/review/16193 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>
2016-06-21tshark JSON and Elasticsearch output fixMartin Kacer1-3/+3
Fixed json and ek escape function Fixed -j protocol filter to do exact match Fixed -T json to correctly close json Added -j protocol filter also to pdml output Bug: 11754 Change-Id: I02f274e4a5a02346922b37bbe946c10340c242ea Reviewed-on: https://code.wireshark.org/review/16034 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-17tshark JSON and Elasticsearch outputMartin Kacer1-0/+6
Added ouput -T for json|ek Added -j switch fo filter EK json|ek fields. Added -x switch to work with json|ek to insert raw fields. Bug: 11754 Change-Id: Iad5a9092b843c074b0b774d1745fa14fca09f6b7 Reviewed-on: https://code.wireshark.org/review/15869 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-09-12Display the name of the invalid field when tshark is run with -T fieldsMatthieu Coudron1-1/+1
-e invalidfield Change-Id: Iaf8733096d9e1d15510a38363397b1dcd972ff59 Reviewed-on: https://code.wireshark.org/review/10504 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-20Reduce epan dependence on dissectors by having print module "cache" the ↵Michael Mann1-0/+2
protocol and field ids that it needs. Change-Id: I4ec48067e9ca2cbe88e1cf2e6c9dc1e382379221 Reviewed-on: https://code.wireshark.org/review/7767 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-29Clean up routine names, don't pass capture_file into libwireshark.Guy Harris1-10/+7
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-7/+4
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-2/+2
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-35/+4
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-06-27Check the validity of fields given to tshark with "-e": complain and exit ifJeff Morriss1-0/+1
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-05-19Use g_ alloced memory (instead of emem) when printing fields. emem ↵Michael Mann1-1/+1
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-1/+1
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-09Use g_ alloced memory (instead of emem) when printing fields. emem ↵Michael Mann1-1/+1
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>
2013-12-03Avoid including <epan/epan.h> in dissectors.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53774
2013-07-12Move the print modules into epan.Jeff Morriss1-0/+167
svn path=/trunk/; revision=50526