aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/packet_list_store.c
AgeCommit message (Collapse)AuthorFilesLines
2016-06-16gtk: Check chunk before g_string_chunk_clearStig Bjørlykke1-1/+3
Avoid this warning from wireshark-gtk: (wireshark-gtk:39505): GLib-CRITICAL **: g_string_chunk_clear: assertion 'chunk != NULL' failed Change-Id: I413b3435a1ac595236dd1c4e619e3af1543b6a91 Reviewed-on: https://code.wireshark.org/review/15970 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-13Do not apply color rule filter every dissectionPeter Wu1-1/+3
Introduce a frame_data flag "need_colorize" to indicate that coloring rules need to be evaluated and set it for the GUI (not tshark). This restores the original performance characteristics. It additionally fixes a regression where the color filter name and filter is not shown anymore in the tree (I guess it is related to the edt->tree being NULL when re-selected, resulting in empty color_filter). Remaining problems: - Display filter cannot contain frame.coloring_rule.* fields. Code is present to enable this, but then a method is needed to avoid an expensive second calculation (which is why it is disabled). - The columns are still not updated after coloring rule change. - The two frame.coloring_rule fields in the tree are not updated when the coloring rule is changed (e.g. Ctrl-1). The last two issues were supposed to be fixed by the previous patch, but there is probably some missing code... Tested with GTK and Qt. Bug: 11980 Change-Id: I3ef7713b28db242e178d20f6a5f333374718b52e Reviewed-on: https://code.wireshark.org/review/13170 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-01Make color filters part of dissectionMichael Mann1-3/+0
Color filters can be seen as a function that takes a tree and display filters as input and a (possibly empty) coloring rule as output. This coloring rule is then added to the frame tree and used by the GUI for coloring the packets list. From an architectural POV, "coloring" is part of the UI component, but since it influences the tree, it is something for the dissection component. Bug: 5703 Bug: 6099 Change-Id: I73d132ec1dca7262bcb1b55c8481ca564c6161d1 Reviewed-on: https://code.wireshark.org/review/12507 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-28Refactor GUI dependencies out of color_filters.[ch] and move it to epan ↵Michael Mann1-2/+1
directory. This also moved color.h into color_filters.h Change-Id: Ic19e27aa1b3ec67e764aa7ee8bbef7b1187bb12e Reviewed-on: https://code.wireshark.org/review/12831 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-20Qt: Add missing multi-field column validationMichal Labedzki1-1/+1
GTK already has it, but Qt forgot about it, so multi-field custom column works ok if previously saved in GTK-shark. Invalid validation prevent from modifying and saving multi-field custom column in Qt version. While at it, rename "custom field" to "custom fields" to ensure we think about multi-field custom column. Change-Id: I99588150ccb38be11b75f5dd5b0f6443e7055ebb Reviewed-on: https://code.wireshark.org/review/12685 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-14gtk: add asserts.Dario Lombardo1-0/+2
Found by clang analyzer. Change-Id: I1c8448f7402179d33d6ccb8b182b0612817a8e09 Reviewed-on: https://code.wireshark.org/review/10976 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>
2015-09-03GTK packet list string chunk fixups.Gerald Combs1-1/+4
Call g_string_chunk_clear when we clear the packet list. Allocate 1 MiB chunks instead of 32 byte chunks. This doesn't do much in practice locally but appears more correct according to the GStringChunk documentation and source code. Change-Id: I143b6e1b48d376ba826cb342ade71085a2d82d96 Reviewed-on: https://code.wireshark.org/review/10344 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-22Ensure to copy the (un)resolved (source|destination) address columns before ↵Pascal Quantin1-18/+18
freeing epan memory Otherwise addresses like AT_STRINGZ using pinfo->pool are using an already freed memory block Bug: 11387 Change-Id: I615d6bf202d57a949e75ba06a39f8d3e464def2f Reviewed-on: https://code.wireshark.org/review/9744 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-29Take all epan_column_info members that always get allocated to "number of ↵Michael Mann1-13/+15
columns" to share their own data structure. Change-Id: Ib982662db6cf68730a7d121eac60d9bc5ae67429 Reviewed-on: https://code.wireshark.org/review/9195 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-25Stop using atof/strtod (fixes column sorting of float types)Peter Wu1-2/+2
atof is locale-dependent. In locales such as Swedish, German and Dutch, the dot is a thousand separator, resulting in wrong conversions for floats. While at it, make the mate dissector also be independent of locale. Blacklist atof in checkAPIs. Lemon is still using strtod, but that is not our problem for now. Bug: 11297 Bug: 8964 Change-Id: I6fe3e45eb1d6d95d41aa4f3af1f81a6204a60c63 Reviewed-on: https://code.wireshark.org/review/9116 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-15ui/gtk/*.c: Add editor modelines; As needed: Fix indentationBill Meier1-0/+13
Change-Id: I8cd9d9fe5f12c284f46b8f725766f681faccd753 Reviewed-on: https://code.wireshark.org/review/7138 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-16Remove se_ alloced memory from packet_list_storeMichael Mann1-3/+3
Change-Id: I7aa2f5f8b433468ad2c2cd73cfce986d128a9ae0 Reviewed-on: https://code.wireshark.org/review/6565 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-01Remove unneeded includes from ui folderMartin Mathieson1-3/+0
Change-Id: Ifd1eebff9080cd3867e44e4dcb2d2681370ed60a Reviewed-on: https://code.wireshark.org/review/6128 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-01Add a Buffer to wtap_pkthdr to hold file-type-specific packet metadata.Guy Harris1-1/+2
For example, this can be used for pcap-ng options not mapped to file-type-independent metadata values. Change-Id: I398b324c62c1cc1cc61eb5e9631de00481b4aadc Reviewed-on: https://code.wireshark.org/review/5549 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-02Rename buffer_ routines to ws_buffer_ to avoid name collisions.Guy Harris1-3/+3
In particular, epan/wslua/lrexlib.c has its own buffer_ routines, causing some linker warnings on some platforms, as reported in bug 10332. (Not to be backported to 1.12, as that would change the API and ABI of libwsutil and libwiretap. We should also make the buffer_ routines in epan/wslua/lrexlib.c static, which should also address this problem, but the name change avoids other potential namespace collisions.) Change-Id: I1d42c7d1778c7e4c019deb2608d476c52001ce28 Reviewed-on: https://code.wireshark.org/review/3351 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-25Add support for dissecting non-packet records.Guy Harris1-1/+1
Add a dissector table indexed by the file type, and, for the file-type-specific records, have the frame dissector skip the usual pseudo-header processing, as the pseudo-header has a file-type-specific record subtype in it, and call the dissector for that file type's records. Change-Id: Ibe97cf6340ffb0dabc08f355891bc346391b91f9 Reviewed-on: https://code.wireshark.org/review/1782 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24Allow wtap_read() and wtap_seek_read() to return records other than packets.Guy Harris1-3/+3
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be REC_TYPE_PACKET, for a record containing a packet, or REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific data. Modify code that reads packets to be able to handle non-packet records, even if that just means ignoring them. Rename some routines to indicate that they handle more than just packets. We don't yet have any libwiretap code that supplies records other than REC_TYPE_PACKET or that supporting writing records other than REC_TYPE_PACKET, or any code to support plugins for handling REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug 8590. Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813 Reviewed-on: https://code.wireshark.org/review/1773 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."Guy Harris1-1/+1
This reverts commit c0c480d08c175eed4524ea9e73ec86298f468cf4. A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes. That is in-progress. Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6 Reviewed-on: https://code.wireshark.org/review/1741 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Allow wtap_read() and wtap_seek_read() to return non-packet records.Guy Harris1-1/+1
This is the first step towards implementing the mechanisms requestd in bug 8590; currently, we don't return any records other than packet records from libwiretap, and just ignore non-packet records in the rest of Wireshark, but this at least gets the ball rolling. Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574 Reviewed-on: https://code.wireshark.org/review/1736 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-14Fix Argument with 'nonnull' attribute passed null found by ClangAlexis La Goutte1-4/+6
Change-Id: I9b8a6c37e4ed589ac3066ec9cbb1b63a9f30a12b Reviewed-on: https://code.wireshark.org/review/1097 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-27Fix bug9931 'Encapsulated ethernet packets sometimes show invalid FCS'Hadriel Kaplan1-0/+2
This fixes part-1 of bug9931: the uninitialized use of a wtap_pkthdr struct. The second part of the bug deals with dissectors calling the Ethernet dissector for ecnapsulated Ethernet packets but using the wrong dissector handle to do so. That's unrelated to the issue this commit addresses, so I'm splitting them up. Change-Id: I87be7b736f82dd74d8c261062f88143372b5344c Reviewed-on: https://code.wireshark.org/review/848 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> 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-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53230
2013-10-18After looking for something in the column-*.h files andJörg Mayer1-1/+1
not finding it, I finally found it in column_info.h Renamed column_info.h to column-info.h to have consistency with the column*h files. svn path=/trunk/; revision=52667
2013-07-21Add helper function to epan_session which can be used to get absolute ↵Jakub Zawadzki1-3/+3
timestamp of given frame. Remove ->prev_cap, for testing purpose also replace ->prev_dis with number of previously displayed frame number. This patch reduce size of frame_data by 8B (amd64) This is what (I think) was suggested by Guy in comment 13 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5821#c13) svn path=/trunk/; revision=50765
2013-07-21Some work on multi file dissectionJakub Zawadzki1-1/+1
- make init_dissection/cleanup_dissection private for libwireshark - implement epan_new(), epan_free() - pass epan_t to epan_dissect* svn path=/trunk/; revision=50761
2013-07-11packet dissection now takes pointer to tvb instead of guint8 dataJakub Zawadzki1-1/+2
implement frame_tvbuff, right now almost a copy of 'real' tvb. svn path=/trunk/; revision=50497
2013-06-27Remove a no-longer-used variable.Jeff Morriss1-2/+0
svn path=/trunk/; revision=50194
2013-06-27cleanup, use packet_list_iter_nth_child() in another place.Jakub Zawadzki1-19/+1
svn path=/trunk/; revision=50189
2013-06-25Move a couple of time-related modules into wsutil.Jeff Morriss1-1/+0
A bunch of files didn't really need to include these header files so remove the include line rather than changing it. svn path=/trunk/; revision=50154
2013-06-25Allocate memory for col_text[_len] when really neededJakub Zawadzki1-23/+13
remove columnized bit, now the same can be done with col_text. svn path=/trunk/; revision=50144
2013-06-25packet_list_iter_children() simplify, just call ↵Jakub Zawadzki1-21/+1
packet_list_iter_nth_child(..., 0) svn path=/trunk/; revision=50143
2013-06-16Have the seek-read routines take a Buffer rather than a guint8 pointerGuy Harris1-3/+6
as the "where to put the packet data" argument. This lets more of the libwiretap code be common between the read and seek-read code paths, and also allows for more flexibility in the "fill in the data" path - we can expand the buffer as needed in both cases. svn path=/trunk/; revision=49949
2013-03-21From beroset:Bill Meier1-4/+4
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10404 Note: The following parts of the patch had been previously done: asn1/snmp/packet-snmp-template.c epan/dissectors/packet-snmp.c epan/dissectors/packet-x11.c Also; hostlist_table.c: code under '#ifdef HAVE_GEOIP' didn't compile and needed a few additional patches. svn path=/trunk/; revision=48447
2012-12-26Fix a bunch of warnings.Guy Harris1-2/+2
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-3/+3
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-09-23Glib type checking might be cheap, but there's no need to do it twice.Jakub Zawadzki1-12/+17
(Actually many GtkTreeModel don't check types at all). svn path=/trunk/; revision=45073
2012-09-23Speedup loading capture files by about 20%-30% (wireshark only)Jakub Zawadzki1-2/+1
Right now packetlist model is used only by one treeview, so we can check if packetlist->view has connected model if no, don't emit row-inserted signal. svn path=/trunk/; revision=45063
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45016
2012-09-04- Replace packet_list_recreate_visible_rows -> ↵Jörg Mayer1-7/+7
packet_list_recreate_visible_rows_list - Replace new_packet_list_ -> packet_list_ svn path=/trunk/; revision=44765
2012-09-03When inserting row there's no need to call packet_list_get_iter.Jakub Zawadzki1-23/+13
Also, don't set iter.user_data[23] in packet_list_get_iter(). We don't use them in packet_list_store. svn path=/trunk/; revision=44752
2012-08-14Use frame_data_compare() to compare frame numbers.Jakub Zawadzki1-5/+5
svn path=/trunk/; revision=44493
2012-07-26Make columnized and colorized bit field.Jakub Zawadzki1-5/+5
svn path=/trunk/; revision=44034
2012-07-26Add checks if stamp values matches. Remove packet_list_visible_recordJakub Zawadzki1-31/+25
svn path=/trunk/; revision=44033
2012-07-26physical_pos is now used only for checks, ifdef it in PACKET_PARANOID_CHECKS ↵Jakub Zawadzki1-0/+12
to save some memory svn path=/trunk/; revision=44032
2012-07-26Exploit short-circuit evaluation, so first check variable, later call functionJakub Zawadzki1-2/+2
svn path=/trunk/; revision=44031
2012-07-26Move checks outside loopJakub Zawadzki1-5/+5
svn path=/trunk/; revision=44030
2012-07-26Pass record to packet_list_change_record() not physical_pos Jakub Zawadzki1-10/+3
svn path=/trunk/; revision=44029
2012-07-25Allocate col_text & col_text_len only for columns not based on frame_dataJakub Zawadzki1-45/+58
svn path=/trunk/; revision=44006
2012-07-25Remove packet_list->column_typesJakub Zawadzki1-45/+33
svn path=/trunk/; revision=44005