* Added Mike Hall's TCP reconstruction code.
[obnox/wireshark/wip.git] / ethereal.h
1 /* ethereal.h
2  * Global defines, etc.
3  *
4  * $Id: ethereal.h,v 1.3 1998/09/17 03:12:24 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 1234
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 void file_sel_ok_cb(GtkWidget *, GtkFileSelection *);
75 void blank_packetinfo();
76 gint file_progress_cb(gpointer);
77 void follow_stream_cb( GtkWidget *, gpointer);
78 void file_open_cmd_cb(GtkWidget *, gpointer);
79 void file_close_cmd_cb(GtkWidget *, gpointer);
80 void file_quit_cmd_cb(GtkWidget *, gpointer);
81 void file_print_cmd_cb(GtkWidget *, gpointer);
82 void main_realize_cb(GtkWidget *, gpointer);
83
84 #endif /* ethereal.h */