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