Commit Graph

93 Commits

Author SHA1 Message Date
guy 9fa6429626 Make the "col_data" field in a "column_info" structure a pointer to an
array of "const char *" rather than to an array of "char *", and make
the second argument of "col_set_str()" a "const char *" - there's no
guarantee that "col_data" points to something you're allowed to modify.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12875 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-30 23:42:02 +00:00
guy 593adc3ad4 Move the stuff to handle ASCII <-> EBCDIC conversions to
"epan/charsets.c"; other character set translation code should perhaps
go there as well.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11958 f5534014-38df-0310-8fa8-9805f1628bb7
2004-09-10 22:59:37 +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 377d786c16 Rename "range.c" and "range.h" to "packet-range.c" and "packet-range.h";
they should ultimately be split into files with routines that handle
ranges, which are just subsets of [0,2^32), and packet ranges, which are
subsets of the packet list, possibly specified by a range.

Move them into epan, so they can be used by, for example, utilities that
handle ranges, such editcap.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11890 f5534014-38df-0310-8fa8-9805f1628bb7
2004-09-04 00:53:16 +00:00
obiot 73e2078f86 From Lars Roland: With this patch print.(c/h) and ps.(c/h) don't belong to
the DISSECTOR_SUPPORT_xy files any longer and as a consequence they 
won't be linked into libethereal.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11559 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-29 00:11:14 +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
gram 35a6e092c3 Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11410 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18 18:06:47 +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
ulfl 1497f37607 bugfix: don't try to print data, if tvb is too short
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11318 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-05 16:42:19 +00:00
obiot 6fe90a3308 Add escaping of an apostrophe in XML output.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10760 f5534014-38df-0310-8fa8-9805f1628bb7
2004-05-01 21:04:27 +00:00
ulfl 9df313ade1 add PROTO_ITEM_SET_HIDDEN() and PROTO_ITEM_SET_GENERATED(),
this sets flags for later rendering of the field data


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10752 f5534014-38df-0310-8fa8-9805f1628bb7
2004-05-01 15:15:08 +00:00
gram ab27b9e660 Look for out of bounds data after calling tvb_length_remaining().
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10709 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-26 15:58:33 +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 f8921bc87a PDML output: if a protocol field is invisible,
add the attribute: hide="yes" to the field node


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10626 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-17 09:02:32 +00:00
ulfl 1c7b299105 make print dialog "Packet Format" options somewhat similar to the
Ethereal panes, thus better understandable


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10611 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-16 18:17:48 +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 1530de842b added print output of PDML format
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10606 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-15 19:07:13 +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
sharpe d6fe3b0403 There seems to be a missing #include ... there are still errors, though.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9611 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-09 18:49:31 +00:00
guy 3187a64546 In "get_field_data()", check to make sure the field doesn't run past the
end of the tvbuff.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9501 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-30 23:13:32 +00:00
gram ecd5eca1ff 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".


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9238 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-10 22:52:08 +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
guy 3021965fba "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".


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9210 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-08 21:57:25 +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 89bde6a825 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9171 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-04 10:59:34 +00:00
guy 9ff0d6804d 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9151 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-03 09:28:26 +00:00
guy 55eed0e74a "representation", in an "item_label_t", is now an array, not a pointer,
so "fi->rep->representation" can't be null.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9108 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-27 22:29:52 +00:00
ulfl 3ffdfe6d8f bugfix: removed access violation when using "File/Print Packet".
The label_ptr could be NULL, when calling function print_line


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9099 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-27 17:18:13 +00:00
sahlberg 17110b150f remove another slow GMemChunk from ethereal making ethereal a little bit faster
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9085 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-25 14:07:45 +00:00
guy a56c30396e Make the recent epan/proto.{c,h} change compile.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9075 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-24 22:11:55 +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
jmayer 4ad4caac34 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5932 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-02 23:36:07 +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 79ee4c9393 Fix up a comment.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5748 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-23 23:43:32 +00:00
guy 1a054e4af2 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5739 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-22 22:31:29 +00:00
guy 3f03f75a01 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).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5731 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-22 01:43:57 +00:00
guy f3eada9cf3 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5729 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-22 01:24:23 +00:00
guy e97617d73b 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5728 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-22 00:21:38 +00:00
guy 594d1c92c6 Use common code to print the hex dump as text and PostScript.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5727 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-21 23:52:47 +00:00
guy bb0c4a1e3a Make the hex dump when printing PostScript look the same way it does
when printing plain text.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5726 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-21 23:04:30 +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 81eee4296a 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5441 f5534014-38df-0310-8fa8-9805f1628bb7
2002-05-10 23:20:38 +00:00
guy 49b473eb81 In the tree-printing code, we may be handed a leaf node, so don't
require that "fi->tree_type" be positive.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5084 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-02 05:07:36 +00:00
guy 7fd9e12308 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).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5068 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-01 02:00:53 +00:00