Commit Graph

60 Commits

Author SHA1 Message Date
wmeier d37518d7ce Add #include <stdio.h> to print.h; Undo the previous change to about_dlg.c
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29575 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-26 23:24:22 +00:00
sake a823a0edb2 Add some more "copy" functionality:
- Enabled "Copy Description" in the main menu and gave it
  accelerator key CTRL+SHIFT+D

- Added "Copy Fieldname" to copy the fieldname of the selected
  field in the detail view (Acc.Key: CTRL+SHIFT+F)

- Added "Copy Value" to copy the value of the selected
  field in the detail view (Acc.Key: CTRL+SHIFT+V)

- Updated documentation to reflect the changes




git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28006 f5534014-38df-0310-8fa8-9805f1628bb7
2009-04-08 18:32:11 +00:00
stig 4ce68c634f From Francesco Fondelli (bug 2349):
Attached is a patch to export packets data as "C Arrays".  I often have
the need to [re]send data captured with wireshark using a raw/pf_packet socket.
Output format is one char[] per packet, it looks like almost the same as
the one produced by "Follow TCP stream".


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24604 f5534014-38df-0310-8fa8-9805f1628bb7
2008-03-11 18:23:16 +00:00
jmayer 36ed078ea1 Warning fix
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21242 f5534014-38df-0310-8fa8-9805f1628bb7
2007-03-28 04:29:00 +00:00
sfisher 8a9397ff06 From Doug Pratley:
The purpose of the patch is to provide a new output format (so it is
independent of -V): single line record per-packet with the fields chosen by the
user, with configuration options to control separator, quoting and whether a
header line is printed. It also extends some existing options behaviour (-c and
-a:filesize) so that they affect reading a file as well as writing one, so that
only the first <n> packets or bytes are read).



git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21211 f5534014-38df-0310-8fa8-9805f1628bb7
2007-03-26 20:17:05 +00:00
sahlberg 33270db64f name change
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18197 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-21 05:12:17 +00:00
ulfl 7570f99027 from Stefano Pettini: add CSV export function, similar to PSML export
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13724 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-11 20:56:31 +00:00
guy 8e39c0d2ce Writing the raw data of a TCP stream to a file isn't printing it, so
don't use the print mechanism for that - do the writing directly in the
"follow stream" code.

Use "size_t" for character counts.

Make the "hexchars" array static and const, as it's not written to, and
there's probably no point in copying it to the stack (unless that
improves cache locality).

There's no need to explain why we're subtracting the number of bytes
actually read, rather than the number of bytes asked for, from the data
length.

Note an issue with printing lines.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13240 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-02 10:28:51 +00:00
sahlberg 99c449f5a6 from chris eagle
add radiobutton to allow saving raw tcpstreams


these radiobuttons should, by someone that uses, this feature be changed into
a menu instead.




