Note that non-GNU "make"s appear not to be able to build Ethereal, and
[metze/wireshark/wip.git] / ethereal.h
1 /* ethereal.h
2  * Global defines, etc.
3  *
4  * $Id: ethereal.h,v 1.15 1999/06/24 16:25:59 gram 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 PF_DIR ".ethereal"
32 #define RC_FILE PF_DIR "/gtkrc"
33 #define MONO_MEDIUM_FONT "-*-lucidatypewriter-medium-r-normal-*-*-120-*-*-*-*-iso8859-1"
34 #define MONO_BOLD_FONT "-*-lucidatypewriter-bold-r-normal-*-*-120-*-*-*-*-iso8859-1"
35 #define DEF_WIDTH 750
36 #define DEF_HEIGHT 550
37 #define DEF_READY_MESSAGE " Ready to load or capture"
38 #define EXTERNAL_FILTER "/usr/local/bin/ethereal_tcp_filter -f" 
39
40 #define MIN_PACKET_SIZE 68      /* minimum amount of packet data we can read */
41 #define MAX_PACKET_SIZE 65535   /* maximum amount of packet data we can read */
42
43 /* Byte swapping routines */
44 #define SWAP16(x) \
45   ( (((x) & 0x00ff) << 8) | \
46     (((x) & 0xff00) >> 8) )
47 #define SWAP32(x) \
48   ( (((x) & 0x000000ff) << 24) | \
49     (((x) & 0x0000ff00) <<  8) | \
50     (((x) & 0x00ff0000) >>  8) | \
51     (((x) & 0xff000000) >> 24) )
52
53 /* Byte ordering */
54 #ifndef BYTE_ORDER
55   #define LITTLE_ENDIAN 4321
56   #define BIG_ENDIAN 1234
57   #ifdef WORDS_BIGENDIAN
58     #define BYTE_ORDER BIG_ENDIAN
59   #else
60     #define BYTE_ORDER LITTLE_ENDIAN
61   #endif
62 #endif
63
64 /* From the K&R book, p. 89 */
65 #ifndef MAX
66   #define MAX(x, y) ((x) > (y) ? (x) : (y))
67 #endif
68
69 #ifndef MIN
70   #define MIN(x, y) ((x) < (y) ? (x) : (y))
71 #endif
72
73 /* Determine whether we use menu factories or item factories. This
74  * code snippet is taken from cheops.h of cheops-0.57, a GPL'ed
75  * network utility program Copyright (C) 1998, Mark Spencer
76  */
77 #if (GTK_MINOR_VERSION > 1) || ((GTK_MICRO_VERSION > 1) &&  (GTK_MINOR_VERSION > 0))
78         #define USE_ITEM
79         #define GTK_MENU_FUNC(a) ((GtkItemFactoryCallback)(a))
80 #else
81         #undef USE_ITEM
82         typedef void (*_GTK_MENU_FUNC_T)(GtkWidget *, void *);
83         #define GTK_MENU_FUNC(a) ((_GTK_MENU_FUNC_T)(a))
84 #endif
85
86     
87 typedef struct _selection_info {
88   GtkWidget *tree;
89   GtkWidget *text;
90 } selection_info;
91
92 extern GtkStyle *item_style;
93
94 void about_ethereal( GtkWidget *, gpointer);
95 void file_sel_ok_cb(GtkWidget *, GtkFileSelection *);
96 void blank_packetinfo();
97 gint file_progress_cb(gpointer);
98 void follow_stream_cb( GtkWidget *, gpointer);
99 void match_selected_cb( GtkWidget *, gpointer);
100 void file_open_cmd_cb(GtkWidget *, gpointer);
101 void file_save_cmd_cb(GtkWidget *, gpointer);
102 void file_save_as_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 */