aboutsummaryrefslogtreecommitdiffstats
path: root/epan/frame_data.h
AgeCommit message (Collapse)AuthorFilesLines
2016-04-04Include ws_diag_control.h in config.hJoão Valverde1-2/+2
Change-Id: Ia394071710ecda3b0e6686a51fbca45a8ff20317 Reviewed-on: https://code.wireshark.org/review/14749 Petri-Dish: João Valverde <j@v6e.pt> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-01-25Move the proto data stuff out of frame_data.[ch].Guy Harris1-7/+0
It's not tied to the frame_data structure any more, so it belongs by itself. Clean up some #includes while we're at it; in particular, frame_data.h doesn't use anything related to tvbuffs, so don't have it gratuitiously include tvbuff.h. Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c Reviewed-on: https://code.wireshark.org/review/13518 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-1/+0
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23Add more fields to packet_info structure and use them.Guy Harris1-1/+0
Add fields for the absolute time stamp (and another field for a presence flag for the absolute time stamp) and the packet encapsulation for the packet. This lets us remove the field for the packet encapsulation in the frame_data structure; do so. Change-Id: Ifb910a9a192414e2a53086f3f7b97f39ed36aa39 Reviewed-on: https://code.wireshark.org/review/13499 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-13Do not apply color rule filter every dissectionPeter Wu1-0/+1
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>
2015-11-27Fix display of bytes as EBCDICPascal Quantin1-1/+2
MSVC compiler does not support properly setting an enum being part of a bit field. For example the following code: pinfo->fd->flags.encoding = PACKET_CHAR_ENC_CHAR_EBCDIC; changes pinfo->fd->flags.encoding from 0x0 to 0xfffffffe instead of 0x1 Let's put back an unsigned int definition (like it is in master-1.12 branch) and add explicit casts where required Bug: 11787 Change-Id: Idae0140fb6c172f1b3dbf10baefc8cfb00128f4c Reviewed-on: https://code.wireshark.org/review/12220 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>
2015-10-12Get rid of a void * in frame_data.Gerald Combs1-1/+2
Forward-declare struct _color_filter and use it in struct _frame_data. Change-Id: I4543206bc71ad1e088b60347e6deb6d87a573b35 Reviewed-on: https://code.wireshark.org/review/10914 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-14Fix diagnostics macros and squelch a gcc warning.Gerald Combs1-0/+3
Both clang and gcc define __GNUC__. Make sure we account for that when defining diagnostic macros. Use DIAG_OFF + DIAG_ON to suppress gcc -pedantic warnings about frame_data. Get rid of packet_char_enc casts. Change-Id: Idbcc61bcdb35c1d20f185461c69451dcdf73bae9 Reviewed-on: https://code.wireshark.org/review/7106 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-02-12Qt: Add the "new packet" window^Wdialog^Wwindow.Gerald Combs1-1/+1
Allow persistence across files. Preserve the use of "window" even though we're really a dialog. Update ByteViewTab and ProtoTree to support multiple instances. Remove the need for a cast in frame_data. Add more forward declarations. Change-Id: I50d3d9d1455b8ecc158a37218f9e41fe696d5ae2 Reviewed-on: https://code.wireshark.org/review/7086 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-06Qt: Packet list column sorting.Gerald Combs1-0/+8
Sorting behavior should be identical to GTK+. Pass the correct position to beginInsertRows. Add a list of to-do items to packet_list.cpp. Change-Id: Ie6ab4b9f2d780a2af430d0f90529edca5485dada Reviewed-on: https://code.wireshark.org/review/4481 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-28Make the time stamp resolution per-packet.Guy Harris1-0/+1
Pcap-ng files don't have a per-file time stamp resolution, they have a per-interface time stamp resolution. Add new time stamp resolution types of "unknown" and "per-packet", add the time stamp resolution to struct wtap_pkthdr, have the libwiretap core initialize it to the per-file time stamp resolution, and have pcap-ng do the same thing with the resolution that it does with the packet encapsulation. Get rid of the TS_PREC_AUTO_XXX values; just have TS_PREC_AUTO, which means "use the packet's resolution to determine how many significant digits to display". Rename all the WTAP_FILE_TSPREC_XXX values to WTAP_TSPREC_XXX, as they're also used for per-packet values. Change-Id: If9fd8f799b19836a5104aaa0870a951498886c69 Reviewed-on: https://code.wireshark.org/review/4349 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-07Add WS_DLL_PUBLIC for p_remove_proto_data and tvb_child_uncompres functionAlexis La Goutte1-1/+1
Change-Id: If043683f366fedd849688ca3c512707954221a3b Reviewed-on: https://code.wireshark.org/review/984 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-06Fix indent (use 2 spaces) and add modelinse info for frame_data.hAlexis La Goutte1-2/+15
Change-Id: Ib9eced1b652345cd40edb96ddde092f41a8f669c Reviewed-on: https://code.wireshark.org/review/986 Reviewed-by: Michael Mann <mmann78@netscape.net>
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-22Avoid including definition of column_info structure in dissectors.Jakub Zawadzki1-1/+0
Move COL_* enum to <epan/column-utils.h> XXX Later we can rename epan/column-info.h to column-int.h (or smth like this) svn path=/trunk/; revision=54352
2013-11-29Avoid including <wiretap/wtap.h> in dissectors.Jakub Zawadzki1-14/+4
svn path=/trunk/; revision=53655
2013-11-23Use 32bit key in p_add_proto_data() and friends. Bug 9453 ↵Michael Mann1-3/+3
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9453) From Dirk svn path=/trunk/; revision=53529
2013-11-23Create the ability to have packet scoped "proto" data. Bug 9470 ↵Michael Mann1-4/+5
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470) I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future. And search/replace of a function name is easy enough to do. The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As. All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope(). All other dissectors were converted to using file_scope() which was the original scope for "proto" data. svn path=/trunk/; revision=53520
2013-11-09Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.Jakub Zawadzki1-0/+1
After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy. svn path=/trunk/; revision=53184
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-08-01Remove fdata->opt_comment, add pkt_comment to pinfoJakub Zawadzki1-1/+2
Original (read from file) comments can be accessed by pkthdr->opt_comment Keep user comments in seperated BST, add new method for epan session to get it. svn path=/trunk/; revision=51090
2013-07-30Remove interface_id, pack_flags from frame_data structure.Jakub Zawadzki1-4/+0
This patch assumes that wtap_phdr interface_id, pack_flags both from initial read and seek read will contain same values. Please fix if it's not. svn path=/trunk/; revision=51041
2013-07-21Replace relative timestamp with reference frame number. Saves 16B per frame.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=50772
2013-07-21Add helper function to epan_session which can be used to get absolute ↵Jakub Zawadzki1-7/+8
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-06-25Move a couple of time-related modules into wsutil.Jeff Morriss1-1/+1
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-05-30Add Doxygen boilerplate for some of our core modules and data structures.Gerald Combs1-0/+11
svn path=/trunk/; revision=49640
2013-05-15Un-shadow a couple of variables.Gerald Combs1-1/+1
svn path=/trunk/; revision=49317
2013-05-15- Use the key for comparison of per_proto_data.Anders Broman1-0/+1
- Show the number of per-packet-data entries and which protocol has made entries in the frame. svn path=/trunk/; revision=49313
2013-05-12Add the posibillity to use a key for per-packet-data.Anders Broman1-3/+3
svn path=/trunk/; revision=49259
2013-03-15Fix the leaking of packet comments, i.e. the rest ofEvan Huus1-1/+3
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7530 The frame_data_cleanup function was ambiguous; it was being used for two different purposes, and did neither of them quite properly. Split it instead into frame_data_reset and frame_data_destroy, and call the correct one depending on why we were originally calling frame_data_cleanup. svn path=/trunk/; revision=48324
2013-03-01Export libwireshark symbols using WS_DLL_PUBLIC defineBalint Reczey1-8/+9
Also remove old WS_VAR_IMPORT define and related Makefile magic everywhere in the project. svn path=/trunk/; revision=47992
2013-02-26Move pack_flags to better place.Jakub Zawadzki1-1/+1
Reduce sizeof(frame_data) from 136 to 128 (AMD64). svn path=/trunk/; revision=47905
2012-12-26Fix a bunch of warnings.Guy Harris1-1/+1
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-12-22Add support for displaying the Packet Block Flags Word of pcapng.Michael Tüxen1-0/+2
svn path=/trunk/; revision=46698
2012-10-30Update the Qt byte view widget to reflect the recent changes in the GTK+Gerald Combs1-3/+8
byte view. Move the packet_char_enc enum from packet.h to frame_data.h. Make the encoding flag a packet_char_enc and make it one bit. Get rid of the "cfile" global in a few places. C++-ize some of the font code. Clean up some variable names. svn path=/trunk/; revision=45838
2012-10-20Make data_source opqaue, add getter for tvb.Jakub Zawadzki1-10/+0
svn path=/trunk/; revision=45672
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-2/+2
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-09-23Store pointers to previously displayed and captured packet, not nstime_t deltas.Jakub Zawadzki1-6/+8
This commit reduces size (from 144B to 128B on AMD64) of frame_data structure. Part of bug 5821: Reduce per-packet memory requirements. svn path=/trunk/; revision=45071
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-02-28Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3315 -Jeff Morriss1-0/+1
make Save-As/Displayed/All-Packets save not only the displayed packets but also any other packets needed (e.g., for reassembly) to fully dissect the displayed packets. This works only for the "All packets" case; choosing only the Selected packet, the Marked packets, or a range of packets would require actually storing which packets depend on which (too much memory) or going through the packet list many times (too slow). Also, this behavior is always the case: you can't save the displayed packets without their dependencies (I don't see why this would be desirable). So far this is done for SCTP and things using the reassembly routines (TCP has been tested). The Win32 dialog was modified but hasn't been tested yet. One confusing aspect of the UI is that the Displayed count in the Save-As dialog does not match the number of displayed packets. (I tried renaming the button "Displayed + Dependencies" but it looked too big.) The tooltip tries to explain this and the fact that this works only in the All-Packets case; suggestions for improvement are welcome. Implementation details: Dissectors (or the reassembly code) can list frames which were needed to build the current frame's tree. If the current frame passes the display filter then each listed frame is marked as "depended upon" (this takes up the last free frame_data flag). When performing a Save-As/Displayed/All-Packets then choose packets which passed the dfilter _or_ are depended upon. svn path=/trunk/; revision=41216
2012-02-25Add a presence flag field to the packet information structure filled inGuy Harris1-0/+2
by Wiretap, to indicate whether certain fields in that structure actually have data in them. Use the "time stamp present" flag to omit showing time stamp information for packets (and "packets") that don't have time stamps; don't bother working very hard to "fake" a time stamp for data files. Use the "interface ID present" flag to omit the interface ID for packets that don't have an interface ID. We don't use the "captured length, separate from packet length, present" flag to omit the captured length; that flag might be present but equal to the packet length, and if you want to know if a packet was cut short by a snapshot length, comparing the values would be the way to do that. More work is needed to have wiretap/pcapng.c properly report the flags, e.g. reporting no time stamp being present for a Simple Packet Block. svn path=/trunk/; revision=41185
2012-02-11Add the abillity to read and write option comments unedited.Anders Broman1-14/+16
This is POC we may want to have more efficient use of the frame data structure etc. But this allows for work to be done on the GUI to actually add comments. svn path=/trunk/; revision=40969
2011-08-13From Edwin Groothuis via bug 6179:Stig Bjørlykke1-0/+1
Added Time Shift functionality. From me: Renamed to use "Time Shift" everywhere + some other minor cleanups. svn path=/trunk/; revision=38510
2011-05-12Packet editor: support for saving changed frames.Jakub Zawadzki1-0/+8
svn path=/trunk/; revision=37099
2011-05-03TShark doesn't need column text attached to each frame; move col_textGuy Harris1-3/+0
and col_text_len from the frame_data structure to the PacketRecord structure. svn path=/trunk/; revision=36967
2011-04-25Store the frame_data structures in a tree, rather than a linked list. Guy Harris1-2/+0
This lets us get rid of the per-frame_data-structure prev and next pointers, saving memory (at least according to Activity Monitor's report of the virtual address space size on my Snow Leopard machine, it's a noticeable saving), and lets us look up frame_data structures by frame number in O(log2(number of frames)) time rather than O(number of frames) time. It seems to take more CPU time when reading in the file, but seems to go from "finished reading in all the packets" to "displaying the packets" faster and seems to free up the frame_data structures faster when closing the file. It *is* doing more copying, currently, as we now don't allocate the frame_data structure until after the packet has passed the read filter, so that might account for the additional CPU time. (Oh, and, for what it's worth, on an LP64 platform, a frame_data structure is exactly 128 bytes long. However, there's more stuff to remove, so the power-of-2 size is not guaranteed to remain, and it's not a power-of-2 size on an ILP32 platform.) It also means we don't need GLib 2.10 or later for the two-pass mode in TShark. It also means some code in the TCP dissector that was checking pinfo->fd->next to see if it's NULL, in order to see if this is the last packet in the file, no longer works, but that wasn't guaranteed to work anyway: we might be doing a one-pass read through the capture in TShark; we might be dissecting the frame while we're reading in the packets for the first time in Wireshark; we might be doing a live capture in Wireshark; in which case packets might be prematurely considered "the last packet". #if 0 the no-longer-working tests, pending figuring out a better way of doing it. svn path=/trunk/; revision=36849
2011-03-08Removal of the old packet-list in favor of the new packet list.Sake Blok1-2/+0
It compiles with "./configure without options" on my Mac. Let's see what the buildbots have to say about it :-) svn path=/trunk/; revision=36161
2010-08-29Doxygen changes.Anders Broman1-24/+24
svn path=/trunk/; revision=33990
2010-08-28Doxygen changes.Anders Broman1-27/+29
svn path=/trunk/; revision=33981
2010-07-22In the frame_data structure, expand the per-packetGuy Harris1-2/+2
encapsulation/data-link type to 16 bits, and shuffle some fields to eliminate some unnecessary padding - the net result should be no change in the structure size for 32 bits and a few bytes removed for 64 bits. This allows more encapsulation types - we've just about run out of the ones that fit in a signed 8-bit integer - and thus should fix bug 5025. svn path=/trunk/; revision=33613