name change
[metze/wireshark/wip.git] / gtk / decode_as_dcerpc.h
1 /* decode_as_dcerpc.h
2  *
3  * $Id$
4  *
5  * Routines to modify dcerpc bindings on the fly.
6  * Only internally used between decode_as_dlg and decode_as_dcerpc
7  *
8  * Copyright 2004 Ulf Lamping
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  *
24  */
25
26 #ifndef __DECODE_AS_DCERPC_H__
27 #define __DECODE_AS_DCERPC_H__
28
29 /** @file
30  *  "Decode As" / "User Specified Decodes" dialog box.
31  *  @ingroup dialog_group
32  */
33
34
35 /*
36  * Columns for a "Select" list.
37  * Note that most of these columns aren't displayed; they're attached
38  * to the row of the table as additional information.
39  */
40 #define E_LIST_S_PROTO_NAME 0
41 #define E_LIST_S_TABLE      1
42 /* The following is for debugging in decode_add_to_list */
43 #define E_LIST_S_MAX        E_LIST_S_TABLE
44 #define E_LIST_S_COLUMNS   (E_LIST_S_MAX + 1)
45
46 #define E_PAGE_LIST   "notebook_page_list"
47 #define E_PAGE_TABLE  "notebook_page_table_name"
48 #define E_PAGE_TITLE  "notebook_page_title"
49 #define E_PAGE_VALUE  "notebook_page_value"
50
51 #define E_PAGE_ACTION "notebook_page_action"
52
53 #define E_PAGE_DCERPC "notebook_page_dcerpc" /* dcerpc only */
54 #define E_PAGE_BINDING "notebook_page_binding" /* dcerpc only */
55
56
57 /*
58  * Enum used to track which radio button is currently selected in the
59  * dialog. These buttons are labeled "Decode" and "Do not decode".
60  */
61 enum action_type {
62     /* The "Decode" button is currently selected. */
63     E_DECODE_YES,
64
65     /* The "Do not decode" button is currently selected. */
66     E_DECODE_NO
67 };
68
69 extern enum action_type requested_action;
70
71 /*
72  * A list of the dialog items that only have meaning when the user has
73  * selected the "Decode" radio button.  When the "Do not decode"
74  * button is selected these items should be dimmed.
75  */
76 extern GSList *decode_dimmable;
77
78 /* init decode_dcerpc internals */
79 extern void decode_dcerpc_init(void);
80
81 /* remove all bindings */
82 extern void decode_dcerpc_reset_all(void);
83
84 extern void
85 decode_dcerpc_add_show_list(gpointer user_data);
86
87 extern GtkWidget *
88 decode_dcerpc_add_page(packet_info *pinfo);
89
90 extern void
91 decode_dcerpc_binding_free(void *binding);
92
93
94
95 /** Add an item the the Show list.
96  */
97 extern void
98 decode_add_to_show_list (
99 gpointer list_data, 
100 const gchar *table_name, 
101 gchar *selector_name, 
102 const gchar *initial_proto_name, 
103 const gchar *current_proto_name);
104
105
106 /*
107  * This routine creates one entry in the list of protocol dissector
108  * that can be used.  It is called by the dissector_table_foreach_handle
109  * routine once for each entry in a dissector table's list of handles
110  * for dissectors that could be used in that table.  It guarantees unique
111  * entries by iterating over the list of entries build up to this point,
112  * looking for a duplicate name.  If there is no duplicate, then this
113  * entry is added to the list of possible dissectors.
114  *
115  * @param table_name The name of the dissector table currently
116  * being walked.
117  *
118  * @param value The dissector handle for this entry.  This is an opaque
119  * pointer that can only be handed back to routines in the file packet.c
120  *
121  * @param user_data A data block passed into each instance of this
122  * routine.  It contains information from the caller of the foreach
123  * routine, specifying information about the dissector table and where
124  * to store any information generated by this routine.
125  */
126 extern void
127 decode_add_to_list (const gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data);
128
129 /*
130  * This routine starts the creation of a List on a notebook page.  It
131  * creates both a scrolled window and a list, adds the list to the
132  * window, and attaches the list as a data object on the page.
133  *
134  * @param page A pointer to the notebook page being created.
135  *
136  * @param list_p Will be filled in with the address of a newly
137  * created List.
138  *
139  * @param scrolled_win_p Will be filled in with the address of a newly
140  * created GtkScrolledWindow.
141  */
142 extern void
143 decode_list_menu_start(GtkWidget *page, GtkWidget **list_p,
144                        GtkWidget **scrolled_win_p);
145
146 /*
147  * This routine finishes the creation of a List on a notebook page.
148  * It adds the default entry, sets the default entry as the
149  * highlighted entry, and sorts the List.
150  *
151  * @param list A pointer the the List to finish.
152  */
153 extern void
154 decode_list_menu_finish(GtkWidget *list);
155
156 #endif