aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
AgeCommit message (Collapse)AuthorFilesLines
1999-07-28Code cleaning:Laurent Deniel1-56/+3
- remove the tail_timeout_cb feature - remove unneeded fseek. svn path=/trunk/; revision=400
1999-07-28Include <stdlib.h> to get "atoi()" declared, to squelch a "gcc -Wall"Guy Harris1-1/+2
complaint. svn path=/trunk/; revision=399
1999-07-28Fix the -S option :Laurent Deniel1-6/+30
- read only the real number of packets that have been written by the child process. That's avoid incomplete packet read. - special timeout handling no more necessary and the whole real time capture and display behavior is much more satisfying with this patch. - wiretap modified to allow the reading of 'count' packets with wtap_loop. svn path=/trunk/; revision=398
1999-07-28If a column doesn't automatically resize, we have to set its size to theGuy Harris1-4/+9
appropriate value when we thaw the packet list, so that its size isn't set to the size of the column title. svn path=/trunk/; revision=396
1999-07-28Get rid of the "Tools/Capture" menu item, in favor of "Capture/Start".Guy Harris1-3/+5
svn path=/trunk/; revision=395
1999-07-28Have:Guy Harris1-6/+54
COL_INFO columns resize automatically even during a live capture; columns showing network addresses never resize automatically; other columns resize only when a capture is done; and make all columns resizeable by hand (once they've resized, for auto-resizeable columns). svn path=/trunk/; revision=394
1999-07-27Actually, I think File/Reload is still used if you do a capture withGuy Harris1-1/+4
"-F" - you do a File/Reload to see any new packets that showed up since the last time the file was loaded. svn path=/trunk/; revision=387
1999-07-27File/Reload isn't necessary any more - to run a display filter, justGuy Harris1-4/+1
fill in the display filter text entry box and hit <Enter> - so remove it. svn path=/trunk/; revision=386
1999-07-24Turn "protocol_tree" and "fd" from global variables into members of aGuy Harris1-1/+47
"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-24/+50
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-23Printing multiple frames in PostScript is a bit tricky, I think - IGuy Harris1-4/+15
think I may have to worry about page boundaries and the like - so, for now, we make the "File/Print..." stuff print only as text. ("Print Packet" can still print PostScript, as always.) We clean up a few text vs. PostScript things for printing multiple frames, but it's still not ready for prime time. svn path=/trunk/; revision=383
1999-07-23Add a "File/Print" menu item, which prints *all* the packets in theGuy Harris1-11/+54
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-22Revert to static sizing of columns.Guy Harris1-90/+33
svn path=/trunk/; revision=377
1999-07-20In the BSD standard I/O library, there's a flag in a FILE structureGuy Harris1-6/+24
that's set whenever we encounter an EOF; if that flag is set, all subsequent reads return an EOF indication. I.e., end-of-file is sticky. This means that the stuff to continue reading a capture file, if we're updating the display as the capture progresses, doesn't work - it gets stuck at the point where the first read finished. To clear that flag, we must do an "fseek()"; we do one that doesn't move the seek pointer. When updating the display as a capture progresses, do "init_col_widths()" only when we first open the capture file; there's no need to do it every time we read from the file - the column widths never get smaller, they can only get bigger or stay the same. svn path=/trunk/; revision=370
1999-07-13Since ethereal is now dependent on GTK+-1.2.x (because of proto_tree andGilbert Ramirez1-43/+1
display filter code, which uses features in GLIB-1.2.x), I removed the vestigial code supporting old 1.0.x and 1.1.x GTK+ versions. svn path=/trunk/; revision=360
1999-07-13Added support for compiling on win32 with Visual C and 'nmake'. It compiles,Gilbert Ramirez1-1/+19
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-11When you hit <Return> in the text entry box for the display filter,Guy Harris1-36/+72
apply the filter (if it isn't invalid). Apply the filter by clearing the Clist that shows packet summary lines and scanning through the list of all packets and adding to the Clist those that match the filter. Get rid of "if (dfilter_proto_tree)" test in "load_cap_file()"; "dfilter_proto_tree" is always FALSE, and all the test does is keep us from doing a "gtk_clist_freeze()" of the packet list, and we don't want to do that (we don't want the packet to be updated until we're done reading in the file). Get rid of "dfilter_proto_tree", as it's no longer used. Move the test that checks whether the display filter matches the current packet to "add_packet_to_packet_list()"; this allows us to run "dissect_packet()" only once - if we have a display filter, we generate the summary info *and* the protocol tree in the same call, using the summary info to make the packet list item and the protocol tree when checking the display filter. In "dfilter_compile()", destroy "*p_dfcode" if it's not NULL, so we don't leak memory. svn path=/trunk/; revision=355
1999-07-09Added the ability to create a read-only ethereal, i.e., one thatGilbert Ramirez1-3/+1
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-159/+30
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/+15
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-9/+100
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-19Update a comment.Guy Harris1-6/+6
svn path=/trunk/; revision=320
1999-06-19Use "gtk_toggle_button_set_state()" rather thanGuy Harris1-3/+61
"gtk_toggle_button_set_active()" to set the state of radio buttions; "gtk_toggle_button_set_active()" doesn't exist in GTK+ 1.0[.x], and "gtk_toggle_button_set_state()" is an alias for it in GTK+ 1.2[.x]. Compute the column widths in the summary display based on the longest string in the column; recompute it whenever we update the columns. svn path=/trunk/; revision=319
1999-06-19Added "Capture" and "Display" menus; "Capture" has a "Start" item, whichGuy Harris1-46/+94
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-15Put "..." after menu items that will cause a dialog box to be popped upGuy Harris1-15/+15
(standard convention in many GUIs). Make "Save as" be "Save As", and make "A" be the menu mnemonic for it in the "File" menu, with GTK 1.2. svn path=/trunk/; revision=315
1999-06-14Add our own "strerror()", which we use on platforms that don't have itGuy Harris1-1/+5
in the standard libraries (such as SunOS 4.x). svn path=/trunk/; revision=312
1999-06-12Improve the alert boxes put up for file open/read/write errors. (SomeGuy Harris1-19/+173
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-11Fixed problem where filename of capture file would not be displayed inGilbert Ramirez1-2/+4
status bar if invoked by "ethereal -r filename". svn path=/trunk/; revision=278
1999-05-11Live data capture and display enhancement that allows network capture andLaurent Deniel1-3/+163
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-7/+14
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-2/+2
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-03-20Re-wrote the NCP module in accordance with how NCP is really organized.Gilbert Ramirez1-2/+6
NCP is still not decoded much, but the infrastructure for doing so is now in place, including a hashtable to record the NCP type of each request so that we now how to parse the response. svn path=/trunk/; revision=215
1999-03-01Added display filters to wiretap.Gilbert Ramirez1-1/+7
svn path=/trunk/; revision=198
1999-01-21I changed the wtap_open_offline() function so that it takes only theGilbert Ramirez1-2/+2
filename as the parameter. So far all the filetypes that wiretap can read can be inferred from the first few bytes of the file, so we never have to give wiretap a hint as to the file type. svn path=/trunk/; revision=173
1999-01-07I removed the per-file encapsulation type from wiretap, and make all filetypesGilbert Ramirez1-6/+2
provide a per-packet encapsulation type. this required minor modifications to ethereal. svn path=/trunk/; revision=162
1999-01-03The "lnk_t" field of per-packet data, and the "pkt_encap" field in theGuy Harris1-1/+3
packet header, are there only if "wiretap" is used, so protect their use with "#ifdef WITH_WIRETAP". svn path=/trunk/; revision=147
1999-01-02Added the iptrace (AIX's packet-capture tool) file format to wiretap.Gilbert Ramirez1-1/+2
This necessitated a change in ethereal because iptrace supports multi-NIC packet capturing, including multi-datalink-type capturing. svn path=/trunk/; revision=145
1998-12-29* Added Joerg Mayer's Vines patchGerald Combs1-118/+28
* Added Joerg to the AUTHORS file * Added Guy's bitfield decode patch * Fixed time output svn path=/trunk/; revision=142
1998-12-17A patch spread across many files to let Ethereal compile under GTK+-1.1.x.Gilbert Ramirez1-2/+12
Tests for GTK versions are done during compilation, not during "./configure". The big problems have been taken care of in this patch (functional change in the packet clist and conversion of menu_factory to item_factory), but plenty of smaller problems with dialogue boxes abound. I have fixed a small problem with file_open*(), but have left 2 comments in just in case I'm not going about this the right way. Can someone verify? svn path=/trunk/; revision=127
1998-11-17* Added column formatting functionality.Gerald Combs1-7/+9
* 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-7/+19
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-4/+49
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-13Squelch a number of "-Wall" errors by:Guy Harris1-1/+6
1) renaming "snprintf.h" to "snprintf-imp.h" (it contains stuff used by the "snprintf()" *implementation*, but not stuff it *exports*); 2) creating a new "snprintf.h" to declare "vsnprintf()" and "snprintf()"; 3) removing an unused variable; 4) fixing a call to "add_item_to_tree()" to handle the possibility of "ntohl()" returning a "long" rather than an "int". svn path=/trunk/; revision=47
1998-10-13* Pod page updateGerald Combs1-2/+2
* Minor tweaks to the filter prefs svn path=/trunk/; revision=40
1998-10-12- Fixed status bar printing error (the total number of packets were beingGerald Combs1-2/+2
printed instead of the total number of drops) svn path=/trunk/; revision=39
1998-10-12- Added match_strval function to packet.cGerald Combs1-8/+10
- 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-10-10* OSPF alignment fixes (Gerald)Gerald Combs1-1/+5
* FDDI support (Laurent, Guy) svn path=/trunk/; revision=36
1998-09-27Merged in a _huge_ patch from Guy Harris. It adds a time stap column,Gerald Combs1-13/+48
generalizes the column printing code, adds a "frame" tree item to the tree view, and fixes a bunch of miscellaneous coding bugs. svn path=/trunk/; revision=31
1998-09-25* Ethernet manufacturer support (Laurent)Gerald Combs1-2/+2
* PPP fixes (Gerald) * Null/loopback interface support (Gerald) svn path=/trunk/; revision=25
1998-09-17* Added Mike Hall's TCP reconstruction code.Gerald Combs1-1/+4
svn path=/trunk/; revision=10