aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
AgeCommit message (Collapse)AuthorFilesLines
2005-02-13change nmake makefiles in /trunk and /trunk/epan so thatLars Roland1-4/+0
object code for libethereal.dll isn't generated by the makefile in /trunk. Having no code in /trunk linked into libethereal.dll anymore, the definition of the macro _NEED_VAR_IMPORT_ can be moved from various source files in /trunk to /trunk/Makefile.nmake . So do that, too. svn path=/trunk/; revision=13389
2005-02-07Fix up the suppression of packet printing and packet count printing soGuy Harris1-13/+22
that: packets are printed iff we're not saving packets to a file and "-q" wasn't specified; packet counts are printed iff we're capturing (i.e., not reading from a file) and "-q" wasn't specified. svn path=/trunk/; revision=13348
2005-02-07Make Ethereal and Tethereal compile if we're building without libpcap.Guy Harris1-1/+4
svn path=/trunk/; revision=13346
2005-02-07Suppress the packet counts when we're reading from a file.Guy Harris1-0/+1
svn path=/trunk/; revision=13342
2005-02-07Tethereal can write to a file in binary even if not built with libpcap.Guy Harris1-40/+41
svn path=/trunk/; revision=13341
2005-02-07Clean up indentation.Guy Harris1-39/+37
The default for "capture_options.save_file" is a null pointer, meaning we're not writing to a save file, we're writing out the dissection as text. svn path=/trunk/; revision=13340
2005-02-06"iface" is now a member of "capture_opts", not "cfile".Guy Harris1-1/+2
svn path=/trunk/; revision=13326
2005-02-06another two steps towards privilege seperation:Ulf Lamping1-20/+28
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. svn path=/trunk/; revision=13320
2005-02-05Put "cf_status_t" back.Guy Harris1-3/+3
svn path=/trunk/; revision=13303
2005-02-05Make "cf_open()" match the prototype in "file.h".Guy Harris1-1/+1
svn path=/trunk/; revision=13302
2005-02-04Instead of having a single enumerated type for status return values fromGuy Harris1-3/+3
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. svn path=/trunk/; revision=13293
2005-02-04huge cleanup of capture file API (functions in file.c/file.h).Ulf Lamping1-9/+7
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... svn path=/trunk/; revision=13289
2005-02-04(some) redesign of capture data structures.Ulf Lamping1-74/+79
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 svn path=/trunk/; revision=13276
2005-02-03move capture_file_fd field from capture_file to capture_opts type, as this ↵Ulf Lamping1-4/+6
is the place where it should be svn path=/trunk/; revision=13268
2005-02-03prevent ringbuffer from having to know about capture_file type at all ↵Ulf Lamping1-3/+3
(decoupling dependencies) svn path=/trunk/; revision=13266
2005-01-16Report a friendlier name, if possible, when capturing in Tethereal.Guy Harris1-1/+5
svn path=/trunk/; revision=13062
2004-12-29Make the tone of the error messages a bit less formal, by usingGuy Harris1-12/+12
contractions. (Safari does, at least when you're trying to open a file to which you don't have read access.) svn path=/trunk/; revision=12852
2004-12-01Move the #ifdef/#endif a bit so that the entire chunk ofGuy Harris1-2/+2
live-capture-related-code is inside it. svn path=/trunk/; revision=12651
2004-12-01minor fix to tethereal to allow it to compile with --without-pcapRonnie Sahlberg1-0/+2
svn path=/trunk/; revision=12650
2004-11-11As per Sebastian Felis, don't assume that doubling the size of the lineGuy Harris1-34/+34
buffer will necessarily be sufficient to make it big enough to handle what's being added to the buffer - continue doubling the size until it is. Put the code to maintain the line buffer into a routine. As that buffer is maintained as being large enough to handle what's being put into it, there's no need to use "snprintf()" to print into it. svn path=/trunk/; revision=12508
2004-10-19If we're not printing packet information, don't print the preamble orGuy Harris1-7/+11
finale for that information, either. svn path=/trunk/; revision=12352
2004-10-01Get rid of warnings about shadowed variables (code was ok)Jörg Mayer1-53/+53
svn path=/trunk/; revision=12171
2004-09-29Move the column preferences stuff to epan (the rest of the preferencesGuy Harris1-1/+1
stuff is already there). Update Gerald's e-mail address in column.h. svn path=/trunk/; revision=12131
2004-09-29Move the tap infrastructure to the epan directory.Guy Harris1-1/+1
svn path=/trunk/; revision=12128
2004-09-27Move prefs.c and prefs.h into the epan subdirectory.Guy Harris1-1/+1
svn path=/trunk/; revision=12115
2004-09-10Hoist the code for handling "-G" into a common module.Guy Harris1-20/+2
svn path=/trunk/; revision=11956
2004-09-10Add a "-G fields2" option which is like "-G fields", but extends the fieldGilbert Ramirez1-2/+6
records by tw fields: base (for integers), and blurb Add a "-G values" option which shows value strings and true_false strings for the fields that have them. svn path=/trunk/; revision=11954
2004-08-13When opening an output file, use "file_snaplen" as the snapshot length,Guy Harris1-2/+2
rather than "pcap_snapshot(ld.pch)" - we've set "file_snaplen" to "pcap_snapshot(ld.pch)" if we're capturing from a device, but if we're reading from a pipe, "ld.pch" is null (so we'll crash if we use it), and we've set "file_snaplen" from the header we've read from a pipe. svn path=/trunk/; revision=11734
2004-08-06From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that anGuy Harris1-1/+1
include of <resolv.h> in any system header file gets the system <resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]). svn path=/trunk/; revision=11615
2004-08-06Mention psml as a valid option to -T in the usage statements.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=11607
2004-08-03Disallow "-f" when not doing a live capture, rather than just ignoringGuy Harris1-0/+13
the specified filter. Note in the manual that you can't use capture filters when reading a capture file, and that read filters might require too much CPU when doing a live capture. svn path=/trunk/; revision=11594
2004-07-25Make some generic print routines that take, as an argument, a pointer toGuy Harris1-57/+155
a structure containing a pointer to print operations for that object and a pointer to the private subclass-dependent data for that object, with subclasses for text and PostScript, and use those rather than the old scheme where a print format was passed as an argument - or where (as in the case of printing summary information in Tethereal) we just printed as text even if "-T ps" was selected. Check whether those routines succeed or get an I/O error writing output. Clean up indentation. svn path=/trunk/; revision=11514
2004-07-25"-T ps" should not imply "-V"; one should be able to get a list ofGuy Harris1-1/+0
packet summaries in PostScript. svn path=/trunk/; revision=11512
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-15Convert make-version.pl and the associated cvsversion.h and CVSVERSIONGerald Combs1-5/+5
definition to Subversion. "svn info" prints out the last changed date of the repository, so we don't have to go hunting through "CVS/Entries" files anymore. svn path=/trunk/; revision=11379
2004-07-09Don't complain about "-T pdml" or "-T psml" being combined with "-x"Guy Harris1-4/+6
only if "-x" was specified. svn path=/trunk/; revision=11349
2004-07-08Make the "human-readable text vs. PSML vs. PDML" choice separate fromGuy Harris1-214/+296
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-07-08Fix the error for a WTAP_ERR_UNSUPPORTED_ENCAP read error to moreGuy Harris1-2/+2
accurately reflect the problem (it's not that the entire file has a network type we don't handle - if it did, we'd have failed when we tried to open it - it's that the packet we tried to read does). svn path=/trunk/; revision=11341
2004-06-12On Windows, if "get_interface_list()" returns CANT_GET_INTERFACE_LISTGuy Harris1-7/+14
and the error message includes "Not enough storage is available to process this command" or "The operation completed successfully", suggest that the user install a WinPcap version later than 3.0 - this is definitely a Frequently Asked Question on the Ethereal list. svn path=/trunk/; revision=11143
2004-06-10Move the ring-buffer tests from "process_packet()" toGuy Harris1-58/+48
"capture_pcap_cb()"; they're only done in live captures, and that arranges that "process_packet()" gets called with the correct wtap_dumper for the current file even if we switch to a new file. Move the packet-count reporting out of "write_packet()" to "capture_pcap_cb()" as well, as that's also only done in live captures. That pretty much guts "write_packet()", so just move what's left up to "process_packet()". svn path=/trunk/; revision=11131
2004-05-31Add a routine that indicates where there are any tap listenersGuy Harris1-6/+17
registered (not whether there are any tap *filters* registered). Do dissection in Tethereal iff: we're printing information about each packet; we're using a read filter on the packets; there are any tap listeners registered (even if there are no tap filters registered - not all taps use filters). svn path=/trunk/; revision=11040
2004-05-31Make "-q" suppress packet printing when you're reading a capture fileGuy Harris1-4/+11
and not writing to another capture file, for use with "-z" options. Note that "-z proto" *doesn't* print statistics at the end - it modifies the packet summary output. Note that on at least some BSDs the "status" character is set to "off" by default, so you have to set it explicitly in order to be able to ^T an application such as Tethereal. svn path=/trunk/; revision=11038
2004-05-31Move the packet counting, dissecting, and filtering out of the "writeGuy Harris1-359/+356
packet" and "print packet" callbacks into a common routine, so that we don't count packets twice if we're counting and dissecting. Print the packet count with ^T iff we're not updating a displayed packet count as packets arrive, regardless of whether we're printing packet information, saving packets to a file, or both (tcpdump prints it regardless of whether it's printing packet information or saving packets to a file). svn path=/trunk/; revision=11037
2004-05-09From Lars Roland: add support for building a libethereal.dll with MSVC:Guy Harris1-1/+5
add a config.nmake option to control whether to build libethereal.dll or not; remove "./wiretap" from PATH to prevent problems due to wrongly-loaded files; build dissector.lib with MSVC; move "print.c" and "ps.c" to the dissector helpers, as "print.c" imports variables from packet-frame.c and packet-data.c, which are in libethereal; move "g711.c" out of the dissector helpers, as they're used only by Ethereal in a tap, not in Tethereal or in any dissector; add a .def file for libethereal; arrange to declare global variables exported from libethereal with "__declspec(dllimport)" when building programs that import those variables; update the NSIS installer. Make the "configure" script define ETH_VAR_IMPORT as "extern". svn path=/trunk/; revision=10834
2004-04-24some code cleanup of the printing systemUlf Lamping1-2/+2
svn path=/trunk/; revision=10682
2004-04-22added some options and enhancements to the print output:Ulf Lamping1-1/+2
-ps: added formatting hints for ghostscript, so pdf conversion will be much better -ps: print a thin line at the top and bottom of each page -ps/text: add an option to start a new page for every packet (formfeed) svn path=/trunk/; revision=10660
2004-04-20changed postscript output:Ulf Lamping1-2/+2
reduced print margin to 1/2 inch and font size to 8 point, include filename in page header, wrap too long lines svn path=/trunk/; revision=10652
2004-04-16Add a "report_failure()" routine to allow dissectors to report arbitraryGuy Harris1-8/+18
errors to the user. Use that, rather than "g_warning()", in the Diameter dissector to report errors reading the dictionary. Make the format argument to "simple_dialog()" a "const" pointer. Fix up the read-error message in Tethereal to end with a newline. If a simple dialog is requested before the main window or the capture-control window is popped up, queue it up and pop the queued messages up once the main or capture-control window is displayed. svn path=/trunk/; revision=10616
2004-04-16make print dialog "Packet Format" options somewhat similar to theUlf Lamping1-3/+3
Ethereal panes, thus better understandable svn path=/trunk/; revision=10611
2004-03-23Make "epan_init()" take, as additional arguments, pointers to routinesGuy Harris1-7/+11
that dissectors should call to report file open and read errors, and have "report_open_failure()" and "report_read_failure()" call through those pointers, rather than being defined and exported by the application using libethereal - instead, the application would define those functions and pass pointers to them to 'epan_init()". Move "report_err.h" to the epan directory, as the functions it declares are now part of the libethereal API. svn path=/trunk/; revision=10470