aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
Commit message (Collapse)AuthorAgeFilesLines
* Apply Greg Morris' buffer overflow prevention patch to the find enhancements.Richard Sharpe2003-08-141-4/+20
| | | | svn path=/trunk/; revision=8165
* Applied the "Updated find capabilities...." from Greg Morris.Richard Sharpe2003-08-111-1/+289
| | | | svn path=/trunk/; revision=8158
* From Greg Morris: add support for case-insensitive full-text searches.Guy Harris2003-08-051-3/+14
| | | | svn path=/trunk/; revision=8132
* From Greg Morris: code to support searches for text or raw binary dataGuy Harris2003-07-221-1/+241
| | | | | | in a frame in Find Frame. svn path=/trunk/; revision=8067
* From Tomas Kukosa: doubling the size of the line buffer when printingGuy Harris2003-06-241-3/+3
| | | | | | | | isn't sufficient if the line to be printed is more than twice the current size of the line buffer. Make it twice the size of the line to be printed, instead. svn path=/trunk/; revision=7921
* The frame number passed to "goto_frame()" wasn't necessarily explicitlyGuy Harris2003-03-021-4/+4
| | | | | | | | | | | | | specified by the user, so if the frame with that frame number isn't being displayed, just refer to it as "That frame", not "The frame with that frame number". (That's even OK if they *did* specify it.) (If there's no such frame, that "shouldn't happen" in cases where it was implicitly specified, e.g. by getting it from a list of fragments, or a "{request,reply} is in frame XXX" field, or clicking on a point in a TCP graph.) svn path=/trunk/; revision=7258
* Have "goto_frame()" put up error dialog boxes itself, rather than havingGuy Harris2003-03-021-7/+16
| | | | | | | its callers put up the same error dialog boxes. Have it just return a success vs. failure Boolean. svn path=/trunk/; revision=7254
* The previous change caused the delta time to be the delta between aGuy Harris2002-12-011-4/+7
| | | | | | | | frame and the previous frame in the capture - a frame that might not be displayed, so you don't know what it was - rather than the previous frame in the display, as is intended. Fix that. svn path=/trunk/; revision=6708
* calculate delta and rel time earlier and unconditionally of whether the ↵Ronnie Sahlberg2002-11-291-30/+30
| | | | | | | | packet passed the displayfilter or not. there may be tap listeners that want to examine this field. svn path=/trunk/; revision=6702
* From Tomas Kukosa: adjust the pointer into the line buffer if the lineGuy Harris2002-11-231-1/+6
| | | | | | buffer gets reallocated. svn path=/trunk/; revision=6665
* From Ronnie Sahlberg: don't have the tap code do a dissection, leaveGuy Harris2002-10-171-4/+7
| | | | | | | that up to its callers, so only one dissection need be done when reading a capture file. svn path=/trunk/; revision=6442
* Another problem found by valgrind :Olivier Abad2002-10-141-1/+3
| | | | | | | | | | in continue_tail_cap_file, the following test : else if (*err != 0) sometimes reads uninitialized memory (so the test might be incorrect). We now set *err to 0 at the beginning of the function. svn path=/trunk/; revision=6418
* Change to color filters :Olivier Abad2002-09-231-20/+4
| | | | | | | | | | - moved color_filter_t in color.h - change color_filter_t to use color_t instead of GdkColor This changed allowed to remove the last gtk includes in file.c. It is now completely free of any gtk related code. svn path=/trunk/; revision=6324
* Removed all gtk calls in file.c :Olivier Abad2002-09-211-101/+47
| | | | | | | | | | | | - created a few packet_list_xxx functions (ui_util.h gtk/packet_list.c gtk2/packet_list.c) ; - removed almost all "gtk/xxx" and "gtk2/xxx" includes in file.c The only remaining includes are related to color filters. We have to make color_filter_t GUI independent by replacing GdkColor with color_t. I'll work on this later. svn path=/trunk/; revision=6311
* Enable the tap feature for ethereal as well. (will only update in real time ↵Ronnie Sahlberg2002-09-041-2/+6
| | | | | | for the gtk2 port though) svn path=/trunk/; revision=6182
* GTK+ v2 port.Olivier Abad2002-08-311-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | All the deprecated widgets have not been replaced yet : GtkList and GtkCList ==> GtkTreeView conversion : - color_dlg.c - column_prefs.c - decode_as_dlg.c : done - dfilter_expr_dialog - filter_prefs.c - main.c - plugins_dlg.c : done GtkCTree ==> GtkTreeView conversion : done GtkText ==> GtkTextView conversion : done Remaining problems : - gtk_font_selection_dialog_set_filter doesn't exist anymore (but hasn't been removed from the documentation). I don't know how to filter the font selection dialog to get only fixed width fonts ; - we have to remove GUI prefs which are not usefule anymore : tree line style and tree expander style. svn path=/trunk/; revision=6153
* Removed trailing whitespaces from .h and .c files using theJörg Mayer2002-08-281-17/+17
| | | | | | | winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
* From Ulf Lamping: extend the progress dialog box to give more progressGuy Harris2002-08-281-28/+60
| | | | | | | | | | | 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"). svn path=/trunk/; revision=6112
* Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer2002-08-021-11/+3
| | | | | | | | equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. svn path=/trunk/; revision=5932
* From Graeme Hewson:Guy Harris2002-07-301-76/+112
| | | | | | | | | | 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. svn path=/trunk/; revision=5916
* Fix the problems WRT overwriting a capture file. From Joerg Mayer.Richard Sharpe2002-07-211-2/+10
| | | | svn path=/trunk/; revision=5898
* From Graeme Hewson:Guy Harris2002-07-161-7/+16
| | | | | | | | | | | | | | | | Allow "-" as the output file name in Wiretap, referring to the standard error. Optimize the capture loop. Fix some of the error-message printing code in Ethereal and Tethereal. Have Wiretap check whether it can seek on a file descriptor, and pass the results of that test to the file-type-specific "open for output" routine. Have the "open for output" routines for files where we need to seek when writing the file return an error if seeks don't work. svn path=/trunk/; revision=5884
* This seems to fix the problem of trying to save over the top of an existingRichard Sharpe2002-07-151-9/+12
| | | | | | capture on some occassions. svn path=/trunk/; revision=5872
* Have "print_line()" take an indentation argument, and do blankGuy Harris2002-06-291-4/+4
| | | | | | | | | | | | padding when printing text and use "putline" when printing PostScript. Eliminate "hexdump", as it's just a special case of "putline". Have "proto_tree_print_node()" just call "print_line()". Get rid of "print_ps_hex()" - the font used for the hex dump and the protocol tree are the same, so there's no need to switch fonts. svn path=/trunk/; revision=5798
* Get rid of trailing newline in lines passed to "print_line()".Guy Harris2002-06-221-9/+5
| | | | svn path=/trunk/; revision=5732
* Get rid of separate "print_hex_data_text()" and "print_hex_data_ps()"Guy Harris2002-06-221-2/+2
| | | | | | | | | | | | routines; instead, rename "print_hex_data_common()" to "print_hex_data_buffer()" as it prints a buffer in hex and ASCII (or EBCDIC), and have it take the print format as an argument. Have it use "print_line()" to print lines, and fix "print_line()" so that it prints a buffer *without* a newline at the end, printing the newline itself. svn path=/trunk/; revision=5729
* Add a new error for attempts to open a pipe or FIFO for random access.Guy Harris2002-06-071-1/+6
| | | | | | | Have "wtap_open_offline()", if asked to open a FIFO, return that error if it was asked to open the file for random access. svn path=/trunk/; revision=5643
* Get rid of the "data_src" member of the "frame_data" structure; put itGuy Harris2002-06-041-9/+4
| | | | | | | | in the "packet_info" structure instead, as we don't need a pointer for every single frame in the capture file, just for each frame for which we currently have an open "epan_dissect_t". svn path=/trunk/; revision=5614
* Clean up the file saving code a bit.Guy Harris2002-05-231-59/+51
| | | | svn path=/trunk/; revision=5531
* Make "save_cap_file()" return a Boolean (TRUE on success, FALSE onGuy Harris2002-05-231-11/+23
| | | | | | | failure) - and don't use "err" to determine success or failure, as it's not set in some failure cases. svn path=/trunk/; revision=5528
* The "fname" argument to "save_cap_file()", and "cf->filename" - and thusGuy Harris2002-05-231-13/+12
| | | | | | | | | | | | | "from_filename" - are both null-terminated strings; compare them with "strcmp", not "strncmp()". ("cf->filename" is a "char *", so "sizeof(cf->filename)" is not the right third argument to "strncmp()" in any case, as it's the size of a pointer, which is probably either 4 or 8 bytes.) Make the dialog box for "Can't save over current capture file" an ESD_TYPE_CRIT dialog box, as it's a fatal error. svn path=/trunk/; revision=5526
* From Didieer Gautheron:Guy Harris2002-05-031-7/+19
| | | | | | | | | Don't show progress bar for quick "Find Frame" searches Add "Find Next" and "Find Previous" to repeat searches Add documentation for "Find Next" and "Find Previous". svn path=/trunk/; revision=5378
* Clean up the handling of filter strings:Guy Harris2002-05-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | have "filter_packets()" make a copy of the filter string handed to it, as it may save the filter string in the "capture_file" structure, and the caller of "filter_packets()" shouldn't have to worry about the string it passed to "filter_packets()" being stashed away somewhere so that it can't just free that string or change it; have callers of "filter_packets()" free up the string they handed to it, if the string was allocated and they're done with it; plug some memory leaks in "match_selected_cb_do()". Check for an illegal "action" argument being passed to "match_selected_cb_do()". Move some keys out of "keys.h" into "gtk/main.c", as they're only used in "gtk/main.c". Make the pointer to the filter list a data item for the combo box, as it's a copy of the list of strings for the combo box, rather than attaching it to the widgets that activate the filter (a pointer to the combo box *itself* is a data item for those widgets). In "filter_activate_cb()", make a copy of the text from the text entry field as soon as we fetch it, and use that copy. Free that copy if we didn't add the filter to the filter list. Don't make a copy of the entire filter list and use that to set the combo box's list of items - just use the list itself. Also, when the list is changed, make the new value the data for the combo box (the list pointer will actually not be changed, because we happen to be using "g_list_append()", but let's not rely on that). svn path=/trunk/; revision=5368
* If the progress fraction when reading in a file becomes > 1, assume thatGuy Harris2002-04-241-11/+28
| | | | | | | | the file grew while we were reading it, and re-fetch the size and try again; if it's still > 1, give up and clamp it at 1 so that the GTK+ progress bar code doesn't complain. svn path=/trunk/; revision=5232
* Make sure that when we save a file, we don't overwrite our capture fileRichard Sharpe2002-04-221-2/+12
| | | | | | with an empty file. svn path=/trunk/; revision=5225
* Don't prime the display filter unless we're re-applying it; otherwise,Guy Harris2002-04-201-2/+2
| | | | | | | we aren't building a protocol tree, and we can't prime the filter against the tree. svn path=/trunk/; revision=5206
* From Joerg Mayer: get rid of unused arguments, and mark those that can'tGuy Harris2002-03-311-2/+2
| | | | | | | | be eliminated (because the function is called through a pointer, and other functions called through the same pointer *do* use the argument) as unused. svn path=/trunk/; revision=5050
* Make "wtap_seek_read()" return TRUE on success and FALSE on error, likeGuy Harris2002-03-051-3/+3
| | | | | | | | "wtap_read()". Add some additional error checks to the Sniffer file reader. svn path=/trunk/; revision=4875
* Have "wtap_seek_read()" return 0 on success and -1 on failure, and takeGuy Harris2002-03-051-7/+20
| | | | | | | | | | | | | | | | | | | | | 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). svn path=/trunk/; revision=4874
* From Joerg Mayer: remove unused variables and declarations ofGuy Harris2002-02-271-2/+2
| | | | | | | | | | non-existent functions. Remove the "filetype" argument from the "can_write_encap" functions for particular capture file types - the argument value is implicit, in that the routine being called is the routine for that particular file type. svn path=/trunk/; revision=4823
* Get rid of "init_all_protocols()"; instead, have a routineGuy Harris2002-02-241-25/+6
| | | | | | | | | | "init_dissection()" which calls "epan_conversation_init()", does the work that "init_all_protocols()" did, and then calls "reassemble_init()", so that the standard sequence of dissection initialization is done in one place, rather than having multiple places call the same sequence of routines. svn path=/trunk/; revision=4797
* Update a comment.Guy Harris2002-02-191-3/+3
| | | | svn path=/trunk/; revision=4757
* Don't give tvbuffs names; instead, give data sources names, where aGuy Harris2002-02-181-12/+5
| | | | | | | | | | | | | | | "data source" has a name and a top-level tvbuff, and frames can have a list of data sources associated with them. Use the tvbuff pointer to determine which data source is the data source for a given field; this means we don't have to worry about multiple data sources with the same name - the only thing the name does is label the notebook tab for the display of the data source, and label the hex dump of the data source in print/Tethereal output. Clean up a bunch of things discovered in the process of doing the above. svn path=/trunk/; revision=4749
* Have Wiretap set the snapshot length to 0 if it can't be derived fromGuy Harris2002-02-081-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reading the capture file. Have callers of "wtap_snapshot_length()" treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so that, when writing a capture file in a format that *does* store the snapshot length, we can at least put *something* in the file). If we don't know the snapshot length of the current capture file, don't display a value in the summary window. Don't use "cfile.snap" as the snapshot length option when capturing - doing so causes Ethereal to default, when capturing, to the snapshot length of the last capture file that you read in, rather than to the snapshot length of the last capture you did (or the initial default of "no snapshot length"). Redo the "Capture Options" dialog box to group options into sections with frames around them, and add units to the snapshot length, maximum file size, and capture duration options, as per a suggestion by Ulf Lamping. Also add units to the capture count option. Make the snapshot length, capture count, maximum file size, and capture duration options into a combination of a check box and a spin button. If the check box is not checked, the limit in question is inactive (snapshot length of 65535, no max packet count, no max file size, no max capture duration); if it's checked, the spinbox specifies the limit. Default all of the check boxes to "not checked" and all of the spin boxes to small values. Use "gtk_toggle_button_get_active()" rather than directly fetching the state of a check box. svn path=/trunk/; revision=4709
* Include files from the "epan" directory and subdirectories thereof withGuy Harris2002-01-211-7/+7
| | | | | | | | | | | | | "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/"). svn path=/trunk/; revision=4586
* Separate the promiscuous mode, "Update list of packets in real time",Guy Harris2002-01-101-3/+7
| | | | | | | | | | | | | and "Automatic scrolling in live capture" options from the preference settings for them, so that the preference settings affect the initial values of those options, but changing those values in a capture don't affect the preferences, and don't automatically get saved when you save the preferences. If we're building without libpcap, don't have an "Automatic scrolling in live capture" option anywhere. svn path=/trunk/; revision=4514
* Long NCP traces can easily have many packets whose "uniqueness"Gilbert Ramirez2002-01-051-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | variables wrap-around. Since the request/reply packets are related via a hash based on these uniqueness variables, long NCP traces can have mis-matches reqeust/reply records. Thus, only do the hash-lookup for the reply packet during the first sequential scan of the trace file. Once the pertinent info is found, store it in the packet's private data area. Since the memory allocated for the hash and for the structures that make up the keys are no longer needed after the first sequential run through the trace file, arrange to free that memory after the first sequential run. Similar to the register_init_routine() that allows dissectors to register callbacks for calling *before* a capture file is loaded, set up a register_postseq_cleanup_routine() function that allows dissectors to register callbacks for calling *after* the first sequential run-through of the trace file is made. This is not a *final* cleanup callback, since Ethereal will still have that trace file open for random-access reading. I didn't have tethereal call postseq_cleanup_all_protocols() since tethereal doesn't keep the trace file open for random-access reading. I could easily be swayed to make tethereal call that function, however. svn path=/trunk/; revision=4484
* In "change_time_formats()" we can now check at the beginning whetherGuy Harris2002-01-031-17/+21
| | | | | | | | | | | there are any columns whose time formats will change, and just return if there aren't. We also, however, need to set the "writable" flag on the columns before doing that check, as "check_col()" checks whether the column in question is writable; in this context, all columns are writable. svn path=/trunk/; revision=4472
* Provide for per-protocol-tree data in the proto_tree code.Gilbert Ramirez2001-12-181-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | 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. svn path=/trunk/; revision=4422
* Add an extra argument to "epan_dissect_new()" that indicates whether theGuy Harris2001-12-161-18/+12
| | | | | | | | 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. svn path=/trunk/; revision=4408