aboutsummaryrefslogtreecommitdiffstats
path: root/file.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove proto_tree from capture_file and PacketWinData, since theyGilbert Ramirez2001-12-061-2/+1
| | | | | | | | | | | | 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. svn path=/trunk/; revision=4343
* Make the "Save only marked frames" button in the "Save As..." dialog boxGuy Harris2001-12-061-2/+13
| | | | | | sensitive only if there *are* marked frames. svn path=/trunk/; revision=4341
* Make the bytes-written information from Wiretap a long, as we allowGuy Harris2001-12-041-2/+4
| | | | | | | | | | | | | | files to get that big. From Thomas Wittwer and Matthias Nyffenegger: Support for "ring buffer mode", wherein there's a ring buffer of N capture files; as each capture file reaches its maximum size (the ring buffer works only with a maximum capture file size specified), Ethereal rolls over to the next capture file in the ring buffer, replacing whatever packets might be in it with new packets. svn path=/trunk/; revision=4323
* Support for stopping capture at specified capture file size or captureGuy Harris2001-12-041-1/+5
| | | | | | duration, from Thomas Wittwer and Matthias Nyffenegger. svn path=/trunk/; revision=4322
* "open_cap_file()" in Ethereal and Tethereal don't use the FILE_T theyGuy Harris2001-07-051-14/+1
| | | | | | | | | | | | | | | | | get from calling "wtap_file()", so get rid of the call and the (otherwise unused) variable to which its result gets assigned. That lets us get rid of "wtap_file()" in Wiretap. It also lets us get rid of the include of "zlib.h" in "file.h"; the #defines of "file_open()", "filed_open()", and "file_close()" are also unnecessary, so we get rid of those as well. However, that means we need to include <zlib.h> in "gtk/main.c" and "tethereal.c", so that the version number of libz is defined and can show up in the version string. svn path=/trunk/; revision=3652
* Enable "Match Selected" only if there's a field selected *and* we can doGuy Harris2001-06-051-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a "Match Selected" on it - we can't do a "Match Selected" if the field has no value (e.g., FT_NULL) and has a length of 0. If we unselect the current packet, we don't have a protocol tree, so we don't have a currently selected field - clear the "Match Selected" menu item and the display in the status line of information about the currently selected field. Move the low-level statusbar manipulation into "gtk/main.c", in routines whose API doesn't expose anything GTK+-ish. "close_cap_file()" calls one of those routines to clear out the status bar, so it doesn't need to take a pointer to the statusbar widget as an argument. "clear_tree_and_hex_views()" is purely a display-manipulating routine; move it to "gtk/proto_draw.c". Extract from "tree_view_unselect_row_cb()" an "unselect_field()" routine to do all the work that needs to be done if the currently selected protocol tree row is unselected, and call it if the currently selected packet list row is unselected (if it's unselected, there *is* no protocol tree, so no row can be selected), as well as from "tree_view_unselect_row_cb()". Before pushing a new field-description message onto the statusbar, pop the old one off. Get rid of an unused variable (set, but not used). svn path=/trunk/; revision=3513
* Check the validity of numbers specified in command-line options.Guy Harris2001-04-181-3/+3
| | | | svn path=/trunk/; revision=3326
* In Ethereal, attempt to get the packet statistics from libpcap whenGuy Harris2001-02-111-1/+2
| | | | | | | | | | | | capturing; if we succeed, display the packet drops count as the "Drops" value in the status line and as the "Dropped packets" statistics in the summary dialog box, otherwise don't display it at all. In Tethereal, attempt to get the packet statistics from libpcap when capturing; if we succeed, and if there were any dropped packets, print out the count of dropped packets when the capture finishes. svn path=/trunk/; revision=3016
* Create a more modular type system for the FT_* types. Put themGilbert Ramirez2001-02-011-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | into epan/ftypes. Re-write display filter routines using Lemon parser instead of yacc. Besides using a different tool, the new grammar is much simpler, while the display filter engine itself is more powerful and more easily extended. Add dftest executable, to test display filter "bytecode" generation. Add option to "configure" to build dftest or randpkt, both of which are not built by default. Implement Ed Warnicke's ideas about dranges in the new display filter and ftype code. Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree, while FT_PROTOCOL is used for protocols. This was necessary for being able to make byte slices (ranges) out of protocols, like "frame[0:3]" Win32 Makefile.nmake's will be added tonight. svn path=/trunk/; revision=2967
* There's no need for a member of a "capture_file" structure holding aGuy Harris2001-01-281-8/+1
| | | | | | | | | | | | | compiled capture filter program, so remove it, and remove the include of <pcap.h> from "file.h"; instead, have local "struct bpf_program" structures where needed, and have those files that need stuff from <pcap.h> include it. This cleans stuff up a bit, and should eliminate a pile of compile warnings with Visual C++ due to <pcap.h> and some GTK+/GLib header file (or files they include) both defining "inline". svn path=/trunk/; revision=2954
* Remove #include "gtk/colors.h" from file.h, which keep the GTK+ headerGilbert Ramirez2000-10-201-3/+2
| | | | | | | | files from being #included in epan/packet.c. Fix the other files that need either "gtk/colors.h" or <gtk/gtk.h> #included as a result of not pulling in gtk/colors.h automatically because of file.h. svn path=/trunk/; revision=2519
* Implement epan_dissect_new() and epan_dissect_free(). These are theGilbert Ramirez2000-10-061-1/+4
| | | | | | | | | | | | | | | | | | | "top-level" dissectors that libepan-users call, instead of dissect_packet(). The epan_dissect_t holds the tvbuff after dissection so that the tvbuff's memory is not cleared until after the proto_tree is freed. (I might stuff the proto_tree into the epan_dissect_t, too). What remains of dissect_packet() in packet.c handles the tvbuff initialiation. The real meat of dissect_packet() is now in dissect_frame(), in packet-frame.c This means that "packet.c" is no longer a dissector, os it is no longer passed to make-reg-dotc. Once dissect_fddi() gets two wrapper functions (dissect_fddi_swapped() and dissect_fddi_nonswapped()), the a dissector handoff routine could be used instead of the switch statement in dissect_frame(). I'd register a field like "wtap.encap" svn path=/trunk/; revision=2478
* Frames in the packet list can now be marked by the user usingLaurent Deniel2000-08-211-2/+2
| | | | | | | | | | | | | | the middle mouse button. The marked packets are displayed in reverse video but this should change in the future (the color should be configurable via the GUI). Then, the marked packets can be saved (via the "Save as" window dialog). Other features will be added in the future (I am waiting for your comments and wishes). svn path=/trunk/; revision=2322
* Miscellaneous code cleaningLaurent Deniel2000-08-111-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add <stdarg.h> or <varargs.h> in snprintf.h and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes - remove the check of multiple inclusions in source (.c) code (there is a bit loss of _cpp_ performance, but I prefer the gain of code reading and maintenance; and nowadays, disk caches and VM are correctly optimized ;-). - protect all (well almost) header files against multiple inclusions - add header (i.e. GPL license) in some include files - reorganize a bit the way header files are included: First: #include <system_include_files> #include <external_package_include_files (e.g. gtk, glib etc.)> Then #include "ethereal_include_files" with the correct HAVE_XXX or NEED_XXX protections. - add some HAVE_XXX checks before including some system header files - add the same HAVE_XXX in wiretap as in ethereal Please forgive me, if I break something (I've only compiled and regression tested on Linux). svn path=/trunk/; revision=2254
* Make copy_binary_file() static since follow_dlg.c no longer uses it.Gilbert Ramirez2000-08-091-3/+1
| | | | svn path=/trunk/; revision=2237
* Add a "Save As" feature to the TCP Follow dialogue, to save the streamGilbert Ramirez2000-08-031-1/+3
| | | | | | | | | | | file to a user-specified file. Move the file-copy routine in save_cap_file() to an indepenent function in file.c (copy_binary_file()) so that follow_dlg.c can use it. Remove #include "follow.h" from the C files that don't need it. svn path=/trunk/; revision=2200
* Use ESD_TYPE_CRIT for most errors (the model used by various GUIs seemsGuy Harris2000-07-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | to use "warning" dialog boxes only to warn the user "if you do that, bad things may happen" *and* to offer them the option either to drive on or quit, so perhaps ESD_TYPE_CRIT should be used for all errors). However, put "Ethereal: Error" rather than "Ethereal: Critical" in the title bar, in the hopes that it'll make it clearer that Something Bad Happened. If the user specifies that captures should be saved to a user-specified file rather than a temporary file, report errors trying to create that file with "file_open_error_message()". Make the "for_writing" argument to "file_open_error_message()" a "gboolean", as it's either TRUE (if the file is being opened for writing) or FALSE (if it's being opened for reading). Report EISDIR as "XXX is a directory (folder), not a file.". svn path=/trunk/; revision=2143
* Turn the code of "colorize_packet()" into a static routine that is givenGuy Harris2000-07-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a word to use in the progress dialog, and a flag indicating whether the display filter is to be reevaluated or not, and: have "colorize_packet()" call that routine with "Colorizing" and FALSE as those arguments; have the filtering code call that routine with "Filtering" and TRUE as those arguments; add an exported routine to call that routine with "Reprocessing" and TRUE as those arguments, to use to re-generate the packet list and to re-filter the packets if a protocol preference has been changed. Keep track of whether preferences are changed from their initial value by a preferences file or a command-line option, or from their previous value by the "Preferences" dialog box; have "prefs_apply_all()" only call the "apply" callback for a module if they have. Call "prefs_apply_all()" after the command-line arguments have been parsed and after "OK" has been clicked in the "Preferences" dialog box, to notify modules of preference changes if they've registered a callback for that. After "OK" has been clicked in the "Preferences" dialog box, if any preferences have changed, call the reprocessing routine, as the summary line for some frames and/or the current display filter's value when applied to some frames may have changed as a result of a preference change. Do the same after "OK" or "Apply" has been clicked in the "Display Options" dialog box (as it controls a protocol preferences item. svn path=/trunk/; revision=2126
* Remove the progress bar from the status line, and, instead, for anyGuy Harris2000-07-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | potentially long-running operation that has a progress indicator, pop up a modal dialog box with an indication of what is being done; a progress bar; a "Cancel" button to stop the operation. This: leaves more room on the status line for a filter expression; provides a mechanism to allow the user to cancel long-running operations (although the way we do so may not back out of them as nicely as the user might like, if it's not obvious what the "right" way is or if the "right" way is difficult to implement or involves doing as much work as letting the operation continue); means that, because the dialog box is modal, we don't have to worry about the user performing arbitrary UI operations out from under the operation and changing arbitrary bits of state being used by that operation. svn path=/trunk/; revision=2103
* Add routines to Wiretap to allow a client of Wiretap to get:Guy Harris2000-06-271-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a pointer to the "wtap_pkthdr" structure for an open capture file; a pointer to the "wtap_pseudo_header" union for an open capture file; a pointer to the packet buffer for an open capture file; so that a program using "wtap_read()" in a loop can get at those items. Keep, in a "capture_file" structure, an indicator of whether: no file is open; a file is open, and being read; a file is open, and is being read, but the user tried to quit out of reading the file (e.g., by doing "File/Quit"); a file is open, and has been completely read. Abort if we try to close a capture that's being read if the user hasn't tried to quit out of the read. Have "File/Quit" check if a file is being read; if so, just set the state indicator to "user tried to quit out of it", so that the code reading the file can do what's appropriate to clean up, rather than closing the file out from under that code and causing crashes. Have "read_cap_file()" read the capture file with a loop using "wtap_read()", rather than by using "wtap_loop()"; have it check after reading each packet whether the user tried to abort the read and, if so, close the capture and return an indication that the read was aborted by the user. Otherwise, return an indication of whether the read completely succeeded or failed in the middle (and, if it failed, return the error code through a pointer). Have "continue_tail_cap_file()" read the capture file with a loop using "wtap_read()", rather than by using "wtap_loop()"; have it check after reading each packet whether the user tried to abort the read and, if so, quit the loop, and after the loop finishes (even if it read no packets), return an indication that the read was aborted by the user if that happened. Otherwise, return an indication of whether the read completely succeeded or failed in the middle (and, if it failed, return the error code through a pointer). Have "finish_tail_cap_file()" read the capture file with a loop using "wtap_read()", rather than by using "wtap_loop()"; have it check after reading each packet whether the user tried to abort the read and, if so, quit the loop, and after the loop finishes (even if it read no packets), close the capture and return an indication that the read was aborted by the user if that happened. Otherwise, return an indication of whether the read completely succeeded or failed in the middle (and, if it failed, return the error code through a pointer). Have their callers check whether the read was aborted or not and, if it was, bail out in the appropriate fashion (exit if it's reading a file specified by "-r" on the command line; exit the main loop if it's reading a file specified with File->Open; kill the capture child if it's "continue_tail_cap_file()"; exit the main loop if it's "finish_tail_cap_file()". svn path=/trunk/; revision=2095
* Add wtap-int.h. Move definitions relevant to the internal workins of wiretapGilbert Ramirez2000-05-191-2/+2
| | | | | | | | | to that file, leave public definitions in wtap.h. Rename "union pseudo_header" to "union wtap_pseudo_header". Make the wtap_pseudo_header pointer available in packet_info struct. svn path=/trunk/; revision=1989
* Remove the "union pseudo_header" from the "frame_data" structure;Guy Harris2000-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | there's no need to keep it around in memory - when the frame data is read in when handing a frame, read in the information, if any, necessary to reconstruct the frame header, and reconstruct it. This saves some memory. This requires that the seek-and-read function be implemented inside Wiretap, and that the Wiretap handle remain open even after we've finished reading the file sequentially. This also points out that we can't really do X.25-over-Ethernet correctly, as we don't know where the direction (DTE->DCE or DCE->DTE) flag is stored; it's not clear how the Ethernet type 0x0805 for X.25 Layer 3 is supposed to be handled in any case. We eliminate X.25-over-Ethernet support (until we find out what we're supposed to do). svn path=/trunk/; revision=1975
* We can't trust "cf->current_frame" to refer to the frame that wasGuy Harris2000-05-151-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | selected before we started re-colorizing or re-filtering the display, as when the first row is added to the clist, that may be selected and thus made the current frame. This means that we can't find the row corresponding to the previously-selected frame, if any, by checking as each packet is colorized/filtered and see whether its "frame_data" structure is equal to "cf->current_frame", as that'll always say that the first frame in the display is the selected frame. Instead, we recored the value of "cf->current_frame" before we do anything to the clist, have "add_packet_to_packet_list()" return either the row number of the frame (if it passed the filter and thus was added to the clist) or -1 (if it didn't pass the filter and thus wasn't added to the clist), and, after "add_packet_to_packet_list()", if the current frame is the one that was the selected row, remember its row number (if any), and, when we're finished colorizing/filtering the display, make that row the current row if it's not -1 (-1 means that the selected row didn't pass the filter). Also, don't do that until after we've thawed the clist, as the vertical adjustment for the clist doesn't reflect reality until then, and attempting to go to a given row won't work right until the vertical adjustment for the clist reflects reality. Shove all the code to set the selected and focus rows, and to make said row visible, into a routine, so the "Find Frame" and "Go To Frame" code can use it as well. svn path=/trunk/; revision=1959
* Use a GMemChunk for allocating and freeing "frame_data" structures; itGuy Harris2000-04-031-1/+2
| | | | | | | | | reduces the memory required for one big capture file I have by about 10 megabytes, and speeds up the reading in of that file, presumably because it amortizes the memory-allocator space and CPU time overhead over a set of several "frame_data" structures. svn path=/trunk/; revision=1776
* The color stuff is almost completely toolkit-dependent (this isn't justGuy Harris2000-02-121-2/+2
| | | | | | | | | | | the color-selection and color-filter-editing GUI stuff; different toolkits, and different windows systems, have their own notions of color objects - they may have nothing in common other than the notion that colors have red, green, and blue values); move it all to the "gtk" subdirectory for now, and, as we discover stuff stuff that can be made platform-independent, drag it up to the top-level directory. svn path=/trunk/; revision=1621
* Ethereal shouldn't use "file_seek()", "file_read()", or "file_write()"Guy Harris2000-01-241-9/+1
| | | | | | | | directly; it should use them through Wiretap. (Arguably, it shouldn't use "file_open()", "file_dopen()", or "file_close()" directly, and should use those through Wiretap as well.) svn path=/trunk/; revision=1540
* Don't recompute "cf->count" when filtering packets - the recomputationGuy Harris2000-01-081-2/+1
| | | | | | | | | | | will just give it the value it's always had, as packets are counted regardless of whether they pass the filter or not (which is what we want). Given that, so there's no need for a separate "cf->unfiltered_count" value, so get rid of it and use "cf->count" instead. svn path=/trunk/; revision=1441
* Move GTK code out of summary.c and into gtk/summary_dlg.cGilbert Ramirez1999-12-101-1/+5
| | | | | | | | | | | | summary.c now provides a struct of info (see summary.h) Changed the name of the summary dialogue callback (hence the change in menu.c), and added a close button to the dialogue. Moved #include <gtk/gtk.h> out of print.c and into prefs.h where it was needed for GdkColor. svn path=/trunk/; revision=1273
* To find out the file's packet encapsulation type (which could beGuy Harris1999-12-041-2/+1
| | | | | | | | | | WTAP_ENCAP_PER_PACKET, if there's more than one type of packet in the file, or could be WTAP_ENCAP_UNKNOWN, if the file is of a type that doesn't put an encapsulation type in the file header, and it has no packets), we just need to call "wtap_file_encap()" when we're done reading the file. svn path=/trunk/; revision=1205
* Now that "wtap_file_type_string()" takes a file type rather than a "wtapGuy Harris1999-12-041-2/+1
| | | | | | | | *" as an argument, there's no need to save the file type string in a "capture_file" structure - we save the file type, and can use that when generating the summary display. svn path=/trunk/; revision=1202
* Allow the user to save either all of the current capture, or only theGuy Harris1999-11-301-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | packets that are currently being displayed from that capture. Centralize the code to control whether "File:Save" and "File:Save As" are enabled (and *always* have "File:Save As" enabled if you have a capture; "File:Save" is enabled only if you have a live capture you've not yet saved, although it does the same thing as "File:Save As"). Have the "save_file" member of a "capture_file" structure represent *only* the file currently being *written* to by a capture, and, if there is no capture currently in progress, have it be NULL; the name of the file currently being *displayed" is in the "filename" member, and an "is_tempfile" member indicates whether it's a temporary file for a live capture or not. Have "close_cap_file()" delete the current capture file if it's a temporary capture file that hasn't been saved (in its entirety - saving selected frames doesn't count). Do the same (if there *is* a current capture file) when exiting. The "Ready to load or capture" message is the only statusbar message in the "main" context; "close_cap_file()" should never pop it, it should only pop whatever message exists in the "file" context, and thus has no need to take, as an argument, the context for the message it should pop. Update the man page to reflect the new behavior of "File:Save" and "File:Save As", and to reflect recent changes to "Display:Match Selected". svn path=/trunk/; revision=1170
* In "Go To Frame", distinguish between "there is no frame with that frameGuy Harris1999-11-301-2/+9
| | | | | | | number" and "there is a frame with that frame number, but it didn't pass the current display filter". svn path=/trunk/; revision=1164
* Expand some comments.Guy Harris1999-11-291-7/+7
| | | | svn path=/trunk/; revision=1152
* Move the callback for input available on the sync pipe from "file.c" toGuy Harris1999-11-291-2/+4
| | | | | | | | | | | | | | | | | | | | "capture.c", along with the other code that deals with the sync pipe. Close the sync pipe, and get rid of the temporary capture file, on errors. Split "tail_cap_file()" into routines to set up to read from the capture file, to read a specified number of packets from it when told to do so by the child process, and to read the rest of the capture file and finish up the capture, to provide the code in "capture.c" the hooks it needs. Have a common routine to set the status bar to report the file name and number of dropped packets, to use both when reading in a capture file in its entirety all at once and when done with a "read it while the capture is writing to it" live capture. svn path=/trunk/; revision=1137
* Change display filter entry widget to a GtkCombo.Gerald Combs1999-11-251-2/+2
| | | | | | Modify filter_packtes to return 1 on success, and 0 on failure. svn path=/trunk/; revision=1106
* Clean up some ANSI C nits pointed out by "gcc -pedantic".Guy Harris1999-11-181-8/+1
| | | | svn path=/trunk/; revision=1060
* Add a "Go To Frame" menu item, which lets you go to a frame by frameGuy Harris1999-11-081-1/+2
| | | | | | number. svn path=/trunk/; revision=989
* Pop up a message box if a search for a frame fails.Guy Harris1999-11-061-2/+2
| | | | svn path=/trunk/; revision=985
* Add a "Find Frame" menu item under "Display"; it lets you use a displayGuy Harris1999-11-061-4/+9
| | | | | | | | | | | | | | | | | | filter to search forward or backward in the list of displayed frames for a matching frame. When filtering the display, readjust the display to show the "current" frame if it passed the display filter. When a file is read in, the first frame becomes the "current" frame; when a frame is selected, it becomes the "current" frame, and remains so *even if you unselect it*, until another frame is selected. Select the first frame when a file is read in. Disable most of the "Display" and "Tools" menu items if there's no current capture file, and enable the relevant ones if there is. svn path=/trunk/; revision=982
* When a new display filter is to be applied, don't set "cf.dfilter" orGuy Harris1999-10-111-5/+3
| | | | | | | | | | | | | | | | "cf.dfcode" if the new filter doesn't compile, because the filter currently in effect will be the one that was last applied - just free up the text of the new filter, and whatever memory was allocated for the new filter code. This means we allocate a new dfilter when a new filter is to be applied, rather than recycling stuff from the old filter, as we want the old filter code to remain around if the new filter doesn't compile. This means that "cf.dfilter" and "cf.dfcode" will be null if there's no filter in effect. svn path=/trunk/; revision=803
* Get rid of some unused fields in a "capture_file" structure.Guy Harris1999-10-021-4/+1
| | | | svn path=/trunk/; revision=756
* Add an item to the "File/Print" dialog box to ask that the full hex dataGuy Harris1999-09-291-11/+1
| | | | | | | | | | | | | of the packet be printed (this is only done if "Print detail" is selected; it should be grayed out of "Print summary" is selected). If that item is selected, suppress the hex printing of uninterpreted data items in the protocol tree. Move some GTK+ keys not used outside of "gtk/print_dlg.c" from "gtk/keys.h" into "gtk/print_dlg.c". svn path=/trunk/; revision=736
* Adds progress bar functionality back for loading files (it was changed toAshok Narayanan1999-09-231-1/+2
| | | | | | | | bounce bar for compressed file support). Note that the progress bar may not grow smoothly for compressed files, but it should be reasonably accurate for files which are large enough to matter. svn path=/trunk/; revision=701
* This commit contains support for reading capture files compressed usingAshok Narayanan1999-09-221-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | gzip. The zLib library is used for this purpose. If zLib is not available (or it's use is disabled by the --disable-zlib option to configure), you can still compile Ethereal but it will be unable to read compressed capture files. IMPORTANT: Now all file accesses to capture files should be done through special macros. Specifically, for any use of the following functions on capture files, replace them. The arguments for the right-side functions are exactly the same as for the original stdio functions. fopen file_open fdopen filed_open fread file_read fwrite file_write fseek file_seek fclose file_close ferror file_error svn path=/trunk/; revision=695
* Add a "Expand all levels"/"Print as displayed" pair of radio buttons toGuy Harris1999-09-121-1/+3
| | | | | | | | | | the "File/Print" dialog box; "Expand all levels" means that all levels of the protocol tree should be printed, while "Print as displayed" means that only those levels shown in the display should be printed. Free the table of column widths once printing is done. svn path=/trunk/; revision=671
* Add summary-vs-detail radio buttons to the print dialog box; detailGuy Harris1999-09-121-2/+10
| | | | | | | | | | | | | | | | | | | | | prints the protocol tree, and summary prints the fields in the summary clist, with a header line at the beginning of the printout. Print only packets selected by the current packet filter. Just have "ARP" and "RARP" in the "Protocol" field for ARP packets; whether it's a request or a reply can be seen in the "Info" field. Add to the "Frame" section of the protocol tree the time between the current packet and the previous displayed packet, and the packet number. Have FT_RELATIVE_TIME fields be a "struct timeval", and display them as seconds and fractional seconds (we didn't have any fields of that type, and that type of time fits the delta time above). Add an FT_DOUBLE field type (although we don't yet have anything using it). svn path=/trunk/; revision=666
* Don't do file-read progress bar updates with a timeout; instead, updateGuy Harris1999-08-281-1/+4
| | | | | | | | | | | | | the progress bar up to 100 times, as we get another percent closer to completion. That reduces the number of times we run the GTK+ main loop; that main loop may do a "select()" or "poll()" or FIONREAD "ioctl" to check for input from the X server, adding to the CPU overhead of reading a file. The packet filtering progress bar is already updated in a similar fashion; make it also do up to 100 updates. svn path=/trunk/; revision=597
* Added John McDermott's colorization routines. There's still someGilbert Ramirez1999-08-241-1/+9
| | | | | | debug printf's in there. svn path=/trunk/; revision=562
* Remove the include of <sys/time.h> from "file.h" - it's neitherGuy Harris1999-08-221-6/+1
| | | | | | | | | | | | | | necessary nor sufficient if you're using "struct tm" (on many, perhaps most, perhaps even all modern UNIXes, <sys/time.h> includes <time.h>, which declares "struct tm", but that's not necessarily the case on non-UNIX systems). Include <time.h> in "file.c", to declare "struct tm". Don't use PCAP_ERRBUF_SIZE to declare a message string buffer - that won't work if you don't have "libpcap". svn path=/trunk/; revision=549
* DLT_NULL, from "libpcap", means different things on different platformsGuy Harris1999-08-221-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and in different capture files; throw in some heuristics to try to figure out whether the 4-byte header is: 1) PPP-over-HDLC (some version of ISDN4BSD?); 2) big-endian AF_ value (BSD on big-endian platforms); 3) little-endian AF_ value (BSD on little-endian platforms); 4) two octets of 0 followed by an Ethernet type (Linux, at least on little-endian platforms, as mutated by "libpcap"). Make a separate Wiretap encapsulation type, WTAP_ENCAP_NULL, corresponding to DLT_NULL. Have the PPP code dissect the frame if it's PPP-over-HDLC, and have "ethertype()" dissect the Ethernet type and the rest of the packet if it's a Linux-style header; dissect it ourselves only if it's an AF_ value. Have Wiretap impose a maximum packet size of 65535 bytes, so that it fails more gracefully when handed a corrupt "libpcap" capture file (other capture file formats with more than a 16-bit capture length field, if any, will have that check added later), and put that size in "wtap.h" and have Ethereal use it as its notion of a maximum packet size. Have Ethereal put up a "this file appears to be damaged or corrupt" message box if Wiretap returns a WTAP_ERR_BAD_RECORD error when opening or reading a capture file. Include loopback interfaces in the list of interfaces offered by the "Capture" dialog box, but put them at the end of the list so that it doesn't default to a loopback interface unless there are no other interfaces. Also, don't require that an interface in the list have an IP address associated with it, and only put one entry in the list for a given interface (SIOCGIFCONF returns one entry per interface *address*, not per *interface* - and even if you were to use only IP addresses, an interface could conceivably have more than one IP address). Exclusively use Wiretap encapsulation types internally, even when capturing; don't use DLT_ types. svn path=/trunk/; revision=540