aboutsummaryrefslogtreecommitdiffstats
path: root/proto_hier_stats.c
AgeCommit message (Collapse)AuthorFilesLines
2010-08-13Get rid of some no-longer-necessary includes of simple_dialog.h (nowguy1-1/+0
that cf_read_frame() and cf_read_frame_r() pop up an alert box on an error, its callers no longer do so). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33792 f5534014-38df-0310-8fa8-9805f1628bb7
2010-08-13Instead of using a Boolean for the search direction, use an enum, soguy1-6/+1
that you can tell from examination whether the search is forward or backward. Make the cf_find_packet routines take the direction as an explicit argument, rather than, in the cases where you don't want to permanently set the direction, saving the direction in the capture_file structure, changing it, doing the search, and restoring the saved direction. Give more information in the Doxygen comments for those routines. Add a cf_find_packet_dfilter_string() routine, which takes a filter string rather than a compiled filter as an argument. Replace find_previous_next_frame_with_filter() with it. Have cf_read_frame_r() and cf_read_frame() pop up the error dialog if the read fails, rather than leaving that up to its caller. That lets us eliminate cf_read_error_message(), by swallowing its code into cf_read_frame_r(). Add Doxygen comments for cf_read_frame_r() and cf_read_frame(). Don't have find_packet() read the packet before calling the callback routine; leave that up to the callback routine. Add cf_find_packet_marked(), to find the next or previous marked packet, and cf_find_packet_time_reference(), to find the next or previous time reference packet. Those routines do *not* need to read the packet data to see if it matches; that lets them run much faster. Clean up indentation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33791 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-26From Jakub Zawadzki:etxrab1-2/+1
New functions: cf_read_frame_r, cf_read_frame It's much easier to write: cf_read_frame (cf, fdata, &err, &err_info) Than: wtap_seek_read (cf->wth, fdata->file_off, &cf->pseudo_header, cf->pd, fdata->cap_len, &err, &err_info) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32980 f5534014-38df-0310-8fa8-9805f1628bb7
2010-03-27Squelch some compiler warnings.guy1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32312 f5534014-38df-0310-8fa8-9805f1628bb7
2009-09-21Rename capture_file.plist to capture_file.plist_start to make it consistent ↵krj1-3/+3
with capture_file.plist_end git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30047 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-26(FWIW) One step towards including stdio.h & stdlib.h only when req'd.wmeier1-0/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29568 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-21Also fake empty field_info's by gracefully handling NULL field_info pointer ↵krj1-1/+2
elsewhere. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29490 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-13Introduce epan_dissect_init()/epan_dissect_cleanup(). These are used to ↵krj1-6/+6
initialise/cleanup stack allocated 'edt' structures. This should speed up dissection since we avoid some malloc traffic. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29404 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-11TRY_TO_FAKE_THIS_ITEM now fakes FT_PROTOCOL per default. If there are any ↵krj1-0/+2
users (e.g. proto_hier_stats.c, others?) that relies on FT_PROTOCOL nodes being created they'll now need to call the newly introduced epan_dissect_fake_protocols() to disable this optimization. Also make use of TRY_TO_FAKE_THIS_ITEM in proto_tree_add_text_node(), proto_tree_add_none_format() and proto_tree_add_protocol_format(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29380 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-09Add PTREE_FINFO and use PITEM_FINFO when possible.krj1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29355 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-09Add PNODE_FINFO. We've been using PITEM_FINFO on proto_node's. This works ↵krj1-1/+1
because proto_item is typedefed to proto_node. We shouldn't rely on this since this is an implementation detail. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29354 f5534014-38df-0310-8fa8-9805f1628bb7
2009-04-21Turn on -Wshorten-64-to-32 by default, and fix some issues that turnedguy1-1/+1
up (99 44/100% of which were assignments of double-precision floating-point constants to floats). Hopefully this will catch at least some P64 issues on UN*X. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28108 f5534014-38df-0310-8fa8-9805f1628bb7
2007-12-06Added "Apply as filter"/"Prepare a filter"/"Find frame"/"Colorize Protocol"stig1-1/+0
menu. Simplified getting the Display filter. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23786 f5534014-38df-0310-8fa8-9805f1628bb7
2007-12-03Include reassembled protocols, as this probably is the output the user wants.stig1-8/+14
The Bytes and End Bytes columns will be wrong for reassembled protocols, as they span across several packets, but I don't see any obvious way to display such values. The correct values can be found by looking at the parent protocols. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23700 f5534014-38df-0310-8fa8-9805f1628bb7
2007-11-30Show the Display filter in Protocol Hierarchy Statistics.stig1-0/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23686 f5534014-38df-0310-8fa8-9805f1628bb7
2007-11-29Count stats for parent if encountering a field not related to a protocol.stig1-16/+6
This fixes a bug where packets having toplevel tree items for desegmentation (like [Reassembled TCP Segments]) are not added to the Protocol Hierarchy Statistics "End Packets" and "End Bytes" columns. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23667 f5534014-38df-0310-8fa8-9805f1628bb7
2007-01-25Fix for bug #1325: Protocol hierarchy display shows an empty line because ofsfisher1-0/+9
the hop-by-hop option header tree in the main protocol tree. This fix skips those entries that don't have a name assigned to them and goes on to the next entry before adding it to the protocol hierarchy display. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20558 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-21name changesahlberg1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18197 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-12Allow a progress dialog to have "Stop" or "Cancel" as the "terminateguy1-1/+1
button"; "Stop" should be used for operations that can only be stopped (meaning that what it's already done isn't undone), not cancelled (meaning that whatever it's already done *is* undone), for which "Cancel" is used. Allow the merging process to be cancelled. Clean up indentation. Update some comments. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16489 f5534014-38df-0310-8fa8-9805f1628bb7
2005-10-27Fix uninitialized variable errors.guy1-4/+6
Rename some variables to make the names used in progress bars more common. (Should more of that functionality be moved into common progress bar code?) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16347 f5534014-38df-0310-8fa8-9805f1628bb7
2005-10-27Check on every iteration of a loop whether to pop up a dialog box,guy1-6/+11
rather than checking only on every progress bar update quantum, so that if the update quantum is *very* large, we don't end up waiting longer than the standard time for a dialog box before checking. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16327 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-24EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry! ulfl1-8/+2
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ... What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere. As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon. Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way... As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15520 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-29add fix for bug 224sahlberg1-2/+4
we now put generated items as top-level items in the decode pane so we should not check and abort if such are found. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14819 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-04fix #224: hierarchy stats had problems with the new generated toplevel ↵ulfl1-3/+9
desegmentation items "[Reassembled TCP Segments]" git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14549 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-07From Didier:sahlberg1-3/+4
optimization for COLUMNS to make ethereal faster when filtering optimization to make the slow find_protocol_by_id() fast. (idea from Didier, implementation modified by me to be less intrusive) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14026 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18Set the svn:eol-style property on all text files to "native", so thatguy1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-17* Protocol Hierarchy Statistics:deniel1-3/+27
- store times of first and last packets in ph_stats_t - add bandwidth columns in GUI - miscellaneous code cleaning git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10398 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-31Pass ESD_BTN_OK rather than NULL as a second argument toguy1-2/+2
"simple_dialog()"; NULL might be #defined to be a pointer expression on some platforms, causing compiler warnings (and, on platforms where a null pointer doesn't have all its bits 0, possibly causing misbehavior, although I don't think there are any such platforms on which Ethereal runs). Don't allow 0 as button mask argument to "simple_dialog()". Squelch a compiler warning. Report fatal problems as errors, not warnings. Report file I/O errors with "file_open_error_message()". Report file write errors (including those reported by "close()", e.g. some errors writing to an NFS server) when saving raw packet data to a file. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9915 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-31renamed ESD_TYPE_CRIT to ESD_TYPE_ERROR toulfl1-2/+2
better reflect the real error text git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9913 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-25Have the Wiretap open, read, and seek-and-read routines return, inguy1-3/+4
addition to an error code, an error info string, for WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and WTAP_ERR_BAD_RECORD errors. Replace the error messages logged with "g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed strings returned as the error info string, and change the callers of those routines to, for those errors, put the info string into the printed message or alert box for the error. Add messages for cases where those errors were returned without printing an additional message. Nobody uses the error code from "cf_read()" - "cf_read()" puts up the alert box itself for failures; get rid of the error code, so it just returns a success/failure indication. Rename "file_read_error_message()" to "cf_read_error_message()", as it handles read errors from Wiretap, and have it take an error info string as an argument. (That handles a lot of the work of putting the info string into the error message.) Make some variables in "ascend-grammar.y" static. Check the return value of "erf_read_header()" in "erf_seek_read()". Get rid of an unused #define in "i4btrace.c". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9852 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-21The progressbar had a parameter to specify the text of the Cancel/Stop button.ulfl1-2/+2
As this will always be a Cancel of a running operation, this parameter was removed. This makes us also able to use a stock button for this. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9774 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-09We don't need to keep the progress bar quantum or next step in theguy1-5/+7
capture_file structure - just make it local to the routine scanning through the packets. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9616 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-04Don't use GNodes for the protocol tree, put the sibling pointer, andguy1-7/+7
pointers to the first *and* last child, in the "proto_node" structure itself. That saves us one level of indirection and memory allocation, and lets us append to a tree by appending to the last child directly, rather than having to scan through the list of siblings of the first child to find the end of that list. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9171 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-03The "ptr_u" unions no longer have a "next" pointer - they now just haveguy1-3/+3
one member - or have one that's not used, so get rid of those unions. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9151 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-24Make the recent epan/proto.{c,h} change compile.guy1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9075 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-03Check for "wtap_seek_read()" failing.guy1-6/+20
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8364 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-2/+2
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28From Ulf Lamping: extend the progress dialog box to give more progressguy1-5/+9
information. Fix the types of some variables (make the file position in "read_cap_file()" a "long", as Wiretap supports "long" offsets, and make processed-packet counts in packet-processing loops "int"s, as the total packet count in a "capture_file" structure is an "int"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6112 f5534014-38df-0310-8fa8-9805f1628bb7
2002-07-30From Graeme Hewson:guy1-15/+24
Ethereal sometimes creates a progress dialog bar and then, if the processing is fast, quickly destroys it. The resulting "flash" can be disconcerting. This set of patches ensures a progress bar is either not created or is displayed for a minimum time. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5916 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-31From Joerg Mayer: mark function arguments as unused.guy1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5049 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-05Have "wtap_seek_read()" return 0 on success and -1 on failure, and takeguy1-4/+5
an "err" argument that points to an "int" into which to put an error code if it fails. Check for errors in one call to it, and note that we should do so in other places. In the "wtap_seek_read()" call in the TCP graphing code, don't overwrite "cfile.pseudo_header", and make the buffer into which we read the data WTAP_MAX_PACKET_SIZE bytes, as it should be. In some of the file readers for text files, check for errors from the "parse the record header" and "parse the hex dump" routines when reading sequentially. In "csids_seek_read()", fix some calls to "file_error()" to check the error on the random stream (that being what we're reading). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4874 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-21Include files from the "epan" directory and subdirectories thereof withguy1-2/+2
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4586 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-02A proper fix for pulling the header_field_info* from a stat_node.gram1-15/+18
Gerald's fix wasn't the real problem; the original code was wrong in treating a GNode containing a ph_stats_node_t as a GNode that is part of a proto_tree; it worked because of the coincidental layout of the two structs. Now the code has been fixed, and some macros have been added for accessing the GNodes and some variables renamed so that the code is clearer. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4464 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-31Fix a pointer error in find_stat_node.gerald1-2/+2
Define a default width and maximum height for the stats dialog. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4463 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-18Provide for per-protocol-tree data in the proto_tree code.gram1-10/+12
Put a hash-table of "interesting" fields in the per-proto-tree data. The dfilter code records which fields/protocols are "interesting" (by which I mean, their value or existence is checked). Thus, the proto_tree routines can create special arrays of field_info*'s that are ready for the dfilter engine to use during a filter operation. Also store the "proto_tree_is_visible" boolean, renamed "visible", in the per-proto-tree data. Move epan_dissect_t to its own header file to make #include dependencies easier to handle. Provide epan_dissect_fill_in_columns(), which accepts just the epan_dissect_t* as an argument. epan_dissect_new() needs to be followed by epan_dissect_run() for the dissection to actually take place. Between those two calls, epan_dissect_prime_dfilter() can be run 0, 1, or multiple times in order to prime the empty proto_tree with the "intersesting" fields from the dfilter_t. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4422 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-16Add an extra argument to "epan_dissect_new()" that indicates whether theguy1-2/+2
display representation should be put into protocol tree items if a protocol tree is to be constructed; have it set "proto_tree_is_visible" from that argument. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4408 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"guy1-6/+5
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4370 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-06Remove proto_tree from capture_file and PacketWinData, since theygram1-7/+3
already contain a pointer to an epan_dissect_t, which contains the proto_tree. Routines calling epan_dissect_new() do not create their own proto_tree via proto_tree_create_root(); instead, they pass a boolean to epan_dissect_new() telling it whether it should create the root proto_tree. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4343 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-19More signed vs. unsigned cleanups, and initialization cleanups, fromguy1-2/+2
Joerg Mayer. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3578 f5534014-38df-0310-8fa8-9805f1628bb7
2001-03-24Give the code that computes protocol statistics a progress dialog box,guy1-10/+69
as, on a large capture, it could take a significant amount of time. Let the user stop the computation and, if they do, don't pop up the statistics dialog box. Create a new header file declaring the routines to create, update, and destroy progress dialog boxes; those routines' APIs don't depend on GTK+, but others declared in "ui_util.h" do, and we don't want to oblige a source file to depend on GTK+ headers unless it uses a GTK+ API or an API that depends on GTK+. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3179 f5534014-38df-0310-8fa8-9805f1628bb7