git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13236 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-02 08:50:40 +00:00
guy 0c36d8ab06 The packet range stuff knows about capture_file structures, so it's
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.)


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11898 f5534014-38df-0310-8fa8-9805f1628bb7
2004-09-04 20:02:11 +00:00
guy 991faed5fb Move the code to open the printer/print file from "print_packets()" to
"print_ok_cb()", and have "print_packets()" just work on a
"print_stream_t" handed to it, so that different platforms can open the
printer/print file in different ways (opening the file is probably not
going to be platform-dependent, but opening the printer will be).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11544 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-27 20:10:02 +00:00
guy d9b7597974 "print_packet_header()" is no longer used (there's now a "generate
bookmark" op in the lower-level print functions), so remove it.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11543 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-27 19:19:00 +00:00
guy d95dbfa29f Make some generic print routines that take, as an argument, a pointer to
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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11514 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-25 08:53:38 +00:00
jmayer fd7d494b41 Trivial warning fixes:
- comma at end of enum
- function declarations with empty args instead of void
- c++ style comments


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11492 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-23 23:28:08 +00:00
guy 0f43797234 Set the svn:eol-style property on all text files to "native", so that
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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18 00:24:25 +00:00
guy b7011b10bc Make the "human-readable text vs. PSML vs. PDML" choice separate from
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).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11342 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-08 10:36:29 +00:00
guy 7b627e9908 From Lars Roland: add support for building a libethereal.dll with MSVC:
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".


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10834 f5534014-38df-0310-8fa8-9805f1628bb7
2004-05-09 10:03:41 +00:00
ulfl 7862ca6700 put all required data into the print_args,
instead of confusing seperation of data


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10692 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-25 12:04:08 +00:00
ulfl d938b23383 some code cleanup of the printing system
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10682 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-24 23:13:46 +00:00
ulfl 6e43e56a76 added some options and enhancements to the print output:
-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)


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10660 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-22 17:03:21 +00:00
ulfl 10f80b0c4b changed postscript output:
reduced print margin to 1/2 inch and font size to 8 point,
include filename in page header,
wrap too long lines


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10652 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-20 22:34:08 +00:00
ulfl b1b964ddb8 added PSML output to the printing dialog
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10628 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-17 11:50:14 +00:00
ulfl 879148b449 added print output option, to suppress dissection completely
(for raw packet hexdump)


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10607 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-15 19:56:15 +00:00
ulfl c8d881ff66 comment changed
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10133 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-20 17:27:16 +00:00
guy c2eca192d5 There's no need to keep a "FILE *" for the file being printed to in a
"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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9828 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-25 00:58:13 +00:00
guy 484071c232 As with "file_write_error_message()", so with
"file_close_error_message()" - but just use "file_write_error_message()"
for UNIX-style errors, under the assumption that a close will only fail
because a buffer-flushing write fails or because "close()" itself fails
when, for example, pushing unsynced NFS client-side writes out over the
wire.

Make several routines in "print.c" return success/failure indications.

Check for write errors when printing "Follow TCP Stream" stuff or saving
it to a file.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9825 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-24 10:53:25 +00:00
ulfl 69b241f708 use the same packet range things for "Print" dialog, as already implemented
in the "Save As" dialog and some other minor changes


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9610 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-09 18:11:21 +00:00
ulfl e46e33402b print system enhanced, more print ranges and expanded states
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9222 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-09 22:27:28 +00:00
ulfl fff19576ae print system enhanced, more print ranges and expanded states
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9221 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-09 22:04:57 +00:00
gram ef3e90ad63 Add the ability to print packet dissections in PDML (an XML-based format)
to tethereal. It could be added to Ethereal, but the GUI changes to
allow the user to select PDML as a print format have not been added.

Provide a python module (EtherealXML.py) to help parse PDML.

Provide a sample app (msnchat) which uses tethereal and EtherealXML.py
to reconstruct MSN Chat sessions from packet capture files. It produces
a nice HTML report of the chat sessions.

Document tethereal's PDML and EtherealXML.py usage in doc/README.xml-output

Update tethereal's manpage to reflect the new [-T pdml|ps|text] option


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9180 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-06 06:09:13 +00:00
guy a3b9518a4c When saving packets, we have a "Save only marked packets" option; label
the option to print only marked packets similarly, rather than as
"Suppress unmarked packets" (for consistency, and because the latter
isn't unlike a double negative).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8451 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-10 22:23:58 +00:00
jmayer 68cedde616 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28 21:04:11 +00:00
guy bbbff2f61f Have "print_line()" take an indentation argument, and do blank
padding when printing text and use "putline" when printing PostScript.
Eliminate "hexdump", as it's just a special case of "putline".

Have "proto_tree_print_node()" just call "print_line()".

Get rid of "print_ps_hex()" - the font used for the hex dump and the
protocol tree are the same, so there's no need to switch fonts.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5798 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-29 09:45:06 +00:00
guy 27840b016e Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5614 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-04 07:03:57 +00:00
guy 3851842dbc From Joerg Mayer: get rid of unused arguments, and mark those that can't
be eliminated (because the function is called through a pointer, and
other functions called through the same pointer *do* use the argument)
as unused.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5050 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-31 20:57:02 +00:00
guy 5904f05078 Include files from the "epan" directory and subdirectories thereof with
"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/").


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4586 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-21 07:37:49 +00:00
gram e512a297a1 Hopefully the last time I have to change my e-mail address.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4199 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-13 23:55:44 +00:00
hagbard 61a61b213b Added a "Suppress Unmarked" option to the print dialog to
allow you to suppress the printing of unmarked packets.
This allows a user to mark the packets they wish to print and
print ONLY those packets by suppressing all other unmarked packets.

