aboutsummaryrefslogtreecommitdiffstats
path: root/print.c
AgeCommit message (Collapse)AuthorFilesLines
2002-06-29Have "print_line()" take an indentation argument, and do blankGuy Harris1-44/+35
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-23Fix up a comment.Guy Harris1-5/+4
svn path=/trunk/; revision=5748
2002-06-22Display as many digits of the offset, in the hex dump, as would beGuy Harris1-9/+56
required by the largest offset value. Get rid of trailing blanks in hex dump lines. svn path=/trunk/; revision=5739
2002-06-22Use a common routine to print protocol tree nodes as text or PostScript,Guy Harris1-77/+33
rather than having duplicate routines (the PostScript one was missing some bug fixes in the text one). svn path=/trunk/; revision=5731
2002-06-22Get rid of separate "print_hex_data_text()" and "print_hex_data_ps()"Guy Harris1-71/+42
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-22In the hex dump, generate the offset at the beginning of each line inGuy Harris1-25/+19
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-21Use common code to print the hex dump as text and PostScript.Guy Harris1-63/+72
svn path=/trunk/; revision=5727
2002-06-21Make the hex dump when printing PostScript look the same way it doesGuy Harris1-6/+6
when printing plain text. svn path=/trunk/; revision=5726
2002-06-04Get rid of the "data_src" member of the "frame_data" structure; put itGuy Harris1-15/+22
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-05-10From Joerg Mayer: make a pile of stuff not used outside one source fileGuy Harris1-4/+2
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-04-02In the tree-printing code, we may be handed a leaf node, so don'tGuy Harris1-5/+7
require that "fi->tree_type" be positive. svn path=/trunk/; revision=5084
2002-04-01Start assigning ett_ values at 0, rather than 1; get rid of the reservedGuy Harris1-1/+2
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-03-31From Joerg Mayer: get rid of unused arguments, and mark those that can'tGuy Harris1-2/+2
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-14Boost the maximum amount of indentation put into text output.Guy Harris1-5/+7
svn path=/trunk/; revision=4939
2002-02-18Don't give tvbuffs names; instead, give data sources names, where aGuy Harris1-11/+15
"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-15From Joerg Mayer: remove trailing blanks from hex dump inGuy Harris1-2/+2
print/Tethereal. svn path=/trunk/; revision=4742
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-3/+3
"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
2001-12-18Use new, correct method for retrieving field_info* from a proto_item*Gilbert Ramirez1-3/+3
(aka GNode*). svn path=/trunk/; revision=4423
2001-11-13Hopefully the last time I have to change my e-mail address.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=4199
2001-06-18Various signed vs. unsigned fixes, from Joerg Mayer.Guy Harris1-3/+3
svn path=/trunk/; revision=3560
2001-06-08We only need to print the data corresponding to the field, so fetch onlyGuy Harris1-14/+11
that data with a "tvb_get_ptr()". svn path=/trunk/; revision=3532
2001-06-08When printing the contents of a raw-data field, don't use the raw dataGuy Harris1-9/+44
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-05-16Added 'text2pcap', a utility to convert text hexdumps into pcapAshok Narayanan1-6/+6
files. See text2pcap.1 (built from doc/text2pcap.pod) for details. Changed 'tethereal -x' output to match hex dump format of text2pcap, Ethereal and others. svn path=/trunk/; revision=3421
2001-03-24Always hand "print_line()" a string that ends with "\n".Guy Harris1-3/+2
svn path=/trunk/; revision=3184
2001-03-24Put a blank line before the line identifying the data source for theGuy Harris1-1/+2
data being dumped. svn path=/trunk/; revision=3183
2001-03-23Added named data sources printing support, written by Guy HarrisJeff Foster1-7/+36
svn path=/trunk/; revision=3167
2000-04-13Consolidate flags in struct frame_data, and add "visited" flag. UseGilbert Ramirez1-2/+2
it in SOCKS dissector. (Okay, how many times am I going to modify packet.h today, forcing you to re-compile everything? :-) svn path=/trunk/; revision=1850
2000-01-22Fix files that had Gilbert's old e-mail address or that didn't have myGuy Harris1-2/+2
forwarding e-mail address. svn path=/trunk/; revision=1522
2000-01-07"print_file()" is no longer used; nuke it.Guy Harris1-48/+11
svn path=/trunk/; revision=1430
2000-01-06Printing multiple pages of PostScript wasn't as tricky as I thought; addGuy Harris1-23/+40
support for printing in PostScript to the "Print..." dialog box. svn path=/trunk/; revision=1426
1999-12-10Move GTK code out of summary.c and into gtk/summary_dlg.cGilbert Ramirez1-2/+1
summary.c now provides a struct of info (see summary.h) Changed the name of the summary dialogue callback (hence the change in menu.c), and added a close button to the dialogue. Moved #include <gtk/gtk.h> out of print.c and into prefs.h where it was needed for GdkColor. svn path=/trunk/; revision=1273
1999-11-22Include "util.h" to get the declaration of "EBCDIC_to_ASCII1()".Guy Harris1-1/+2
svn path=/trunk/; revision=1091
1999-11-22A "character encoding" variable is now set per packet. The existenceGilbert Ramirez1-7/+20
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. svn path=/trunk/; revision=1089
1999-10-30Warren Young's patch to add a "Print" button to the "Follow TCP Stream"Guy Harris1-1/+39
data window. Some (belated) man page updates. svn path=/trunk/; revision=950
1999-09-29Add an item to the "File/Print" dialog box to ask that the full hex dataGuy Harris1-12/+15
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". svn path=/trunk/; revision=736
1999-09-12Add a "Expand all levels"/"Print as displayed" pair of radio buttons toGuy Harris1-11/+17
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. svn path=/trunk/; revision=671
1999-09-12Add summary-vs-detail radio buttons to the print dialog box; detailGuy Harris1-13/+3
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). svn path=/trunk/; revision=666
1999-09-09More shuffling of GTK-related files to gtk subdirectory.Gilbert Ramirez1-2/+1
svn path=/trunk/; revision=635
1999-09-01Moved GTK-dependent routines for file dialogues, print dialogues, printGilbert Ramirez1-205/+3
preferences, and menus to gtk subdirectory. svn path=/trunk/; revision=623
1999-07-23Printing multiple frames in PostScript is a bit tricky, I think - IGuy Harris1-6/+32
think I may have to worry about page boundaries and the like - so, for now, we make the "File/Print..." stuff print only as text. ("Print Packet" can still print PostScript, as always.) We clean up a few text vs. PostScript things for printing multiple frames, but it's still not ready for prime time. svn path=/trunk/; revision=383
1999-07-23Fix "open_print_dest()" to do the right thing.Guy Harris1-4/+2
svn path=/trunk/; revision=379
1999-07-23Add a "File/Print" menu item, which prints *all* the packets in theGuy Harris1-23/+22
capture to a file or printer. This should eventually get the ability to print either all the packets or only the packets selected by the display filter, and possibly also the ability to print only packets M through N. Get rid of "cur" member of "capture_file" structure; nobody used it. There's no need to pass a pointer to a "dialog_button" variable to "simple_dialog()" for the error boxes displayed if a file copy or move fails; that dialog box is just a message box and has only an "OK" button. Put the declaration of "prefs" into "prefs.h". svn path=/trunk/; revision=378
1999-07-15Modified the proto_register_field_array usage again. Thanks to Guy'sGilbert Ramirez1-7/+6
suggestion, this new method using a static array should use less memory and be faster. It also has a nice side-effect of making the source-code more readble, IMHO. Changed the print routines to look for protocol proto_data instead of looking at the text label as they did before, hoping that the data hex dump field item starts with "Data (". Added the -G keyword to ethereal to make it dump a glossary of display filter keywords to stdout and exit. This data is then formatted with the doc/dfilter2pod perl program to pod format, which is combined with doc/ethereal.pod.template to create doc/ethereal.pod, from which the ethereal manpage is created. This way we can keep the manpage up-to-date with a list of fields that can be filtered on. svn path=/trunk/; revision=364
1999-07-13When printing a packet, do it from the protocol tree, not from the GTK+Guy Harris1-111/+123
tree constructed from the protocol tree: 1) The value of "level" field of GTK+ tree items appears to depend on various random things - see a change I made to "packet-dns.c" a while ago, to change the order in which items were put in the tree, so that DNS trees printed with correct indentation - and, right now, we appear to be doing *something* wrong, as some packets I printed from one file here had randomly bogus indentation; I could probably track the problem down and fix it, but that might just hold us until we accidentally do something *else* wrong by GTK+'s lights. The new code provides its own tree level as it goes. 2) The new code is independent of GTK+, so it could be used with other toolkits, or with non-GUI variants of Ethereal. 3) This may make it easier to add a "Print..." menu item to let the user print packets other than the currently selected packet. Make the internal routines used to print the packet static. For the "Print Packet" menu item, put up a message box if they haven't yet selected a packet. svn path=/trunk/; revision=362
1999-07-07Created a new protocol tree implementation and a new display filterGilbert Ramirez1-2/+2
mechanism that is built into ethereal. Wiretap is now used to read all file formats. Libpcap is used only for capturing. svn path=/trunk/; revision=342
1999-06-21Found some erroneous usages of gtk_signal_connect_object. I always wonderedGilbert Ramirez1-4/+4
why I had to swap fields (data = w) in some of the callback functions when I added support for gtk+-1.1. Because of the use of gtk_signal_connect_object, the wrong value was being sent to the callback function. We were just lucky that with gtk+-1.0 it worked. gtk_signal_connect_object is for use with callbacks that take one argument. gtk_signal_connect is for use with callbacks that take two arguments. svn path=/trunk/; revision=324
1999-03-23Removed all references to gtk objects from packet*.[ch] files. They nowGilbert Ramirez1-1/+2
reference the protocol tree with struct proto_tree and struct proto_item objects. That way, the packet decoding source code file can be used with non-gtk packet decoders, like a curses-based ethereal, e.g. I also re-arranged some of the information in packet.h to more appropriate places (like other packet-*.[ch] files). svn path=/trunk/; revision=223
1998-10-28* Added preference file saves and reads.Gerald Combs1-97/+86
svn path=/trunk/; revision=75
1998-10-22I added the byte count to the Data section. The print routines had toGilbert Ramirez1-3/+3
be modified to check the beginning of the string instead of the entire string when trying to find the Data section in order to print a hex dump. svn path=/trunk/; revision=70
1998-10-12- Added match_strval function to packet.cGerald Combs1-3/+9
- Separated display and capture filters; rearranged some of the look and feel - Lots of other miscellaneous fixes and updates svn path=/trunk/; revision=38