aboutsummaryrefslogtreecommitdiffstats
path: root/file.h
AgeCommit message (Collapse)AuthorFilesLines
2004-09-04The packet range stuff knows about capture_file structures, so it'sGuy Harris1-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.) svn path=/trunk/; revision=11898
2004-09-04Rename "range.c" and "range.h" to "packet-range.c" and "packet-range.h";Guy Harris1-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. svn path=/trunk/; revision=11890
2004-09-02Move the guts of gtk/file_dlg.c:goto_framenum_cb() toGerald Combs1-0/+1
file.c:goto_framenum(), where all of the other goto_ routines live. svn path=/trunk/; revision=11887
2004-08-25Move the file-reloading code from gtk/file_dlg.c to file.c.Gerald Combs1-0/+1
svn path=/trunk/; revision=11823
2004-07-18Set the svn:eol-style property on all text files to "native", so thatGuy Harris1-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. svn path=/trunk/; revision=11400
2004-07-08Make the "human-readable text vs. PSML vs. PDML" choice separate fromGuy Harris1-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). svn path=/trunk/; revision=11342
2004-03-08Don't refer to "auto_scroll_live" if HAVE_LIBPCAP isn't defined - andGuy Harris1-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. svn path=/trunk/; revision=10350
2004-03-08This makes ethereal compile again when configured --without-pcapJörg Mayer1-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 svn path=/trunk/; revision=10347
2004-02-23Add a "force" argument to "filter_packets()" andGuy Harris1-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. svn path=/trunk/; revision=10209
2004-01-25Have the Wiretap open, read, and seek-and-read routines return, inGuy Harris1-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". svn path=/trunk/; revision=9852
2004-01-25There's no need to keep a "FILE *" for the file being printed to in aGuy Harris1-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. svn path=/trunk/; revision=9828
2004-01-24As with "cf_open_error_message()"/"file_open_error_message()", so withGuy Harris1-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. svn path=/trunk/; revision=9823
2004-01-24Add a new "file_open_error_message()" routine in "epan/filesystem.c", toGuy Harris1-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". svn path=/trunk/; revision=9821
2004-01-20a.) saving GTK1 and GTK2 fontnames in different preference setting, to ↵Ulf Lamping1-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. svn path=/trunk/; revision=9753
2004-01-13Add a routine "retap_packet()" that runs through all packets, dissectingGuy Harris1-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. svn path=/trunk/; revision=9659
2003-12-29From Dick Gooris (and me :-)Ulf Lamping1-2/+3
more ways to choose which packets can be saved, in the save(as) dialog box svn path=/trunk/; revision=9476
2003-09-24Make "finfo_selected" a member of a "capture_file" structure rather thanGuy Harris1-2/+2
an independent global variable. svn path=/trunk/; revision=8524
2003-09-15Rename various capture file routines to have names starting with "cf_".Guy Harris1-10/+10
svn path=/trunk/; revision=8479
2003-09-15Add a routine to return the display name for a "capture_file" structure,Guy Harris1-1/+2
rather than constructing that name when a capture file is opened and putting a pointer to it in that structure. svn path=/trunk/; revision=8476
2003-09-12Added TimeReference frames.Ronnie Sahlberg1-1/+2
One can now select a packet and mark it as a TimeReference packet using the menu. A TimeReference packet will be indicated by having all timestamp related column entries replaced by the string *REF* A TimeReference packet will always be displayed in the packet pane, and overrides any display filters. When a frame is a TimeReference frame, all later frames will calculate the TimeRelativeToFirstPacket relative to the timestamp of the TimeReference frame instead of the first frame of the capture. You can have any number of TimeReference frames you like. svn path=/trunk/; revision=8459
2003-08-29Get rid of the EBCDIC stuff in the find dialog - it's not supported yet,Guy Harris1-2/+8
so we shouldn't torment the users by offering it. Check the string type and convert it to an internal representation in the GUI code; have the search code deal only with the internal representation. Save the case-sensitivity flag, and the indication of where string searches look, along with other search parameters. Upper-casify the string, for case-insensitive searches, in the GUI code; don't save the upper-casified string, so it doesn't SHOUT at you when you next pop up a "find" dialog. Convert the hex value string to raw binary data in the GUI code, rather than doing so in the search code. Check that it's a valid string. Connect the signals to the radio buttons after the pointers have been attached to various GUI items - the signal handlers expect some of those pointers to be attached, and aren't happy if they're not. Have "find_packet()" contain a framework for searching, but not contain the matching code; instead, pass it a pointer to a matching routine and an opaque pointer to be passed to the matching routine. Have all the routines that do different types of searching have their own matching routines, and use the common "find_packet()" code, rather than duplicating that code. Search for the Info column by column type, not by name (the user can change the name). When matching on the protocol tree, don't format the entire protocol tree into a big buffer - just have a routine that matches the text representation of a protocol tree item against a string, and, if it finds a match, sets a "we found a match flag" and returns; have that routine not bother doing any more work if that flag is set. (Unfortunately, you can't abort "g_node_children_foreach()" in the middle of a traversal.) Free the generated display filter code after a find-by-display-filter finishes. svn path=/trunk/; revision=8306
2003-08-11Applied the "Updated find capabilities...." from Greg Morris.Richard Sharpe1-2/+2
svn path=/trunk/; revision=8158
2003-08-05From Greg Morris: add support for case-insensitive full-text searches.Guy Harris1-2/+2
svn path=/trunk/; revision=8132
2003-07-25Get rid of carriage returns - some compilers don't like them.Guy Harris1-2/+2
svn path=/trunk/; revision=8086
2003-07-22From Greg Morris: code to support searches for text or raw binary dataGuy Harris1-2/+4
in a frame in Find Frame. svn path=/trunk/; revision=8067
2003-03-02Have "goto_frame()" put up error dialog boxes itself, rather than havingGuy Harris1-7/+2
its callers put up the same error dialog boxes. Have it just return a success vs. failure Boolean. svn path=/trunk/; revision=7254
2002-09-06From Vassilii Khachaturov, cleanup of redundant code.Ronnie Sahlberg1-53/+2
svn path=/trunk/; revision=6202
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-6/+6
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-5/+1
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
2002-07-16From Graeme Hewson:Guy Harris1-2/+2
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
2002-05-27Clean up the data structures for the color filter code a bit. The oldGuy Harris1-2/+1
"colfilter" structure contained items of use only when the colorizing dialog was up, so make the items in it private to "gtk/color_dlg.c". Make the "Edit" and "Delete" buttons sensitive only when a row is selected, and make the "Up" and "Down" buttons sensitive only when a row is selected *and* that row has somewhere to move in the specified direction. svn path=/trunk/; revision=5575
2002-05-23Make "save_cap_file()" return a Boolean (TRUE on success, FALSE onGuy Harris1-2/+2
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
2002-02-24Put all the capture options into a structure.Guy Harris1-5/+1
Move the ringbuffer capture options from the "capture_file" structure to the structure for capture options, as they're a property of an in-progress capture, not a property of a particular capture file. svn path=/trunk/; revision=4799
2002-02-24"autostop_filesize" and "autostop_duration" don't need to be in theGuy Harris1-3/+1
"capture_file" structure - they're a property of an in-progress capture, not a property of an open capture file. Make them just variables. The maximum number of packets to be captured should be a variable separate from the "count" field in the "capture_file" structure - the latter is a count of the packets in the capture file in question. Have Boolean variables indicating whether a maximum packet count, maximum capture file size, and maximum capture duration were specified. If an option isn't set, and we're doing an "update list of packets in real time" capture, don't pass the option to the child process with a command-line argument. Don't create "stop when the capture file reaches this size" or "stop when the capture's run for this long" conditions if a maximum capture file size or a maximum capture duration, respectively, haven't been specified. Don't test or free a condition if it wasn't created. Don't allow a 0 argument to the "-c" flag - the absence of a "-c" flag is the way you specify "no limit on the number of packets". Initialize the check boxes and spin buttons for the "maximum packets to capture", "maximum capture size", and "maximum capture duration" options to the values they had in the last capture. If an option wasn't specified, don't read its value from the dialog box and set the variable. svn path=/trunk/; revision=4795
2002-02-08Have Wiretap set the snapshot length to 0 if it can't be derived fromGuy Harris1-2/+3
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
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-3/+3
"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
2001-12-06Remove proto_tree from capture_file and PacketWinData, since theyGilbert Ramirez1-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
2001-12-06Make the "Save only marked frames" button in the "Save As..." dialog boxGuy Harris1-2/+13
sensitive only if there *are* marked frames. svn path=/trunk/; revision=4341
2001-12-04Make the bytes-written information from Wiretap a long, as we allowGuy Harris1-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
2001-12-04Support for stopping capture at specified capture file size or captureGuy Harris1-1/+5
duration, from Thomas Wittwer and Matthias Nyffenegger. svn path=/trunk/; revision=4322
2001-07-05"open_cap_file()" in Ethereal and Tethereal don't use the FILE_T theyGuy Harris1-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
2001-06-05Enable "Match Selected" only if there's a field selected *and* we can doGuy Harris1-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
2001-04-18Check the validity of numbers specified in command-line options.Guy Harris1-3/+3
svn path=/trunk/; revision=3326
2001-02-11In Ethereal, attempt to get the packet statistics from libpcap whenGuy Harris1-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
2001-02-01Create a more modular type system for the FT_* types. Put themGilbert Ramirez1-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
2001-01-28There's no need for a member of a "capture_file" structure holding aGuy Harris1-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
2000-10-20Remove #include "gtk/colors.h" from file.h, which keep the GTK+ headerGilbert Ramirez1-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
2000-10-06Implement epan_dissect_new() and epan_dissect_free(). These are theGilbert Ramirez1-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
2000-08-21Frames in the packet list can now be marked by the user usingLaurent Deniel1-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
2000-08-11Miscellaneous code cleaningLaurent Deniel1-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