Commit Graph

122 Commits

Author SHA1 Message Date
Martin Mathieson 542913de9d When generating PDML, insert a fake protocol wrapper around top-level field items. This is to help preserve the PDML schema, and is discussed in bug 2226.
svn path=/trunk/; revision=24281
2008-02-07 11:45:30 +00:00
Stig Bjørlykke 47d744b59d More rewrite of prohibited APIs (sprintf, strcpy, strcat).
svn path=/trunk/; revision=24258
2008-02-03 15:38:20 +00:00
Guy Harris c856acafbd Clean up indentation.
Move some comments to make it a bit clearer what each branch of the if
handles.

svn path=/trunk/; revision=24161
2008-01-22 04:59:59 +00:00
Sake Blok 531879ad82 When using -T fields, print a "1" instead of nothing when a field of type FT_NONE is
present. This way, scripts can check for the presence of this type of fields.

(fixes bug 2210)


svn path=/trunk/; revision=24158
2008-01-22 00:56:55 +00:00
Martin Mathieson 432354c001 Don't write closing PDML tag for Data protocol - it uses simple (self-closing) tags.
Fixes bug 2185.

svn path=/trunk/; revision=24069
2008-01-12 00:34:17 +00:00
Stephen Fisher 8fd3ee0560 Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it.


svn path=/trunk/; revision=21253
2007-03-28 21:55:11 +00:00
Stephen Fisher 509883e3e9 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).


svn path=/trunk/; revision=21211
2007-03-26 20:17:05 +00:00
Stephen Fisher 2896811274 Fix about 150 warnings new to gcc 4.0 in the error on warning directories.
Comment out -Werror in plugins/asn1/ until warnings can be fixed.


svn path=/trunk/; revision=21158
2007-03-23 22:49:23 +00:00
Martin Mathieson 997e5415f9 Add separate union entries to fvalue.value for signed and unsigned
32-bit numbers.  Separate signed and unsigned accessors have been
added and used where appropriate.

Definitely not for 0.99.5.

svn path=/trunk/; revision=20472
2007-01-18 11:02:26 +00:00
Guy Harris d3fed959bc Have separate proto_construct_match_selected_string() and
proto_can_match_selected() routines, to more clearly separate the two
functions - but have them both call the same underlying routine, so
they both make the same decisions as to whether a match-selected string
can be constructed or not.

svn path=/trunk/; revision=19976
2006-11-24 18:25:23 +00:00
Guy Harris 37a6c02697 Rename proto_construct_dfilter_string() to
proto_construct_match_selected_string() to indicate what it does - and
have it return a Boolean indication of whether the string could be
built, returning the string through a pointer, and, if that pointer is
null, have it just return the Boolean and not construct the string.

Get rid of proto_can_match_selected() -
proto_construct_match_selected_string() can be used for that, which
means we have only one piece of code that knows whether a "match
selected" string can be constructed or not.

