4 * $Id: ethereal.h,v 1.15 1999/06/24 16:25:59 gram Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@zing.org>
8 * Copyright 1998 Gerald Combs
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.
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.
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.
26 #ifndef __ETHEREAL_H__
27 #define __ETHEREAL_H__
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"
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"
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 */
43 /* Byte swapping routines */
45 ( (((x) & 0x00ff) << 8) | \
46 (((x) & 0xff00) >> 8) )
48 ( (((x) & 0x000000ff) << 24) | \
49 (((x) & 0x0000ff00) << 8) | \
50 (((x) & 0x00ff0000) >> 8) | \
51 (((x) & 0xff000000) >> 24) )
55 #define LITTLE_ENDIAN 4321
56 #define BIG_ENDIAN 1234
57 #ifdef WORDS_BIGENDIAN
58 #define BYTE_ORDER BIG_ENDIAN
60 #define BYTE_ORDER LITTLE_ENDIAN
64 /* From the K&R book, p. 89 */
66 #define MAX(x, y) ((x) > (y) ? (x) : (y))
70 #define MIN(x, y) ((x) < (y) ? (x) : (y))
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
77 #if (GTK_MINOR_VERSION > 1) || ((GTK_MICRO_VERSION > 1) && (GTK_MINOR_VERSION > 0))
79 #define GTK_MENU_FUNC(a) ((GtkItemFactoryCallback)(a))
82 typedef void (*_GTK_MENU_FUNC_T)(GtkWidget *, void *);
83 #define GTK_MENU_FUNC(a) ((_GTK_MENU_FUNC_T)(a))
87 typedef struct _selection_info {
92 extern GtkStyle *item_style;
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);
109 #endif /* ethereal.h */