Move the GSM SMS dissection to a dedicated subdissector (currently still within
[obnox/wireshark/wip.git] / print.h
1 /* print.h
2  * Definitions for printing packet analysis trees.
3  *
4  * $Id: print.h,v 1.33 2003/12/09 22:21:24 ulfl 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 #define PR_FMT_TEXT 0
33 #define PR_FMT_PS   1
34 #define PR_FMT_PDML 2
35
36 /* print_range, enum which frames should be printed */
37 typedef enum {
38   print_range_selected_only,    /* selected frame(s) only (currently only one) */
39   print_range_marked_only,      /* marked frames only */
40   print_range_all_displayed,    /* all frames currently displayed */
41   print_range_all_captured      /* all frames in capture */
42 } print_range_e;
43
44 /* print_dissections, enum how the dissections should be printed */
45 typedef enum {
46   print_dissections_collapsed,    /* no dissection details */
47   print_dissections_as_displayed, /* details as displayed */
48   print_dissections_expanded      /* all dissection details */
49 } print_dissections_e;
50
51 typedef struct {
52   gint          format;         /* text or PostScript */
53   gboolean      to_file;        /* TRUE if we're printing to a file */
54   char          *dest;          /* if printing to file, pathname;
55                                    if not, command string */
56   print_range_e print_range;
57   /*guint32             print_range_min;*/
58   /*guint32             print_range_max;*/
59
60   gboolean      print_summary;  /* TRUE if we should just print summary;
61                                    FALSE if we should print protocol tree. */
62   print_dissections_e   print_dissections;
63   gboolean      print_hex;      /* TRUE if we should also print hex data;
64                                    FALSE if we should print only if not dissected. */
65 } print_args_t;
66
67 /* Functions in print.h */
68
69 FILE *open_print_dest(int to_file, const char *dest);
70 void close_print_dest(int to_file, FILE *fh);
71 void print_preamble(FILE *fh, gint format);
72 void print_finale(FILE *fh, gint format);
73 void proto_tree_print(print_args_t *print_args, epan_dissect_t *edt,
74     FILE *fh);
75 void print_hex_data(FILE *fh, gint format, epan_dissect_t *edt);
76 void print_line(FILE *fh, int indent, gint format, char *line);
77
78 #endif /* print.h */