aboutsummaryrefslogtreecommitdiffstats
path: root/file.h
AgeCommit message (Collapse)AuthorFilesLines
2006-01-22show the number of packets captured, if "Update list of packets ..." isn't usedulfl1-1/+10
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17071 f5534014-38df-0310-8fa8-9805f1628bb7
2005-09-20add two new callbacks:ulfl1-0/+2
cf_cb_file_closing (called before closing a capture file) cf_cb_file_closed will be called afterwards, but both only if a file is really closed as cf_close is called more often ... If we are closing large capture files (~20MB), the screen looks ugly while the file is closed. Change this so the screen will immediately go back to initial state and a dialog (without buttons) is shown that the file is currently closed. As the operation which takes most of the time to close the file is a single eth_clist_clear call, we can't use a progress bar here. cf_cb_live_capture_stopping: called when the user wants to stop the capture (toolbar or menu clicked). At least on Win32, the time between this and the actual stop completed can be noticeable (1-2 seconds), so the user doesn't know if the button press did anything at all. Do something similar as above, show a dialog box without buttons to inform that the close is in progress. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15891 f5534014-38df-0310-8fa8-9805f1628bb7
2005-09-14added compression support for capture file output. The Save/As dialog now ↵ulfl1-1/+2
has a checkbox "Compress with gzip" currently limited to Ethereal and all the variants of libpcap filetypes only. We might want to add output compression support to the other tools as well (tethereal, mergecap, ...). We might also want to add support for the other filetypes, but this is only possible if the filetype functions doesn't use special output operations like fseek. One bug is still left: if the input and output filetypes while saving are the same, Ethereal currently optimizes this by simply copy the binary file instead of using wiretap (so it will be faster but it will ignore the compress setting). Don't know a good workaround for this, as I don't know a way to find out if the input file is currently compressed or not. One idea might be to use a heuristic on the filesize (compared to the packet size summmary). Another workaround I see is to remove this optimization, which is of course not the way I like to do it ... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15804 f5534014-38df-0310-8fa8-9805f1628bb7
2005-09-14Have cf_retap_packets() take an argument that indicates whether toguy1-1/+2
generate columns; use cf_retap_packets instead of cf_redissect_packets() when running taps (the general flow graph stat uses the Info column). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15793 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-25the capture child might not respond shortly after bringing it up (especially ↵ulfl1-0/+1
it will block, if no input coming from an input capture pipe (e.g. mkfifo) is coming in) to prevent problems, bring the main GUI into "capture mode" right after successfully spawn/exec the capture child, without waiting for any response from it git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14436 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-18statusbar changes:ulfl1-1/+2
-show the current capture file size, if capturing in real time mode. -move the packet "Drops" count (if available) from file to packets statusbar part git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14130 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-11various capture code cleanup and fixes: ulfl1-1/+0
display filename in statusbar while capturing print_usage banner fixed cf_cb_live_capture_prepare no longer needed rename sync_pipe_do_capture -> sync_pipe_start bugfix: sync_pipe_input_wait_for_start replaced by former implementation fix cleanup of old file in capture_input_new_file fix a tempfile detection bug (named file showed up as tempfile after capture) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14053 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10fix statusbar messages by splitting into update and fixed messages between ↵ulfl1-2/+4
capture and main git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14044 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28a lot more capture engine code cleanupulfl1-0/+5
most notably: - moved opening of safe_file to the capture child (capture_loop.c) - removed save_file_fd from capture_opts (no longer need to have it global) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13953 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-11from Stefano Pettini: add CSV export function, similar to PSML exportulfl1-0/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13724 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-28Another step towards using the parent/child mode for ALL captures.ulfl1-0/+16
This is currently still disabled, as we cannot pass all required capture flags to the child process (lack of command line parameters). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13558 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-17Have "cf_merge_files()" take a pointer-to-pointer-to-char as the outputguy1-4/+4
file name argument; if the pointed-to pointer is null, it opens a temporary file, and sets that pointer to a mallocated copy of the pathname of the temporary file. It no longer needs a file descriptor as an argument. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13419 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-08fix a capture bug if the capture filter wasn't valid to get back to "empty" ↵ulfl1-0/+1
state. instead of already invoking cf_cb_live_capture_started in capture.c, I've introduced the new event cf_cb_live_capture_prepare which only has to set the main windows title and nothing more. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13355 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-07Make Ethereal and Tethereal compile if we're building without libpcap.guy1-0/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13346 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-07Move the code to set the title on a window when a capture is in progressguy1-0/+3
to the "start live capture" callback, and call that from "do_capture()". When opening a capture file, don't pop up the "What do you want to do?" pane when closing any existing file you have open, as we're just going to put the regular view up right after that. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13332 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-07Declare "cf_callback_t" before using it in a further declaration.guy1-1/+1
Mark the "func" argument to "cf_callback_remove()" as unused. Get rid of the "iface" argument to "cf_start_tail()", as it's no longer used. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13331 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-07Instead of calling each single thing when doing/finish a file operation, ↵ulfl1-0/+23
file.c shouldn't call all the GUI related functions itself, instead throwing some kind of Events to it's caller(s). I've implemented a very simple callback mechanism which provides exactly this. I've tried GHook from GLib before, but this doesn't seem to be the right thing, as it's too inflexible for the purpose here. So I've implemented a callback function in main.c which receives all "events" and spreads them to menu, statusbar and itself. I would see this implementation as a prototype which may need improvements. Please comment the changes. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13330 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-06another two steps towards privilege seperation:ulfl1-17/+1
move another two capture related fields (iface and cfilter) from cfile to capture_opts also move the handling of capture related command line options from main.c to capture.c, that way a future privilege seperated capture program can use the same code to parse it's command line than Ethereal. It might be even possible to share this parser code even with Tethereal, didn't took a closer look at this. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13320 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-05fix a commentulfl1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13306 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-05minor enhancements to Guy's last updateulfl1-4/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13304 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-05Put "cf_status_t" back.guy1-13/+18
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13303 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-05make some string parameters const, as they are not changed insideulfl1-4/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13298 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-04Instead of having a single enumerated type for status return values fromguy1-28/+33
cf_ functions, have separate ones for different classes of routines, and use gboolean when the return value is just "success" or "failure" - that way you don't get compiler warnings if a case statement isn't handling a particular status value if the routine in question won't return it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13293 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-04huge cleanup of capture file API (functions in file.c/file.h).ulfl1-61/+337
This includes: all functions in file.h now have a cf_ prefix, will have doxygen tags, will have the capture_file *cf as the first parameter and I tried to generalize the return values for non trivial functions. Hopefully, I didn't introduced any new bugs, as I had to change a lot of files... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13289 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-04remove #include "globals.h" and access to global cfile, use access functions ↵ulfl1-0/+1
and capture_opts instead git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13284 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-04remove #include "globals.h" and access to global cfile, use access functions ↵ulfl1-0/+2
and capture_opts instead git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13283 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-04(some) redesign of capture data structures.ulfl1-0/+4
don't use global cfile at all but only an untpyed handle to call the cf_... functions in file.c move the save_file member from capture_file to capture_opts, as it's only used while capturing and while preparing it git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13276 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-31"gtk_entry_get_text()" returns a "const char *" - assign the result toguy1-1/+1
one. "get_basename()" doesn't modify its argument, and its callers don't modify the substring pointed to by the result, so make it take a "const char *" as an argument and return a "const char *". "find_last_pathname_separator()" doesn't modify its argument, so make it a "const char *" - but some of its callers pass a non-"const" "char *" and modify the result, so don't make its return value a "const char *". And, as none of its callers are outside "filesystem.c", make it static. In "about_folders_page_new()", have separate variables for pathnames returned as "const char *" (which are cached by the routine that returns them, so you can't modify them - and can't free them, so get rid of the commented-out "g_free()" calls for them) and pathnames returned as "char *" (which are allocated anew for each call, and can be modified, but have to be freed). Clean up white space. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12881 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-27Get rid of merge_n_files() - it's only called in one place now, andguy1-2/+2
absorbing its logic into "cf_merge_files()" simplifies things a bit. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12421 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-27Change some of the merge.c APIs to return more information on failure,guy1-0/+4
and use that information to provide better error messages. Have "merge_open_outfile()" do all the work of filling in the merge_out_file_t structure, with the values to use passed as arguments. Get rid of some structure members that used to be used solely to pass information to "merge_open_outfile()". Add a "cf_merge_files()" routine to do the merging and reporting of errors. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12420 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-01Trivial warning fixjmayer1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12170 f5534014-38df-0310-8fa8-9805f1628bb7
2004-09-04The packet range stuff knows about capture_file structures, so it'sguy1-1/+1
really more of an Ethereal/Tethereal component than a libethereal component (nothing else in libethereal knows about capture files); move it back out of libethereal. (The range stuff doesn't; we leave it in libethereal.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11898 f5534014-38df-0310-8fa8-9805f1628bb7
2004-09-04Rename "range.c" and "range.h" to "packet-range.c" and "packet-range.h";guy1-1/+1
they should ultimately be split into files with routines that handle ranges, which are just subsets of [0,2^32), and packet ranges, which are subsets of the packet list, possibly specified by a range. Move them into epan, so they can be used by, for example, utilities that handle ranges, such editcap. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11890 f5534014-38df-0310-8fa8-9805f1628bb7
2004-09-02Move the guts of gtk/file_dlg.c:goto_framenum_cb() togerald1-0/+1
file.c:goto_framenum(), where all of the other goto_ routines live. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11887 f5534014-38df-0310-8fa8-9805f1628bb7
2004-08-25Move the file-reloading code from gtk/file_dlg.c to file.c.gerald1-0/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11823 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-07-08Make the "human-readable text vs. PSML vs. PDML" choice separate fromguy1-1/+4
the "text vs. PostScript" choice. The "text vs. PostScript" choice should probably ultimately be done with a generic set of print methods, to handle various platform-native print mechanisms more cleanly (and perhaps the dialog box code for "export as {PDML,PSML}" should be separate from the "export as text"/"print" dialog). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11342 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-08Don't refer to "auto_scroll_live" if HAVE_LIBPCAP isn't defined - andguy1-3/+1
put the definition of it back under HAVE_LIBPCAP and don't add an extra declaration in "file.h", as there's no longer code that needs to refer to it if HAVE_LIBPCAP isn't defined. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10350 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-08This makes ethereal compile again when configured --without-pcapjmayer1-1/+3
I don't know whether this is the optimal patch, but it does the job. file.h: extern declaration of auto_scroll_live file.c: always declare auto_scroll_live git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10347 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-23Add a "force" argument to "filter_packets()" andguy1-2/+2
"main_filter_packets()", to force the filtering to be done even if the filter is the same as the current one; this is necessary in order to make sure "Follow TCP Stream" gets the packets processed even if you're filtering the stream that's currently filtered in. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10209 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-25Have the Wiretap open, read, and seek-and-read routines return, inguy1-3/+3
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-25There's no need to keep a "FILE *" for the file being printed to in aguy1-2/+7
"capture_file" structure. Keep it locally, instead. Check for errors when printing packets. Report failure to open a print destination and failure to write to a print destination differently. Don't have the "print preamble" and "print final" routines return success/failure indications - revert to the old scheme where they didn't, and have the callers use "ferror()" to check for errors. Report write errors when printing dissections in Tethereal. Report print errors as errors, not warnings. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9828 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-24As with "cf_open_error_message()"/"file_open_error_message()", so withguy1-2/+1
"cf_write_error_message()"/"file_write_error_message()". Use "file_open_error_message()" instead of "cf_open_error_message()" in some places we missed in the previous checkin. Catch ENOSPC and EDQUOT in "file_open_error_message()". Use "file_open_error_message()" rather than "file_write_error_message()" to report errors when creating the file to which we're saving the "Follow TCP Stream" data. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9823 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-24Add a new "file_open_error_message()" routine in "epan/filesystem.c", toguy1-2/+1
translate UNIX errno values to a somewhat friendly message format string. Rename "file_open_error_message()" in "file.c" to "cf_open_error_message()", make "cf_open_error_message()" use the new "file_open_error_message()" for UNIX errno values, have "do_capture()" in "capture.c" use "file_open_error_message()" to report errors from "open()", and make "cf_open_error_message()" static as nothing outside "file.c" uses it. Do similar stuff in "tethereal.c". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9821 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-20a.) saving GTK1 and GTK2 fontnames in different preference setting, to ↵ulfl1-1/+4
prevent problems when switching between GTK1 and GTK2 ethereal versions b.) added new feature "Edit->Go To First Packet" "Edit->Go To Last Packet" with corresponding menu and toolbar items c.) added new feature "View->Zoom In" / "View->Zoom Out" / View->Normal Size" with corresponding menu and toolbar items This feature will act as a "size offset" to the current fontsize, so that the packet list/tree view/... will have a larger/smaller font size. The value is stored inside the recent file. d.) Win32 only: Try to get the win32 system font and fontsize at program startup and show the menus/dialogs and such with the same font and fontsize like other win32 windows. This makes the program make a *lot* more feel like a normal win32 program. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9753 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-13Add a routine "retap_packet()" that runs through all packets, dissectingguy1-1/+2
them and running all taps on them, but not reconstructing the packet list. Use that in the IO-stat tap rather than "redissect_packet()"; the latter does more work and redraws the display, neither of which are necessary. Call the filter callback when the Calc field is changed, to redraw the graphs; that change also fixes things so that it's called when the Filter field is changed. Rename the "filter_button" member of an io_stat_graph_t to "filter_field", as it's not the "Filter:" button, it's the text field containing the filter expression. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9659 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-29From Dick Gooris (and me :-)ulfl1-2/+3
more ways to choose which packets can be saved, in the save(as) dialog box git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9476 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-24Make "finfo_selected" a member of a "capture_file" structure rather thanguy1-2/+2
an independent global variable. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8524 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-15Rename various capture file routines to have names starting with "cf_".guy1-10/+10
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8479 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-15Add a routine to return the display name for a "capture_file" structure,guy1-1/+2
rather than constructing that name when a capture file is opened and putting a pointer to it in that structure. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8476 f5534014-38df-0310-8fa8-9805f1628bb7