Update the information about getting Xcode, and note that
[obnox/wireshark/wip.git] / gtk / tap_param_dlg.h
1 /* tap_param_dlg.h
2  * Header file for parameter dialog used by gui taps
3  * Copyright 2003 Lars Roland
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
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 __TAP_DFILTER_DLG_H__
27 #define __TAP_DFILTER_DLG_H__
28
29 /*
30  * You can easily add a parameter dialog for your gui tap by using 
31  * the following infrastructure:
32  *
33  * Define a global structure of tap_param_dlg within your stat source file.
34  * Initiate it with:
35  * 1) a title string for the Dialog Window
36  * 2) the init string, which is the same as the string after "-z" option without 
37  *    the filter string and without the separating comma.
38  * 3) a pointer to the init function of the tap, which will be called when you click
39  *    on the start button in the display filter dialog.
40  * 4) the index with "-1"
41  *
42  * Within register_tap_menu_yourtap(void), call register_dfilter_stat()
43  * with a pointer to the tap_param_dlg structure, a string for the
44  * menu item (don't put "..." at the end, register_dfilter_stat() will
45  * add it for you), and the REGISTER_STAT_GROUP_ value for the stat
46  * group to which your stat should belong.
47  *
48  * Usage:
49  *
50  * tap_param_dlg my_tap_param_dlg = {
51  *      "My Title",
52  *      "myproto,mytap",
53  *      gtk_mytap_init,
54  *      -1
55  * };
56  *
57  * register_tap_menu_mytap(void) {
58  *   register_dfilter_stat(&my_tap_param_dlg, "My Menu Item",
59  *       REGISTER_STAT_GROUP_my_group);
60  * }
61  *
62  * See also: h225_ras_srt.c or h225_counter.c
63  *
64  */
65
66 #include <epan/params.h>
67
68 typedef enum {
69         PARAM_UINT,
70         PARAM_STRING,
71         PARAM_ENUM,
72         PARAM_FILTER
73 } param_type;
74
75 typedef struct _tap_param {
76         param_type type;
77         const char *title;
78         enum_val_t *enum_vals;
79 } tap_param;
80
81 typedef struct _tap_param_dlg {
82         const char *win_title;          /* title */
83         const char *init_string;        /* the string to call the tap without a filter via "-z" option */
84         void (* tap_init_cb)(const char *,void*);       /* callback to init function of the tap */
85         gint index;                     /* initiate this value always with "-1" */
86         size_t nparams;                 /* number of parameters */
87         tap_param *params;              /* pointer to table of parameter info */
88 } tap_param_dlg;
89
90 /*
91  * Register a stat that has a display filter dialog.
92  * We register it both as a command-line stat and a menu item stat.
93  */
94 void register_dfilter_stat(tap_param_dlg *info, const char *name,
95     register_stat_group_t group);
96
97 #ifdef MAIN_MENU_USE_UIMANAGER
98 void tap_param_dlg_cb(GtkAction *action, gpointer user_data);
99 #endif
100
101 /* This will update the titles of the dialog windows when we load a new capture file. */
102 void tap_param_dlg_update (void);
103
104 #endif /* __TAP_DFILTER_DLG_H__ */