Commit Graph

83 Commits

Author SHA1 Message Date
Ulf Lamping 97c4ef6cfb bugfix: don't try to print data, if tvb is too short
svn path=/trunk/; revision=11318
2004-07-05 16:42:19 +00:00
Olivier Biot e163f38b43 Add escaping of an apostrophe in XML output.
svn path=/trunk/; revision=10760
2004-05-01 21:04:27 +00:00
Ulf Lamping d9118dc089 add PROTO_ITEM_SET_HIDDEN() and PROTO_ITEM_SET_GENERATED(),
this sets flags for later rendering of the field data

svn path=/trunk/; revision=10752
2004-05-01 15:15:08 +00:00
Gilbert Ramirez c94e9b9687 Look for out of bounds data after calling tvb_length_remaining().
svn path=/trunk/; revision=10709
2004-04-26 15:58:33 +00:00
Ulf Lamping 1531315c18 some code cleanup of the printing system
svn path=/trunk/; revision=10682
2004-04-24 23:13:46 +00:00
Ulf Lamping 51f987e04f 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)

svn path=/trunk/; revision=10660
2004-04-22 17:03:21 +00:00
Ulf Lamping 91e61df84e 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

svn path=/trunk/; revision=10652
2004-04-20 22:34:08 +00:00
Ulf Lamping f4564cf6aa added PSML output to the printing dialog
svn path=/trunk/; revision=10628
2004-04-17 11:50:14 +00:00
Ulf Lamping 667d4eecd9 PDML output: if a protocol field is invisible,
add the attribute: hide="yes" to the field node

svn path=/trunk/; revision=10626
2004-04-17 09:02:32 +00:00
Ulf Lamping 8c42aa51f7 make print dialog "Packet Format" options somewhat similar to the
Ethereal panes, thus better understandable

svn path=/trunk/; revision=10611
2004-04-16 18:17:48 +00:00
Ulf Lamping d9fcc8e05a added print output option, to suppress dissection completely
(for raw packet hexdump)

svn path=/trunk/; revision=10607
2004-04-15 19:56:15 +00:00
Ulf Lamping 77f9354bf7 added print output of PDML format
svn path=/trunk/; revision=10606
2004-04-15 19:07:13 +00:00
Guy Harris 7502ac216a 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.

svn path=/trunk/; revision=9828
2004-01-25 00:58:13 +00:00
Guy Harris 65f18bb833 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.

svn path=/trunk/; revision=9825
2004-01-24 10:53:25 +00:00
Richard Sharpe 5bff5db487 There seems to be a missing #include ... there are still errors, though.
svn path=/trunk/; revision=9611
2004-01-09 18:49:31 +00:00
Guy Harris 33709f95b9 In "get_field_data()", check to make sure the field doesn't run past the
end of the tvbuff.

svn path=/trunk/; revision=9501
2003-12-30 23:13:32 +00:00
Gilbert Ramirez a92bb0da45 Analyzer's PDML will be changed to start the packet offset (the "pos" field)
at 0 instead of 1. This works better for Ethereal, as our offsets start
at 0. Change the "geninfo" pseudo-protocol to use pos="0" instead of
pos="1".

svn path=/trunk/; revision=9238
2003-12-10 22:52:08 +00:00
Ulf Lamping 892700e893 print system enhanced, more print ranges and expanded states
svn path=/trunk/; revision=9222
2003-12-09 22:27:28 +00:00
Guy Harris 0519141ac9 "proto_construct_dfilter_string()" can return a null pointer, e.g. for
protocol tree fields that don't have values and that are zero-length.

Combine the "if (fi->hfinfo->type != FT_PROTOCOL && fi->length > 0)"
stuff to show the raw value into the previous "if".

svn path=/trunk/; revision=9210
2003-12-08 21:57:25 +00:00
Gilbert Ramirez 058ef64db8 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

svn path=/trunk/; revision=9180
2003-12-06 06:09:13 +00:00
Guy Harris f0b9d12b6a Don't use GNodes for the protocol tree, put the sibling pointer, and
pointers to the first *and* last child, in the "proto_node" structure
itself.  That saves us one level of indirection and memory allocation,
and lets us append to a tree by appending to the last child directly,
rather than having to scan through the list of siblings of the first
child to find the end of that list.

svn path=/trunk/; revision=9171
2003-12-04 10:59:34 +00:00
Guy Harris dcd98ae8d3 The "ptr_u" unions no longer have a "next" pointer - they now just have
one member - or have one that's not used, so get rid of those unions.

svn path=/trunk/; revision=9151
2003-12-03 09:28:26 +00:00
Guy Harris d33d06d9a9 "representation", in an "item_label_t", is now an array, not a pointer,
so "fi->rep->representation" can't be null.

svn path=/trunk/; revision=9108
2003-11-27 22:29:52 +00:00
Ulf Lamping ba2b942138 bugfix: removed access violation when using "File/Print Packet".
The label_ptr could be NULL, when calling function print_line

