aboutsummaryrefslogtreecommitdiffstats
path: root/file.h
AgeCommit message (Collapse)AuthorFilesLines
1999-08-15"read_cap_file()" doesn't need to be passed a file name as an argument -Guy Harris1-2/+2
it's called after "open_cap_file()" has been called, and is always passed the file name passed to "open_cap_file()", and that file name is stored as "cf->filename", so "read_cap_file()" can just use "cf->filename" as the pathname of the file. svn path=/trunk/; revision=494
1999-08-15Split "load_cap_file()" into "open_cap_file()" and "read_cap_file()".Guy Harris1-2/+2
The former, which used to be called by "load_cap_file()", now just opens the file and, if the open succeeds, closes any capture file we previously had open, reinitializes any protocols that need reinitialization, and saves information about the new capture file in the "capture_file" structure to which it was passed a pointer. The latter reads the file already opened by "read_cap_file()". For "File/Open", call "open_cap_file()" before dismissing the file selection box; if it fails, "open_cap_file()" will have popped up a message box complaining about it - just return, leaving the file selection box open so the user can, after dismissing the message box, either try again with a different file name, or dismiss the file selection box. (Other file selection boxes should be made to work the same way.) If "open_cap_file()" succeeds, dismiss the file selection box, and read the capture file in. svn path=/trunk/; revision=492
1999-08-13Moved global memory alloction used in display filters (which was storedGilbert Ramirez1-2/+6
in dfilter-grammar.y) to a new struct dfilter. Display filters now have their own struct, rather than simply being GNode's. This allows multiple display filters to exist at once, aiding John McDermott in his work on colorization. svn path=/trunk/; revision=480
1999-08-11Changed two #include <>'s to #include "" 's, for stylistic reasons only.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=471
1999-08-10More whitespace fixups, and fix a typo in a comment.Guy Harris1-4/+4
svn path=/trunk/; revision=463
1999-08-10Fix up whitespace.Guy Harris1-2/+2
svn path=/trunk/; revision=462
1999-08-10Add the ability to specify a filter to be used when reading the file toGuy Harris1-29/+30
the "Open File" dialog box (the "Open File" dialog box equivalent of the "-R" flag). Have "load_cap_file()" take the filter expression as an argument, and make the global "rfilter" into a member of a "capture_file" structure. When reading a temporary capture file after a live capture, don't apply any filter. Move the code that pops up error boxes on file opens when reading a capture file back to "load_cap_file()"; it also pops up error boxes if the filter expression can't be parsed. Don't enable "File/Save" or "File/Save As..." if an attempt to read a capture file fails - if there was already an open capture file, it was closed by "load_cap_file()", so we no longer have an open file to save. svn path=/trunk/; revision=460
1999-08-10Building a GList by adding elements to the end with "g_list_append()" isGuy Harris1-2/+3
N^2 in the ultimate size of the list (as "g_list_append()" is linear in the size of the list, at least when used in the way the GLib documentation says to use it); instead, maintain our own linked list of "frame_data" structures for all packets read, including a pointer to the last element. "gtk_clist_set_row_data()" is linear in the row number, so if it's used to attach a pointer to the "frame_data" structure for a packet to the packet list GtkClist row for each packet, that's also N^2 in the number of packets in that packet list; instead, store the row number in the "frame_data" structure, and find the packet for a given row by scanning the list for it (we were already scanning the list linearly to find that packet's index in the list of all packets; that's only done when a packet's selected, so it's not *too* bad, but it might be nice to avoid having to do that scan). svn path=/trunk/; revision=457
1999-08-07Allow compilation of ethereal in a directory different thanLaurent Deniel1-2/+2
the source directory. The doc makefile is still broken however. Thanks to Jan Bernard van Doorn for raising this problem. svn path=/trunk/; revision=453
1999-08-05Added a progress bar to the display filter computation. Unfortunately,Gilbert Ramirez1-1/+2
try as I might, I couldn't get gtk_timeout_add to work. I read all the docs, but no luck. So for now I call dfilter_progress_cb for every 20 packets that are filtered. I'd rather have *something* for the next Ethereal release than nothing. I also modified file_progress_cb to use it's local copy of cf rather than the global copy. svn path=/trunk/; revision=447
1999-08-02Check in Olivier Abad's patch to add dissectors for LAP-B and X.25, andGuy Harris1-1/+2
wiretap support for RADCOM Ltd.'s WAN/LAN analyzers (see http://www.radcom-inc.com/ ). Note: as I remember, IEEE 802.2/ISO 8022 LLC has somewhat of an SDLC flavor to it, just as I think LAP, LAPB, LAPD, and so on do, so we may be able to combine some of the LLC dissection and the LAPB dissection into common code that could, conceivably be used for other SDLC-flavored protocols. Make "S" a mnemonic for "Summary" in the "Tools" menu. Move the routine, used for the "Tools/Summary" display, that turns a wiretap file type into a descriptive string for it into the wiretap library itself, expand on some of its descriptions, and add an entry for files from a RADCOM analyzer. Have "Tools/Summary" display the snapshot length for the capture. svn path=/trunk/; revision=416
1999-07-24Turn "protocol_tree" and "fd" from global variables into members of aGuy Harris1-1/+4
"capture_file" structure, make a "select_packet()" routine to parallel "unselect_packet()", and have "unselect_packet()" free the protocol tree that the "protocol_tree" member of the "capture_file" passed to it points to. It should now be impossible to do a "Print Packet" operation if no packet has been selected, so remove the check for that (we'll probably just blow up if it happens; if it does, that means we probably forgot to gray out "/File/Print Packet" somewhere, so we should fix that). svn path=/trunk/; revision=385
1999-07-24Have "close_cap_file()" disable all menu items that make sense only ifGuy Harris1-1/+4
you have a capture. Leave the job of enabling and disabling menu items that make sense only if you have a capture (except for "File/Save" and "File/Save As...", for now) up to "load_cap_file()", "close_cap_file()", and the like - don't scatter that stuff throughout the code. Disable "File/Print Packet" if no packet is selected; enable it only if a packet is selected. If there's a selected packet, and a display filter is run: if the selected packet passed the filter, re-select it; if the selected packet didn't pass the filter, un-select it. If we've opened a live "pcap" capture, but can't do the capture because we can't get the netmask info, or can't parse the capture filter string, or can't install the filter, close the live capture and the dump and delete the dump file. If we failed to open a live "pcap" capture, don't try to read the capture file - it doesn't exist. svn path=/trunk/; revision=384
1999-07-23Add a "File/Print" menu item, which prints *all* the packets in theGuy Harris1-2/+3
capture to a file or printer. This should eventually get the ability to print either all the packets or only the packets selected by the display filter, and possibly also the ability to print only packets M through N. Get rid of "cur" member of "capture_file" structure; nobody used it. There's no need to pass a pointer to a "dialog_button" variable to "simple_dialog()" for the error boxes displayed if a file copy or move fails; that dialog box is just a message box and has only an "OK" button. Put the declaration of "prefs" into "prefs.h". svn path=/trunk/; revision=378
1999-07-13Added support for compiling on win32 with Visual C and 'nmake'. It compiles,Gilbert Ramirez1-1/+6
but does not link. Perhaps someone who understands the MS tools can help out. I made it link a few months ago, but with different version of glib/gtk+. I can't remember how I made it link. Most of the compatibility issues were resolved with adding #ifdef HAVE_UNISTD_H the the source code. Please be sure to add this to all future code. svn path=/trunk/; revision=359
1999-07-09Added the ability to create a read-only ethereal, i.e., one thatGilbert Ramirez1-2/+11
doesn't link with libpcap, so no packet captures can be made. The "--disable-pcap" option has been added to the configure script. Docs have been updated. And the string buffer size in the simple_dialog() has been doubled so that Johan's e-mail address in the "About" dialogue window doesn't get chopped off. svn path=/trunk/; revision=351
1999-07-07Created a new protocol tree implementation and a new display filterGilbert Ramirez1-57/+6
mechanism that is built into ethereal. Wiretap is now used to read all file formats. Libpcap is used only for capturing. svn path=/trunk/; revision=342
1999-06-22Added Aaron Hillegass' summary dialogue. We're ignoring the problem withGilbert Ramirez1-1/+4
NetMon statistic packets for now. We might fix that problem with wiretap, either filtering out those packets, and/or providing the summary information through a new wiretap API. svn path=/trunk/; revision=326
1999-06-22Update the display if the "command-line-specified" time format isGuy Harris1-2/+3
changed by updating those columns showing the time in the "command-line-specified" format, not by redoing the entire packet list display; that way, the display continues to show the same packets and any packet the user selected remains selected. (It's also less work to do that - you don't have to re-dissect the packet.) Turn "redisplay_packets()" into "filter_packets()", and do some other cleanups. svn path=/trunk/; revision=325
1999-06-19Added "Capture" and "Display" menus; "Capture" has a "Start" item, whichGuy Harris1-3/+4
is the same as "Tools/Capture", and "Display" has an "Options" item, which pops up a dialog box to let you change the "default" time-stamp column display format on the fly (the "default" is what the "-t" command-line option sets), and have the display change when you do that. Made infrastructure changes to make the immediate display update work. Removed some unused functions, declared some functions used only in the file in which they're defined "static", and removed some unnecessary #includes. svn path=/trunk/; revision=317
1999-06-12Improve the alert boxes put up for file open/read/write errors. (SomeGuy Harris1-1/+23
influence came from http://developer.apple.com/techpubs/mac/HIGuidelines/HIGuidelines-232.html which has a section on dialog box and alert box messages. However, we're largely dealing with technoids, not with The Rest Of Us, so I didn't go as far as one perhaps should.) Unfortunately, it looks like it's a bit more work to arrange that, if you give a bad file name to the "-r" flag, the dialog box pop up only *after* the main window pops up - it has the annoying habit of popping up *before* the main window pops up, and sometimes getting *obscured* by it, when I do that. The removal of the dialog box stuff from "load_cap_file()" was intended to facilitate that work. (It might also be nice if, when an open from the "File/Open" menu item fails, we keep the file selection box open, and give the user a chance to correct typos, choose another file name, etc.) svn path=/trunk/; revision=310
1999-05-11Live data capture and display enhancement that allows network capture andLaurent Deniel1-1/+3
display of fully decoded packets at the same time. Options added: -F : fork capture process -S : sync mode ala tail -f (implies -F) -f : filter expression -Q : exit after capture (implies -k) svn path=/trunk/; revision=276
1999-04-06Capturing packets from ethereal now saves the capture in an "anonymous" ↵Gilbert Ramirez1-2/+5
buffer. That is, it's a random name chosen by tempnam(), unknown to the user. If the user decides to save that trace, he then uses File | Save to save it to a file. File | Save As lets him make a copy of his named trace file as well. I also updated my e-mail address in the various credit locations. svn path=/trunk/; revision=242
1999-03-23Removed all references to gtk objects from packet*.[ch] files. They nowGilbert Ramirez1-3/+9
reference the protocol tree with struct proto_tree and struct proto_item objects. That way, the packet decoding source code file can be used with non-gtk packet decoders, like a curses-based ethereal, e.g. I also re-arranged some of the information in packet.h to more appropriate places (like other packet-*.[ch] files). svn path=/trunk/; revision=223
1999-02-11Make the minimum and maximum packet sizes #defines.Guy Harris1-2/+2
Crank the maximum packet size up to 65535 bytes. svn path=/trunk/; revision=185
1999-01-07I removed the per-file encapsulation type from wiretap, and make all filetypesGilbert Ramirez1-1/+3
provide a per-packet encapsulation type. this required minor modifications to ethereal. svn path=/trunk/; revision=162
1999-01-02Added the iptrace (AIX's packet-capture tool) file format to wiretap.Gilbert Ramirez1-1/+3
This necessitated a change in ethereal because iptrace supports multi-NIC packet capturing, including multi-datalink-type capturing. svn path=/trunk/; revision=145
1998-11-17* Added column formatting functionality.Gerald Combs1-2/+3
* Added check_col(), add_col_str() and add_col_fmt() to replace references to ft->win_info. * Added column prefs handling code. svn path=/trunk/; revision=97
1998-11-15Add support to wiretap for reading Sun "snoop" capture files.Guy Harris1-22/+18
That requires that, in the packet-reading loop, we pass to the callback routine the offset in the file of a packet's data, because we can no longer compute that offset by subtracting the size of the captured packet data from the offset in the file after the data was read - "snoop" may stick padding in after the packet data to align packet headers on 4-byte boundaries. Doing that required that we arrange that we do that for "libpcap" capture files as well; the cleanest way to do that was to write our own code for reading "libpcap" capture files, rather than using the "libpcap" code to do it. Make "wtap_dispatch_cb()" and "pcap_dispatch_cb()" static to "file.c", as they're not used elsewhere. If we're using wiretap, don't define in "file.h" stuff used only when we're not using wiretap. Update the wiretap README to reflect Gilbert's and my recent changes. Clean up some memory leaks in "wiretap/lanalyzer.c" and "wiretap/ngsniffer.c", where the capture-file-format-specific data wasn't freed if the open failed. svn path=/trunk/; revision=91
1998-11-12A lengthy patch to add the wiretap library. Wiretap is not used by defaultGilbert Ramirez1-2/+14
because it is still in its infancy, but it can be compiled in optionally. The library exists in its own subdirectory ethereal/wiretap. This patch also edits all the packet-*.c files to remove the #include <pcap.h> line which is unnecessary in these files. In the ethereal code, file.c is the most heavily modified with #ifdef WITH_WIRETAP lines for the optional library. svn path=/trunk/; revision=82
1998-10-12- Added match_strval function to packet.cGerald Combs1-2/+3
- Separated display and capture filters; rearranged some of the look and feel - Lots of other miscellaneous fixes and updates svn path=/trunk/; revision=38
1998-09-17* Added Mike Hall's TCP reconstruction code.Gerald Combs1-1/+2
svn path=/trunk/; revision=10
1998-09-16Added ID tags to the beginning of each source file.Gerald Combs1-0/+2
svn path=/trunk/; revision=7
1998-09-16Initial revisionGerald Combs1-0/+99
svn path=/trunk/; revision=2