ded1e7d452b769e0ca4810932ea8974cd777a034
[obnox/wireshark/wip.git] / ethereal.h
1 /* ethereal.h
2  * Global defines, etc.
3  *
4  * $Id: ethereal.h,v 1.7 1998/10/16 01:18:27 gerald Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@zing.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * 
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  * 
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifndef __ETHEREAL_H__
27 #define __ETHEREAL_H__
28
29 #include "config.h"
30
31 #define RC_FILE ".etherealrc"
32 #define MONO_MEDIUM_FONT "-*-lucidatypewriter-medium-r-normal-*-*-120-*-*-*-*-iso8859-1"
33 #define MONO_BOLD_FONT "-*-lucidatypewriter-bold-r-normal-*-*-120-*-*-*-*-iso8859-1"
34 #define DEF_WIDTH 750
35 #define DEF_HEIGHT 550
36 #define DEF_READY_MESSAGE " Ready to load or capture"
37 #define EXTERNAL_FILTER "/usr/local/bin/ethereal_tcp_filter -f" 
38
39 /* Byte swapping routines */
40 #define SWAP16(x) \
41   ( (((x) & 0x00ff) << 8) | \
42     (((x) & 0xff00) >> 8) )
43 #define SWAP32(x) \
44   ( (((x) & 0x000000ff) << 24) | \
45     (((x) & 0x0000ff00) <<  8) | \
46     (((x) & 0x00ff0000) >>  8) | \
47     (((x) & 0xff000000) >> 24) )
48
49 /* Byte ordering */
50 #ifndef BYTE_ORDER
51   #define LITTLE_ENDIAN 4321
52   #define BIG_ENDIAN 1234
53   #ifdef WORDS_BIGENDIAN
54     #define BYTE_ORDER BIG_ENDIAN
55   #else
56     #define BYTE_ORDER LITTLE_ENDIAN
57   #endif
58 #endif
59
60 /* From the K&R book, p. 89 */
61 #ifndef MAX
62   #define MAX(x, y) ((x) > (y) ? (x) : (y))
63 #endif
64
65 #ifndef MIN
66   #define MIN(x, y) ((x) < (y) ? (x) : (y))
67 #endif
68     
69 typedef struct _selection_info {
70   GtkWidget *tree;
71   GtkWidget *text;
72 } selection_info;
73
74 /*
75  * Columns in summary listing.
76  */
77 #define COL_NUM         0
78 #define COL_TIME        1
79 #define COL_SOURCE      2
80 #define COL_DESTINATION 3
81 #define COL_PROTOCOL    4
82 #define COL_INFO        5
83
84 #define NUM_COLS        6
85
86 /*
87  * Type of time-stamp shown in the summary display.
88  */
89 typedef enum {
90         RELATIVE,
91         ABSOLUTE,
92         DELTA
93 } ts_type;
94
95 extern ts_type timestamp_type;
96
97 void about_ethereal( GtkWidget *, gpointer);
98 void file_sel_ok_cb(GtkWidget *, GtkFileSelection *);
99 void blank_packetinfo();
100 gint file_progress_cb(gpointer);
101 void follow_stream_cb( GtkWidget *, gpointer);
102 void file_open_cmd_cb(GtkWidget *, gpointer);
103 void file_close_cmd_cb(GtkWidget *, gpointer);
104 void file_quit_cmd_cb(GtkWidget *, gpointer);
105 void file_reload_cmd_cb(GtkWidget *, gpointer);
106 void file_print_cmd_cb(GtkWidget *, gpointer);
107 void main_realize_cb(GtkWidget *, gpointer);
108
109 #endif /* ethereal.h */