svn path=/trunk/; revision=9099
2003-11-27 17:18:13 +00:00
Ronnie Sahlberg 9d88e58e51 remove another slow GMemChunk from ethereal making ethereal a little bit faster
svn path=/trunk/; revision=9085
2003-11-25 14:07:45 +00:00
Guy Harris 122dd3959c Make the recent epan/proto.{c,h} change compile.
svn path=/trunk/; revision=9075
2003-11-24 22:11:55 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Guy Harris 7dc9756921 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.

svn path=/trunk/; revision=5798
2002-06-29 09:45:06 +00:00
Guy Harris 2cf14082d6 Fix up a comment.
svn path=/trunk/; revision=5748
2002-06-23 23:43:32 +00:00
Guy Harris 11f786daee Display as many digits of the offset, in the hex dump, as would be
required by the largest offset value.

Get rid of trailing blanks in hex dump lines.

svn path=/trunk/; revision=5739
2002-06-22 22:31:29 +00:00
Guy Harris a7c8b73bdf Use a common routine to print protocol tree nodes as text or PostScript,
rather than having duplicate routines (the PostScript one was missing
some bug fixes in the text one).

svn path=/trunk/; revision=5731
2002-06-22 01:43:57 +00:00
Guy Harris 567aac9787 Get rid of separate "print_hex_data_text()" and "print_hex_data_ps()"
routines; instead, rename "print_hex_data_common()" to
"print_hex_data_buffer()" as it prints a buffer in hex and ASCII (or
EBCDIC), and have it take the print format as an argument.

Have it use "print_line()" to print lines, and fix "print_line()" so
that it prints a buffer *without* a newline at the end, printing the
newline itself.

svn path=/trunk/; revision=5729
2002-06-22 01:24:23 +00:00
Guy Harris 0a88caf96a In the hex dump, generate the offset at the beginning of each line in
common code, rather than in print-format-specific code, and have
"print_hex_data_common()" put out the blank line before the dump itself
rather than relying on the print-format-specific "start printing the hex
dump" code to do it.

svn path=/trunk/; revision=5728
2002-06-22 00:21:38 +00:00
Guy Harris b2277c9cfc Use common code to print the hex dump as text and PostScript.
svn path=/trunk/; revision=5727
2002-06-21 23:52:47 +00:00
Guy Harris 9e92272188 Make the hex dump when printing PostScript look the same way it does
when printing plain text.

svn path=/trunk/; revision=5726
2002-06-21 23:04:30 +00:00
Guy Harris 392a7dfc04 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".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +00:00
Guy Harris ae88c45ef0 From Joerg Mayer: make a pile of stuff not used outside one source file
static, and add a new "packet-data.h" to declare "proto_data".

Display escape sequences in octal in the IAPP dissector, as is now done
in the RADIUS dissector.

svn path=/trunk/; revision=5441
2002-05-10 23:20:38 +00:00
Guy Harris 5f948e482c In the tree-printing code, we may be handed a leaf node, so don't
require that "fi->tree_type" be positive.

svn path=/trunk/; revision=5084
2002-04-02 05:07:36 +00:00
Guy Harris 5de2533f2d Start assigning ett_ values at 0, rather than 1; get rid of the reserved
ETT_NONE entry.

Initialize the "tree_type" field of a "field_info" structure to -1,
meaning "this has not been given a subtree".  Add checks before using
that field that it's in range.  That way, you have to create a subtree
before putting protocol tree items under another item.

We allocate the "tree_is_expanded" array when we've registered all
dissectors; there's no need to allocate it while we're registering
dissectors and, in fact, doing so means we leak memory (the memory for
the version we allocated while registering dissectors).

svn path=/trunk/; revision=5068
2002-04-01 02:00:53 +00:00
Guy Harris 63e8447614 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.

svn path=/trunk/; revision=5050
2002-03-31 20:57:02 +00:00
Guy Harris 435545629a Boost the maximum amount of indentation put into text output.
svn path=/trunk/; revision=4939
2002-03-14 05:41:59 +00:00
Guy Harris 6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +00:00
Guy Harris 31fc804847 From Joerg Mayer: remove trailing blanks from hex dump in
print/Tethereal.

svn path=/trunk/; revision=4742
2002-02-15 11:56:10 +00:00
Guy Harris ee5ca25d31 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/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +00:00
Gilbert Ramirez e1dc772471 Use new, correct method for retrieving field_info* from a proto_item*
(aka GNode*).

svn path=/trunk/; revision=4423
2001-12-18 21:31:02 +00:00
Gilbert Ramirez f14a6b8b91 Hopefully the last time I have to change my e-mail address.
svn path=/trunk/; revision=4199
2001-11-13 23:55:44 +00:00
Guy Harris b9222c0011 Various signed vs. unsigned fixes, from Joerg Mayer.
svn path=/trunk/; revision=3560
2001-06-18 01:49:17 +00:00
Guy Harris e52dd802c4 We only need to print the data corresponding to the field, so fetch only
that data with a "tvb_get_ptr()".

svn path=/trunk/; revision=3532
2001-06-08 10:07:55 +00:00
Guy Harris 2da9bb2696 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.

svn path=/trunk/; revision=3531
2001-06-08 08:50:51 +00:00