Win32 only: Preference setting to open a console window, one of:
[metze/wireshark/wip.git] / print.h
1 /* print.h
2  * Definitions for printing packet analysis trees.
3  *
4  * $Id: print.h,v 1.44 2004/05/09 10:03:37 guy Exp $
5  *
6  * Gilbert Ramirez <gram@alumni.rice.edu>
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@ethereal.com>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifndef __PRINT_H__
28 #define __PRINT_H__
29
30 #include <epan/packet.h>
31
32
33 /* print output format */
34 typedef enum {
35   PR_FMT_TEXT,    /* plain text */
36   PR_FMT_PS,      /* postscript */
37   PR_FMT_PSML,    /* packet summary markup language */
38   PR_FMT_PDML     /* packet data markup language */
39 } print_format_e;
40
41 /* print_range, enum which frames should be printed */
42 typedef enum {
43   print_range_selected_only,    /* selected frame(s) only (currently only one) */
44   print_range_marked_only,      /* marked frames only */
45   print_range_all_displayed,    /* all frames currently displayed */
46   print_range_all_captured      /* all frames in capture */
47 } print_range_e;
48
49 /* print_dissections, enum how the dissections should be printed */
50 typedef enum {
51   print_dissections_none,         /* no dissections at all */
52   print_dissections_collapsed,    /* no dissection details */
53   print_dissections_as_displayed, /* details as displayed */
54   print_dissections_expanded      /* all dissection details */
55 } print_dissections_e;
56
57 typedef struct {
58   print_format_e    format;             /* plain text, PostScript, PDML, ... */
59   gboolean      to_file;        /* TRUE if we're printing to a file */
60   char          *file;          /* file output pathname */
61   char          *cmd;           /* print command string (not win32) */
62   packet_range_t range;
63
64   gboolean      print_summary;  /* TRUE if we should just print summary;
65                                    FALSE if we should print protocol tree. */
66   print_dissections_e   print_dissections;
67   gboolean      print_hex;      /* TRUE if we should also print hex data;
68                                    FALSE if we should print only if not dissected. */
69   gboolean      print_formfeed; /* TRUE if a formfeed should be printed 
70                    before each new packet */
71 } print_args_t;
72
73 /* Functions in print.h */
74
75 extern FILE *open_print_dest(int to_file, const char *dest);
76 extern gboolean close_print_dest(int to_file, FILE *fh);
77 extern void print_preamble(FILE *fh, print_format_e format, gchar *filename);
78 extern void print_packet_header(FILE *fh, print_format_e format, guint32 number, gchar *summary);
79 extern void print_formfeed(FILE *fh, print_format_e format);
80 extern void print_finale(FILE *fh, print_format_e format);
81 extern void proto_tree_print(print_args_t *print_args, epan_dissect_t *edt,
82      FILE *fh);
83 extern void print_hex_data(FILE *fh, print_format_e format, epan_dissect_t *edt);
84 extern void print_line(FILE *fh, int indent, print_format_e format, char *line);
85
86 #endif /* print.h */