aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
1999-08-20Changed some symbols inside parser, fixed default error message inGilbert Ramirez4-10/+10
dfilter_compile, and removed debug printf that I left in match_selected. svn path=/trunk/; revision=532
1999-08-20Include "snprintf.h" if necessary, to squelch some "gcc -Wall"Guy Harris2-2/+20
complaints. svn path=/trunk/; revision=531
1999-08-20Enabled error reporting for bad ETHER values in display filters. A newGilbert Ramirez5-30/+43
global variable, dfilter_error_msg is now available, being NULL when there was no error, or pointing to a string when an error occurred. The three places that dfilter_compile() is called now use this global variable to report the error message to the user. A default error message is put in that string if no context-specific error message is available (since I only have one context-specifici error message, namely, ETHER values, that will be most of the time). svn path=/trunk/; revision=530
1999-08-20Cleaned up the two routines besides the main display filter mechanismGilbert Ramirez1-39/+24
that use display filters, TCP follow and Match Selected. In Match Selected, I made it put the display filter that it creates in the text entry widget. The code was already there, but it didn't work because code was missing in the GUI initialization routine that runs when Ethereal starts. The text entry widget pointer was not being passed to the Match Selected menu item. In TCP follow, I made it _not_ put the display filter that it creates in the text entry widget. I find it annoying that a really long display filter is left in the widget, and others have voiced their opinion on this too. In addition, after applying the display filter and retreiving the TCP data, the display filter (if any) that the user had in place _before_ running TCP follow is put back and the packet list is set back to the way it was before TCP follow is run. I think this is more expected. The drawback is that display filtering is run twice, once to retreive the TCP data and once to reset the display. svn path=/trunk/; revision=529
1999-08-20Fix a comment.Guy Harris1-1/+1
svn path=/trunk/; revision=528
1999-08-20Add Olivier Abad to the list of Wiretap authors, as the code to readGuy Harris1-0/+7
RADCOM WAN/LAN Analyzer capture files is his. svn path=/trunk/; revision=527
1999-08-20Note that we now have the ability to read Ethernet and X.25 capturesGuy Harris1-1/+6
from RADCOM WAN/LAN Analyzers. (BTW, the previous checkin also removed the comments about the hack wherein we pretended that ATM Sniffer captures were really Ethernet, Token-Ring, or RFC 1483 captures, given that said hack was itself removed.) svn path=/trunk/; revision=526
1999-08-20Remove the stuff about filters in Wiretap, as that capability wasGuy Harris1-21/+6
removed when a more powerful display filtering mechanism was added to Ethereal. svn path=/trunk/; revision=525
1999-08-20Get rid of an unused variable left stranded on the beach when a waveGuy Harris1-2/+1
washed out to sea the code that used to pretend that an ATM Sniffer capture was an Ethernet or Token-Ring Sniffer capture. svn path=/trunk/; revision=524
1999-08-20Add support for reading Full Frontal ATM from an ATM Sniffer captureGuy Harris13-398/+795
file, instead of throwing out all but LANE or RFC 1483 data frames and pretending that the former are just Ethernet or Token-Ring frames. Add some level of decoding for ATM LANE, but not all of it; the rest, including decoding non-LANE frames, is left as an exercise for somebody who has captures they want to decode, an interest in decoding them, ATM expertise, and time.... svn path=/trunk/; revision=523
1999-08-20Made handling of byte strings in scanner and parser much simpler,Gilbert Ramirez5-112/+101
improving size of grammar and creating the possibility of dfilter_compile reporting errors back to user. In this case, if an ETHER variable is compared against a byte string that is not 6 bytes, an error condition is flagged appropriately. I have not put in the code to conver that error flag to a message to the user, but that's what I'm working on next. Also, fixed sample debug session in README to show correct gdb prompt. svn path=/trunk/; revision=522
1999-08-20Made LanAlyzer smarter about reading trace files, thereby removing aGilbert Ramirez2-84/+69
variable from lanalyzer_t (plus an additional variable which wasn't being used). While I was in there I cleaned up some comments and renamed a couple variables to make more sense. svn path=/trunk/; revision=521
1999-08-20"open_cap_file()" calls "close_cap_file()" if its attempt to open theGuy Harris1-2/+2
capture file succeeds, so that it cleans out any state in the "capture_file" structure it was handed before filling it in with new state for the new capture file. This means it destroys any read filter associated with the "capture_file" structure it was handed, so the "rfcode" field must be set *after* calling "open_cap_file()" but *before* calling "read_cap_file()". Do so for the "capture file (and possibly read filter) supplied on the command line" case. svn path=/trunk/; revision=520
1999-08-20Made iptrace wiretap module return error on partial packets, instead ofGilbert Ramirez2-16/+42
expecting it as normal. Added paragraph about iptrace oddities to README. I also added a section to the README about how to report bugs. svn path=/trunk/; revision=519
1999-08-19Have the per-capture-file-type open routines "wtap_open_offline()" callsGuy Harris1-3/+2
return 1 on success, -1 if they got an error, and 0 if the file isn't of the type that file is checking for, and supply an error code if they return -1; have "wtap_open_offline()" use that error code. Also, have the per-capture-file-type open routines treat errors accessing the file as errors, and return -1, rather than just returning 0 so that we try another file type. Have the per-capture-file-type read routines "wtap_loop()" calls return -1 and supply an error code on error (and not, as they did in some cases, call "g_error()" and abort), and have "wtap_loop()", if the read routine returned an error, return FALSE (and pass an error-code-pointer argument onto the read routines, so they fill it in), and return TRUE on success. Add some new error codes for them to return. Now that "wtap_loop()" can return a success/failure indication and an error code, in "read_cap_file()" put up a message box if we get an error reading the file, and return the error code. Handle the additional errors we can get when opening a capture file. If the attempt to open a capture file succeeds, but the attempt to read it fails, don't treat that as a complete failure - we may have managed to read some of the capture file, and we should display what we managed to read. svn path=/trunk/; revision=518
1999-08-19Use "g_strdup()" rather than "strdup()".Guy Harris1-2/+2
svn path=/trunk/; revision=517
1999-08-19Have the per-capture-file-type open routines "wtap_open_offline()" callsGuy Harris21-372/+680
return 1 on success, -1 if they got an error, and 0 if the file isn't of the type that file is checking for, and supply an error code if they return -1; have "wtap_open_offline()" use that error code. Also, have the per-capture-file-type open routines treat errors accessing the file as errors, and return -1, rather than just returning 0 so that we try another file type. Have the per-capture-file-type read routines "wtap_loop()" calls return -1 and supply an error code on error (and not, as they did in some cases, call "g_error()" and abort), and have "wtap_loop()", if the read routine returned an error, return FALSE (and pass an error-code-pointer argument onto the read routines, so they fill it in), and return TRUE on success. Add some new error codes for them to return. Now that "wtap_loop()" can return a success/failure indication and an error code, in "read_cap_file()" put up a message box if we get an error reading the file, and return the error code. Handle the additional errors we can get when opening a capture file. If the attempt to open a capture file succeeds, but the attempt to read it fails, don't treat that as a complete failure - we may have managed to read some of the capture file, and we should display what we managed to read. svn path=/trunk/; revision=516
1999-08-18Changes to compile in win32.Gilbert Ramirez3-13/+16
svn path=/trunk/; revision=515
1999-08-18In "wtap_dump_close()", don't shove the return value of "fclose()" intoGuy Harris1-3/+2
the variable for the return value of "wtap_dump_close()", just check it against EOF; shoving it into "ret" means it gets set to 0 on a successful close, but a return value of 0 means "wtap_dump_close()" failed. svn path=/trunk/; revision=514
1999-08-18"wtap_pcap_encap_to_wtap_encap()" shouldn't return a file type if itGuy Harris3-5/+15
can't translate the encapsulation type, it should return an encapsulation type; we add a new one, WTAP_ENCAP_UNKNOWN. and have it return that. Have "capture()" handle "wtap_pcap_encap_to_wtap_encap()" returning that encapsulation type (if it happens, we need to add a new Wiretap encapsulation type to handle the new "libpcap" encapsulation type). svn path=/trunk/; revision=513
1999-08-18Re-arranged Ethereal's definitions of DLT_RAW et al. since capture.cGilbert Ramirez3-19/+21
is the only file that uses them. I hope to avoid some compiler warnings with this. svn path=/trunk/; revision=512
1999-08-18Small change to create_tempfile, initializing static vars.Gilbert Ramirez1-7/+8
svn path=/trunk/; revision=511
1999-08-18Make "wtap_dump()" and "wtap_dump_close()" return error codes, and checkGuy Harris4-50/+105
for errors when closing a file to which we've written packets (we don't bother checking if we're giving up on a capture). Add some more error checks in Wiretap. Make a single list of all Wiretap error codes, giving them all different values (some can be returned by more than one routine, so they shouldn't be per-routine). svn path=/trunk/; revision=510
1999-08-18Add to Wiretap the ability to write capture files; for now, it can onlyGuy Harris10-93/+410
write them in "libpcap" format, but the mechanism can have other formats added. When creating the temporary file for a capture, use "create_tempfile()", to close a security hole opened by the fact that "tempnam()" creates a temporary file, but doesn't open it, and we open the file with the name it gives us - somebody could remove the file and plant a link to some file, and, if as may well be the case when Ethereal is capturing packets, it's running as "root", that means we write a capture on top of that file.... (The aforementioned changes to Wiretap let you open a capture file for writing given an file descriptor, "fdopen()"-style, which this change requires.) svn path=/trunk/; revision=509
1999-08-18Fix up the call to "reassemble_tcp()" to use "pi.len" andGuy Harris1-6/+6
"pi.captured_len" to compute the total amount of TCP payload and the captured amount of TCP payload. svn path=/trunk/; revision=508
1999-08-18Make a "create_tempfile()" routine that constructs the template to beGuy Harris3-7/+93
used by "mkstemp()" into a buffer supplied as an argument, trying several directories for the tempfile, in the same fashion that the BSD (and probably other) "tempnam()" routines do. Have that routine cope with temporary-file directory names that don't end with "/", as "P_tmpdir" doesn't necessarily end with "/" (and doesn't, in GNU "libc" 2.x, at least on Linux); thanks to Gilbert Ramirez for catching this one, and supplying the code to cope with that. Have the code that creates the temporary file for the "Follow TCP Stream" text use it. svn path=/trunk/; revision=507
1999-08-18Declare the "packet_info" structure "pi" in "packet.h", rather than in aGuy Harris13-78/+93
bunch of source files. Replace the "payload" field of a "packet_info" structure with "len" and "captured_len" fields, which contain the total packet length and total captured packet length (including all headers) at the current protocol layer (i.e., if a given layer has a length field, and that length field says its shorter than the length we got from the capture, reduce the "pi.len" and "pi.captured_len" values appropriately). Those fields can be used in the future if we add checks to make sure a field we're extracting from a packet doesn't go past the end of the packet, or past the captured part of the packet. Get rid of the additional payload argument to some dissection functions; use "pi.captured_len - offset" instead. Have the END_OF_FRAME macro use "pi.captured_len" rather than "fd->cap_len", so that "dissect the rest of the frame" becomes "dissect the rest of the packet", and doesn't dissect end-of-frame padding such as padding added to make an Ethernet frame 60 or more octets long. (We might want to rename it END_OF_PACKET; if we ever want to label the end-of-frame padding for the benefit of people curious what that extra gunk is, we could have a separate END_OF_FRAME macro that uses "fd->cap_len".) svn path=/trunk/; revision=506
1999-08-17Converted more of the IP fields to filterable fields.Gilbert Ramirez1-11/+32
svn path=/trunk/; revision=505
1999-08-17Fix a typo in a comment.Guy Harris1-2/+2
svn path=/trunk/; revision=504
1999-08-17Expand some comments.Guy Harris1-4/+15
Check for errors reading the "Follow TCP Stream" temporary file. Unlink the temporary file after attempting to open and read the file, even if the attempt to open it failed. svn path=/trunk/; revision=503
1999-08-16Pick up a change from the OpenBSD ports collection, to use "mkstemp()"Guy Harris1-11/+30
to create the temporary file to which the "Follow TCP Stream" code writes the contents of the TCP stream; this was presumably done to close a potential security hole opened by the possibility of somebody replacing the file referred to by the name generated by "tmpnam()" before we open it. (We may have to provide our own version of "mkstemp()" if there are any platforms on which we run that lack it. Note that Solaris 2.5.1 has it, even though it's not documented and isn't declare in its "stdlib.h".) Have the "Follow TCP Stream" code put up a dialog box, rather than spitting a message out to the standard error, if the attempt to create the temporary file fails. Check also whether the attempt to open the "Follow TCP Stream" temporary file for reading fails, and put up a dialog box for that as well. svn path=/trunk/; revision=502
1999-08-16Get rid of the comments saying "make ["decode_numeric_bitfield()"] shiftGuy Harris1-7/+1
the value appropriately!" - a change from Olivier Abad did so. svn path=/trunk/; revision=501
1999-08-15Fixed segfault with new gtk_tree_item deselection routine and -S option.Gilbert Ramirez1-9/+11
svn path=/trunk/; revision=500
1999-08-15The "loop_data" structure is used only in "capture.c"; move itsGuy Harris2-11/+11
definition from "capture.h" to "capture.c". svn path=/trunk/; revision=499
1999-08-15"open_cap_file()", if it succeeds, closes any capture file we had open;Guy Harris1-5/+3
that means it destroys any read filter we had, so we don't need to destroy it in "capture()" after "open_cap_file()" succeeds. svn path=/trunk/; revision=498
1999-08-15Don't preserve the read filter from file to file - you won't necessarilyGuy Harris4-60/+81
want to read the next file with the same filter that you used on the last file. In the "File/Open" dialog box, parse the read filter before trying to open the file, and if the parse fails, leave the dialog box up so the user still has the filter and file name around and can try to fix the problem. Keep the compiled read filter attached to the "capture_file" structure, so you don't have to reparse it on a "File/Reload". svn path=/trunk/; revision=497
1999-08-15Fixed the problem with an assert coming from gtkwidget.c:3196 whenGilbert Ramirez2-8/+28
selecting a field from more than one protocol tree. It turns out that gtktree.c doesn't clear the tree-item selection list when you use gtk_tree_clear_items() (which calls gtk_tree_remove_items() ). So the next time a tree item is selected in a new protocol tree (which is our old protocol tree, with everything removed, and new things added), gtk_tree tries to _deselect_ our old selection. But that tree-item which is trying to be deselected is long gone, resulting in the assert because widget == NULL. A function needs to be added to gtk_tree to deselect the tree-item selection for us. (or we need to go through the hassle of creating a new gtk_tree instead of recycling tree_view over and over). I stole some code from another section of gtktree.c which lets us clear the selection in clear_tree_and_hex_views(). Also, I modified the argument to gtk_tree_set_view_mode. We were using "TRUE", when really we should have used a member of the GtkTreeViewMode enumeration, namely GTK_TREE_VIEW_ITEM ( which is 1, which is TRUE :-) svn path=/trunk/; revision=496
1999-08-15Have "wtap_open_offline()" return, on failure, an indication of theGuy Harris5-67/+58
reason for the failure, and have it do the checks to make sure the file being opened is a plain file or a pipe. Have "open_cap_file()" make use of that. Don't automatically set "last_open_dir" if a "-r" flag was specified on the command line - do so only if the file in question could actually be opened. svn path=/trunk/; revision=495
1999-08-15"read_cap_file()" doesn't need to be passed a file name as an argument -Guy Harris4-16/+16
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-15Oops, forgot to get rid of the "open_cap_file()" in "load_cap_file()"Guy Harris1-6/+1
when I turned the latter into "read_cap_file()". svn path=/trunk/; revision=493
1999-08-15Split "load_cap_file()" into "open_cap_file()" and "read_cap_file()".Guy Harris4-61/+83
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-14Add ICMP to the set of packet types counted in the window shown while aGuy Harris3-4/+17
capture is in progress. svn path=/trunk/; revision=491
1999-08-14Fixed File|Save As (it was using wrong variable for source filename).Gilbert Ramirez1-21/+41
Ethereal now remembers the directory where it last opened a file, either via the GUI File|Open or command-line '-r' option. The next time File|Open is used, browsing starts from that directory. svn path=/trunk/; revision=490
1999-08-14Fixed segfault with combination of new dfilter struct usage, rfcode,Gilbert Ramirez2-9/+15
and File | Open option. svn path=/trunk/; revision=489
1999-08-14Added dfilter-int.h to list of deliverables.Gilbert Ramirez1-0/+1
svn path=/trunk/; revision=488
1999-08-14Modified YACC grammar to use non-yy symbols, to avoid conflicts withGilbert Ramirez4-38/+38
libpcap's that were compiled with symbols beginning with 'yy'. svn path=/trunk/; revision=487
1999-08-14Have the "delta" format for time stamps show the time delta between aGuy Harris3-116/+155
packet and the previous *displayed* packet, rather than the previous packet in a capture. svn path=/trunk/; revision=486
1999-08-14Fix up the code that changes the "command-line-specified" time format toGuy Harris1-40/+30
handle a display with a display filter. (Also, don't have it recompute the time stamps - they were computed when the packet was added to the packet list in the first place.) svn path=/trunk/; revision=485
1999-08-14Enable the "Display/Options" menu item when we're capturing with "-S",Guy Harris1-1/+2
so you can change the time stamp column while you're capturing. svn path=/trunk/; revision=484
1999-08-14In "change_time_formats()", you have to set "fd->cinfo" before you canGuy Harris1-1/+2
use "check_col()", otherwise "check_col()" always fails, and the time column never gets changed. (How did I manage to break that?) svn path=/trunk/; revision=483