Have proto_construct_match_selected_string() support matching
zero-length FT_NONE (and FT_PCRE, but that shouldn't happen) fields even
if there's no epan_dissect_t, as such a match just checks whether the
field is present.

svn path=/trunk/; revision=19967
2006-11-23 21:16:46 +00:00
Guy Harris 0fe89db102 Revert the previous changes - the problem Paul Blankenbaker was fixing
was really a problem with bytes_repr_len() and zero-length FT_BYTES
fields, and it's not clear what to do about fields that have zero
length.  (Put in a comment about that.)

Clean up indentation a bit.

svn path=/trunk/; revision=19864
2006-11-07 21:04:41 +00:00
Guy Harris 4c2f1f7ccb Based on a change from Paul Blankenbaker, make the "show" attribute for
a field an empty string if the field is zero-length; for some reason,
the existing code doesn't handle that correctly.

Also, the NetPDL Visualization Extension:

	http://www.nbee.org/Docs/NetPDL/NetPDLVisualization.htm

seems to imply that "value" has to be present, so display it even if the
field is zero-length.

svn path=/trunk/; revision=19862
2006-11-07 19:49:58 +00:00
Martin Mathieson 268f9c37d6 Fix for (already-closed) bug 1180
svn path=/trunk/; revision=19737
2006-10-30 09:50:39 +00:00
Jaap Keuter 4875880d84 Fix bug 1173, remove the space after the comma in CSV lines
svn path=/trunk/; revision=19660
2006-10-22 14:28:54 +00:00
Martin Mathieson 86e32d4b90 Remove extra double quote from fix to bug 1110
svn path=/trunk/; revision=19347
2006-09-28 09:27:28 +00:00
Martin Mathieson 9a47cb27c7 Fix PDML export problem for FT_NONE fields (bug 1110)
svn path=/trunk/; revision=19334
2006-09-27 09:48:42 +00:00
Ulf Lamping 962bf89b4a print generated items in brackets [], just as we do it on the screen
svn path=/trunk/; revision=18783
2006-07-22 11:29:17 +00:00
Anders Broman f68d6e4c8c Ethereal->Wireshark
svn path=/trunk/; revision=18235
2006-05-28 20:28:20 +00:00
Ronnie Sahlberg f0b33a4789 ethereal->wireshark updates
svn path=/trunk/; revision=18206
2006-05-22 08:14:01 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ulf Lamping c3187174bf replace *a lot* of file related calls by their GLib counterparts. This is necessary for the switch to GTK 2.6 (at least on WIN32).
to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place.

deleted related things from config.h.win32

As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon.

svn path=/trunk/; revision=16403
2005-11-06 22:43:25 +00:00
Gerald Combs 4ba7a9a429 In print_hex_data(), bail out early if our length is zero.
svn path=/trunk/; revision=15088
2005-07-26 15:28:39 +00:00
Jörg Mayer 30a8557868 More 'char*' -> 'const char*' changes to fix warnings.
svn path=/trunk/; revision=15015
2005-07-23 11:41:25 +00:00
Gilbert Ramirez 06dda2e83e Put 'unmaskedvalue' field in XML for bit-masked values.
Fix interpretation of 'value' field.
Patch from Vasanth Manickam.

svn path=/trunk/; revision=14505
2005-05-31 14:07:16 +00:00
Ulf Lamping 801e9dd35e from Stefano Pettini: add CSV export function, similar to PSML export
svn path=/trunk/; revision=13724
2005-03-11 20:56:31 +00:00
Lars Roland f3294ee49a change nmake makefiles in /trunk and /trunk/epan so that
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-13 00:10:15 +00:00
Guy Harris 93426174ef 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.

svn path=/trunk/; revision=13240
2005-02-02 10:28:51 +00:00
Ronnie Sahlberg b4d53ed380 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.



svn path=/trunk/; revision=13236
2005-02-02 08:50:40 +00:00
Guy Harris 467e33d1b1 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.

svn path=/trunk/; revision=12875
2004-12-30 23:42:02 +00:00
Guy Harris ac982aa7a5 Move the stuff to handle ASCII <-> EBCDIC conversions to
"epan/charsets.c"; other character set translation code should perhaps
go there as well.

svn path=/trunk/; revision=11958
2004-09-10 22:59:37 +00:00
Guy Harris f06c1b5fb0 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.)

svn path=/trunk/; revision=11898
2004-09-04 20:02:11 +00:00
Guy Harris 478ba9a691 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.

svn path=/trunk/; revision=11890
2004-09-04 00:53:16 +00:00
Olivier Biot a11651260b 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.

svn path=/trunk/; revision=11559
2004-07-29 00:11:14 +00:00
Guy Harris d03b6c614a "print_packet_header()" is no longer used (there's now a "generate
bookmark" op in the lower-level print functions), so remove it.

svn path=/trunk/; revision=11543
2004-07-27 19:19:00 +00:00
Guy Harris 5a3ab160c1 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.

svn path=/trunk/; revision=11514
2004-07-25 08:53:38 +00:00
Gilbert Ramirez 669db206cb 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.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +00:00
Guy Harris 8a8b883450 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.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Guy Harris b650d01031 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).

svn path=/trunk/; revision=11342
2004-07-08 10:36:29 +00:00
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