This may seem like a bit of a convoluted way of expressing things,
as usually the desired behavior would be to print the marked packets.
However, we do NOT print marked packets that are not displayed under
the current filter.  To be maximally explicite I've expressed this
as suppressing unmarked frames.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3736 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-17 05:32:44 +00:00
guy 778c54f74a When printing the contents of a raw-data field, don't use the raw data
of the current frame as the source, use the raw data of the tvbuff
that's the data source of that field.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3531 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-08 08:50:51 +00:00
jfoster d45a52e662 Added named data sources printing support, written by Guy Harris
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3167 f5534014-38df-0310-8fa8-9805f1628bb7
2001-03-23 18:44:20 +00:00
deniel 039a59eeca Miscellaneous code cleaning
- 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).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2254 f5534014-38df-0310-8fa8-9805f1628bb7
2000-08-11 13:37:21 +00:00
gram a6dd8429f2 Add a "Save As" feature to the TCP Follow dialogue, to save the stream
file to a user-specified file.

Move the file-copy routine in save_cap_file() to an indepenent
function in file.c  (copy_binary_file()) so that follow_dlg.c can use it.

Remove #include "follow.h" from the C files that don't need it.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2200 f5534014-38df-0310-8fa8-9805f1628bb7
2000-08-03 12:44:40 +00:00
guy e8808ef879 Fix files that had Gilbert's old e-mail address or that didn't have my
forwarding e-mail address.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1522 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-22 06:22:44 +00:00
guy 5216b3db8e "print_file()" is no longer used; nuke it.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1430 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-07 00:36:25 +00:00
guy 23eeee2bcf Printing multiple pages of PostScript wasn't as tricky as I thought; add
support for printing in PostScript to the "Print..." dialog box.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1426 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-06 07:33:35 +00:00
gram 4564f849c6 A "character encoding" variable is now set per packet. The existence
of SNA in a packet changes the character encoding from the default ASCII
to EBCDIC.

The hex-printing routines in the GUI code and in the printing code convert
to EBCDIC if appropriate.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1089 f5534014-38df-0310-8fa8-9805f1628bb7
1999-11-22 06:24:56 +00:00
guy 79f17949d5 Warren Young's patch to add a "Print" button to the "Follow TCP Stream"
data window.

Some (belated) man page updates.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@950 f5534014-38df-0310-8fa8-9805f1628bb7
1999-10-30 06:42:10 +00:00
guy d0dea2faa8 Add an item to the "File/Print" dialog box to ask that the full hex data
of the packet be printed (this is only done if "Print detail" is
selected; it should be grayed out of "Print summary" is selected).

If that item is selected, suppress the hex printing of uninterpreted
data items in the protocol tree.

Move some GTK+ keys not used outside of "gtk/print_dlg.c" from
"gtk/keys.h" into "gtk/print_dlg.c".


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@736 f5534014-38df-0310-8fa8-9805f1628bb7
1999-09-29 22:19:24 +00:00
guy fe08f3953e Add a "Expand all levels"/"Print as displayed" pair of radio buttons to
the "File/Print" dialog box; "Expand all levels" means that all levels
of the protocol tree should be printed, while "Print as displayed" means
that only those levels shown in the display should be printed.

Free the table of column widths once printing is done.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@671 f5534014-38df-0310-8fa8-9805f1628bb7
1999-09-12 20:23:43 +00:00
guy 1152065a8c Add summary-vs-detail radio buttons to the print dialog box; detail
prints the protocol tree, and summary prints the fields in the summary
clist, with a header line at the beginning of the printout.

Print only packets selected by the current packet filter.

Just have "ARP" and "RARP" in the "Protocol" field for ARP packets;
whether it's a request or a reply can be seen in the "Info" field.

Add to the "Frame" section of the protocol tree the time between the
current packet and the previous displayed packet, and the packet number.
Have FT_RELATIVE_TIME fields be a "struct timeval", and display them as
seconds and fractional seconds (we didn't have any fields of that type,
and that type of time fits the delta time above).

Add an FT_DOUBLE field type (although we don't yet have anything using
it).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@666 f5534014-38df-0310-8fa8-9805f1628bb7
1999-09-12 06:11:51 +00:00