Move 3 ASN1 dissectors to 'clean' group; move 1 PIDL dissector to 'dirty' group.
[metze/wireshark/wip.git] / epan / dissectors / packet-gdsdb.c
1 /* packet-gdsdb.c
2  * Routines for Firebird/Interbase dissection
3  * Copyright 2007, Moshe van der Sterre <moshevds@gmail.com>
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24  */
25
26 #include "config.h"
27
28 #include <glib.h>
29
30 #include <epan/packet.h>
31
32 #define TCP_PORT        3050
33
34 static int proto_gdsdb = -1;
35 static gint ett_gdsdb = -1;
36 static int hf_gdsdb_opcode = -1;
37 static gint ett_gdsdb_opcode = -1;
38
39 /* gdsdb_dummy */
40 /* gdsdb_connect */
41 static int hf_gdsdb_connect_operation = -1;
42 static int hf_gdsdb_connect_version = -1;
43 static int hf_gdsdb_connect_client = -1;
44 static int hf_gdsdb_connect_filename = -1;
45 static int hf_gdsdb_connect_count = -1;
46 static int hf_gdsdb_connect_userid = -1;
47 static int hf_gdsdb_connect_pref = -1;
48 static gint ett_gdsdb_connect_pref = -1;
49 static int hf_gdsdb_connect_pref_version = -1;
50 static int hf_gdsdb_connect_pref_architecture = -1;
51 static int hf_gdsdb_connect_pref_mintype = -1;
52 static int hf_gdsdb_connect_pref_maxtype = -1;
53 static int hf_gdsdb_connect_pref_weight = -1;
54 /* gdsdb_accept */
55 static int hf_gdsdb_accept_version = -1;
56 static int hf_gdsdb_accept_architecture = -1;
57 /* gdsdb_request */
58 static int hf_gdsdb_request_type = -1;
59 static int hf_gdsdb_request_object = -1;
60 static int hf_gdsdb_request_partner = -1;
61 /* gdsdb_attach */
62 static int hf_gdsdb_attach_database = -1;
63 static int hf_gdsdb_attach_filename = -1;
64 static int hf_gdsdb_attach_dpb = -1;
65 /* gdsdb_compile */
66 static int hf_gdsdb_compile_database = -1;
67 static int hf_gdsdb_compile_blr = -1;
68 /* gdsdb_receive */
69 static int hf_gdsdb_receive_request = -1;
70 static int hf_gdsdb_receive_incarnation = -1;
71 static int hf_gdsdb_receive_transaction = -1;
72 static int hf_gdsdb_receive_msgnr = -1;
73 static int hf_gdsdb_receive_messages = -1;
74 static int hf_gdsdb_receive_direction = -1;
75 static int hf_gdsdb_receive_offset = -1;
76 /* gdsdb_send */
77 static int hf_gdsdb_send_request = -1;
78 static int hf_gdsdb_send_incarnation = -1;
79 static int hf_gdsdb_send_transaction = -1;
80 static int hf_gdsdb_send_msgnr = -1;
81 static int hf_gdsdb_send_messages = -1;
82 /* gdsdb_response */
83 static int hf_gdsdb_response_object = -1;
84 static int hf_gdsdb_response_blobid = -1;
85 static int hf_gdsdb_response_data = -1;
86 static int hf_gdsdb_response_status = -1;
87 /* gdsdb_transact */
88 static int hf_gdsdb_transact_database = -1;
89 static int hf_gdsdb_transact_transaction = -1;
90 static int hf_gdsdb_transact_messages = -1;
91 /* gdsdb_transact_response */
92 static int hf_gdsdb_transactresponse_messages = -1;
93 /* gdsdb_open_blob2 */
94 static int hf_gdsdb_openblob2_bpb = -1;
95 /* gdsdb_open_blob */
96 static int hf_gdsdb_openblob_transaction = -1;
97 static int hf_gdsdb_openblob_id = -1;
98 /* gdsdb_segment */
99 static int hf_gdsdb_segment_blob = -1;
100 static int hf_gdsdb_segment_length = -1;
101 static int hf_gdsdb_segment_segment = -1;
102 /* gdsdb_seek_blob */
103 static int hf_gdsdb_seekblob_blob = -1;
104 static int hf_gdsdb_seekblob_mode = -1;
105 /* gdsdb_reconnect */
106 static int hf_gdsdb_reconnect_database = -1;
107 /* gdsdb_info & gdsdb_service_start */
108 static int hf_gdsdb_info_object = -1;
109 static int hf_gdsdb_info_incarnation = -1;
110 static int hf_gdsdb_info_items = -1;
111 static int hf_gdsdb_info_buffer_length = -1;
112 /* gdsdb_release */
113 static int hf_gdsdb_release_object = -1;
114 /* gdsdb_prepare2 */
115 static int hf_gdsdb_prepare2_transaction = -1;
116 /* gdsdb_event & gdsdb_cancel_events */
117 static int hf_gdsdb_event_database = -1;
118 static int hf_gdsdb_event_items = -1;
119 static int hf_gdsdb_event_ast = -1;
120 static int hf_gdsdb_event_arg = -1;
121 static int hf_gdsdb_event_rid = -1;
122 /* gdsdb_ddl */
123 static int hf_gdsdb_ddl_database = -1;
124 static int hf_gdsdb_ddl_transaction = -1;
125 static int hf_gdsdb_ddl_blr = -1;
126 /* gdsdb_slice */
127 static int hf_gdsdb_slice_transaction = -1;
128 static int hf_gdsdb_slice_id = -1;
129 static int hf_gdsdb_slice_sdl = -1;
130 static int hf_gdsdb_slice_parameters = -1;
131 /* gdsdb_slice_response */
132 static int hf_gdsdb_sliceresponse_length = -1;
133 /* gdsdb_execute */
134 static int hf_gdsdb_execute_statement = -1;
135 static int hf_gdsdb_execute_transaction = -1;
136 static int hf_gdsdb_execute_message_number = -1;
137 static int hf_gdsdb_execute_messages = -1;
138 /* gdsdb_execute2 */
139 static int hf_gdsdb_execute_outblr = -1;
140 static int hf_gdsdb_execute_outmsgnr = -1;
141 /* gdsdb_exec_immediate2 */
142 static int hf_gdsdb_prepare2_blr = -1;
143 static int hf_gdsdb_prepare2_number = -1;
144 static int hf_gdsdb_prepare2_messages = -1;
145 static int hf_gdsdb_prepare2_outblr = -1;
146 static int hf_gdsdb_prepare2_outmsgnr = -1;
147 /* gdsdb_prepare */
148 static int hf_gdsdb_prepare_transaction = -1;
149 static int hf_gdsdb_prepare_statement = -1;
150 static int hf_gdsdb_prepare_dialect = -1;
151 static int hf_gdsdb_prepare_querystr = -1;
152 static int hf_gdsdb_prepare_items = -1;
153 static int hf_gdsdb_prepare_bufferlength = -1;
154 /* gdsdb_fetch */
155 static int hf_gdsdb_fetch_statement = -1;
156 static int hf_gdsdb_fetch_message_number = -1;
157 static int hf_gdsdb_fetch_messages = -1;
158 /* gdsdb_fetch_response */
159 static int hf_gdsdb_fetchresponse_status = -1;
160 static int hf_gdsdb_fetchresponse_messages = -1;
161 /* gdsdb_free_statement */
162 static int hf_gdsdb_free_statement = -1;
163 static int hf_gdsdb_free_option = -1;
164 /* gdsdb_insert */
165 static int hf_gdsdb_insert_statement = -1;
166 static int hf_gdsdb_insert_message_number = -1;
167 static int hf_gdsdb_insert_messages = -1;
168 /* gdsdb_cursor */
169 static int hf_gdsdb_cursor_statement = -1;
170 static int hf_gdsdb_cursor_type = -1;
171 /* gdsdb_sql_response */
172 static int hf_gdsdb_sqlresponse_messages = -1;
173
174 enum
175 {
176         op_void                   = 0,
177         op_connect                = 1,
178         op_exit                   = 2,
179         op_accept                 = 3,
180         op_reject                 = 4,
181         op_protocol               = 5,
182         op_disconnect             = 6,
183         op_credit                 = 7,
184         op_continuation           = 8,
185         op_response               = 9,
186         op_open_file              = 10,
187         op_create_file            = 11,
188         op_close_file             = 12,
189         op_read_page              = 13,
190         op_write_page             = 14,
191         op_lock                   = 15,
192         op_convert_lock           = 16,
193         op_release_lock           = 17,
194         op_blocking               = 18,
195         op_attach                 = 19,
196         op_create                 = 20,
197         op_detach                 = 21,
198         op_compile                = 22,
199         op_start                  = 23,
200         op_start_and_send         = 24,
201         op_send                   = 25,
202         op_receive                = 26,
203         op_unwind                 = 27,
204         op_release                = 28,
205         op_transaction            = 29,
206         op_commit                 = 30,
207         op_rollback               = 31,
208         op_prepare                = 32,
209         op_reconnect              = 33,
210         op_create_blob            = 34,
211         op_open_blob              = 35,
212         op_get_segment            = 36,
213         op_put_segment            = 37,
214         op_cancel_blob            = 38,
215         op_close_blob             = 39,
216         op_info_database          = 40,
217         op_info_request           = 41,
218         op_info_transaction       = 42,
219         op_info_blob              = 43,
220         op_batch_segments         = 44,
221         op_mgr_set_affinity       = 45,
222         op_mgr_clear_affinity     = 46,
223         op_mgr_report             = 47,
224         op_que_events             = 48,
225         op_cancel_events          = 49,
226         op_commit_retaining       = 50,
227         op_prepare2               = 51,
228         op_event                  = 52,
229         op_connect_request        = 53,
230         op_aux_connect            = 54,
231         op_ddl                    = 55,
232         op_open_blob2             = 56,
233         op_create_blob2           = 57,
234         op_get_slice              = 58,
235         op_put_slice              = 59,
236         op_slice                  = 60,
237         op_seek_blob              = 61,
238         op_allocate_statement     = 62,
239         op_execute                = 63,
240         op_exec_immediate         = 64,
241         op_fetch                  = 65,
242         op_fetch_response         = 66,
243         op_free_statement         = 67,
244         op_prepare_statement      = 68,
245         op_set_cursor             = 69,
246         op_info_sql               = 70,
247         op_dummy                  = 71,
248         op_response_piggyback     = 72,
249         op_start_and_receive      = 73,
250         op_start_send_and_receive = 74,
251         op_exec_immediate2        = 75,
252         op_execute2               = 76,
253         op_insert                 = 77,
254         op_sql_response           = 78,
255         op_transact               = 79,
256         op_transact_response      = 80,
257         op_drop_database          = 81,
258         op_service_attach         = 82,
259         op_service_detach         = 83,
260         op_service_info           = 84,
261         op_service_start          = 85,
262         op_rollback_retaining     = 86,
263         op_max
264 };
265
266 static const value_string gdsdb_opcode[] = {
267         { op_void, "Void" },
268         { op_connect, "Connect" },
269         { op_exit, "Exit" },
270         { op_accept, "Accept" },
271         { op_reject, "Reject" },
272         { op_protocol, "Protocol" },
273         { op_disconnect, "Disconnect" },
274         { op_credit, "Credit" },
275         { op_continuation, "Continuation" },
276         { op_response, "Response" },
277         { op_open_file, "Open file" },
278         { op_create_file, "Create file" },
279         { op_close_file, "Close file" },
280         { op_read_page, "Read page" },
281         { op_write_page, "Write page" },
282         { op_lock, "Lock" },
283         { op_convert_lock, "Convert lock" },
284         { op_release_lock, "Release lock" },
285         { op_blocking, "Blocking" },
286         { op_attach, "Attach" },
287         { op_create, "Create" },
288         { op_detach, "Detach" },
289         { op_compile, "Compile" },
290         { op_start, "Start" },
291         { op_start_and_send, "Start and send" },
292         { op_send, "Send" },
293         { op_receive, "Receive" },
294         { op_unwind, "Unwind" },
295         { op_release, "Release" },
296         { op_transaction, "Transaction" },
297         { op_commit, "Commit" },
298         { op_rollback, "Rollback" },
299         { op_prepare, "Prepare" },
300         { op_reconnect, "Reconnect" },
301         { op_create_blob, "Create blob" },
302         { op_open_blob, "Open blob" },
303         { op_get_segment, "Get segment" },
304         { op_put_segment, "Put segment" },
305         { op_cancel_blob, "Cancel blob" },
306         { op_close_blob, "Close blob" },
307         { op_info_database, "Info database" },
308         { op_info_request, "Info request" },
309         { op_info_transaction, "Info transaction" },
310         { op_info_blob, "Info blob" },
311         { op_batch_segments, "Batch segments" },
312         { op_mgr_set_affinity, "Mgr set affinity" },
313         { op_mgr_clear_affinity, "Mgr clear affinity" },
314         { op_mgr_report, "Mgr report" },
315         { op_que_events, "Que events" },
316         { op_cancel_events, "Cancel events" },
317         { op_commit_retaining, "Commit retaining" },
318         { op_prepare2, "Prepare 2" },
319         { op_event, "Event" },
320         { op_connect_request, "Connect request" },
321         { op_aux_connect, "Aux connect" },
322         { op_ddl, "DDl" },
323         { op_open_blob2, "Open blob 2" },
324         { op_create_blob2, "Create blob 2" },
325         { op_get_slice, "Get slice" },
326         { op_put_slice, "Put slice" },
327         { op_slice, "Slice" },
328         { op_seek_blob, "Seek blob" },
329         { op_allocate_statement, "Allocate statement" },
330         { op_execute, "Execute" },
331         { op_exec_immediate, "Exec immediate" },
332         { op_fetch, "Fetch" },
333         { op_fetch_response, "Fetch response" },
334         { op_free_statement, "Free statement" },
335         { op_prepare_statement, "Prepare statement" },
336         { op_set_cursor, "Set cursor" },
337         { op_info_sql, "Info sql" },
338         { op_dummy, "Dummy" },
339         { op_response_piggyback, "Response piggyback" },
340         { op_start_and_receive, "Start and receive" },
341         { op_start_send_and_receive, "Start send and receive" },
342         { op_exec_immediate2, "Exec immediate 2" },
343         { op_execute2, "Execute 2" },
344         { op_insert, "Insert" },
345         { op_sql_response, "Sql response" },
346         { op_transact, "Transact" },
347         { op_transact_response, "Transact response" },
348         { op_drop_database, "Drop database" },
349         { op_service_attach, "Service attach" },
350         { op_service_detach, "Service detach" },
351         { op_service_info, "Service info" },
352         { op_service_start, "Service start" },
353         { op_rollback_retaining, "Rollback retaining" },
354         { 0, NULL }
355 };
356
357 static const value_string gdsdb_architectures[] = {
358         { 1, "Generic" },
359         { 2, "Apollo" },
360         { 3, "Sun" },
361         { 4, "Vms" },
362         { 5, "Ultrix" },
363         { 6, "Alliant" },
364         { 7, "MS-Dos" },
365         { 8, "Sun 4" },
366         { 9, "Sun 386" },
367         { 10, "HP-UX" },
368         { 11, "HP MPE/xl" },
369         { 12, "Mac" },
370         { 13, "Mac aux" },
371         { 14, "rt" },
372         { 15, "mips Ultrix" },
373         { 16, "HP-UX 68k" },
374         { 17, "Xenix" },
375         { 18, "Aviion" },
376         { 19, "SGI" },
377         { 20, "Apollo_dn10k" },
378         { 21, "Cray" },
379         { 22, "Imp" },
380         { 23, "Delta" },
381         { 24, "SCO" },
382         { 25, "Next" },
383         { 26, "Next 386" },
384         { 27, "m88k" },
385         { 28, "UnixWare" },
386         { 29, "Intel 32" },
387         { 30, "Epson" },
388         { 31, "Decosf" },
389         { 32, "Ncr3000" },
390         { 33, "NT PPC" },
391         { 34, "DG x86" },
392         { 35, "SCO ev" },
393         { 36, "Linux" },
394         { 37, "FreeBSD"  },
395         { 38, "NetBSD" },
396         { 39, "Darwin PPC" },
397         { 0, NULL }
398 };
399
400 static int
401 gdsdb_dummy(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
402 {
403         /* Don't tell them we match */
404         return 0;
405 }
406
407 static int
408 gdsdb_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
409 {
410         int offset;
411         int length;
412         int count;
413         int i;
414         proto_item *ti;
415         proto_tree *pref_tree;
416
417         if (tvb_length(tvb) < 16) {
418                 return 0;
419         }
420         if (check_col(pinfo->cinfo, COL_INFO)){
421                 col_append_str(pinfo->cinfo, COL_INFO, ": ");
422                 col_append_str(pinfo->cinfo, COL_INFO,
423                         tvb_format_text(tvb, 20,
424                                 tvb_get_ntohl(tvb, 16)));
425         }
426         if (tree) {
427                 offset = 4;
428                 proto_tree_add_item(tree, hf_gdsdb_connect_operation, tvb,
429                                                         offset, 4, ENC_BIG_ENDIAN);
430                 offset += 4;
431                 proto_tree_add_item(tree, hf_gdsdb_connect_version, tvb,
432                                                         offset, 4, ENC_BIG_ENDIAN);
433                 offset += 4;
434                 proto_tree_add_item(tree, hf_gdsdb_connect_client, tvb,
435                                                         offset, 4, ENC_BIG_ENDIAN);
436                 offset += 4;
437                 proto_tree_add_item(tree, hf_gdsdb_connect_filename, tvb,
438                                                         offset, 4, ENC_ASCII|ENC_NA);
439                 length = tvb_get_ntohl(tvb, offset);
440                 offset += length + 6;
441                 proto_tree_add_item(tree, hf_gdsdb_connect_count, tvb,
442                                                         offset, 4, ENC_BIG_ENDIAN);
443                 count = tvb_get_ntohl(tvb, offset);
444                 offset += 4;
445                 proto_tree_add_item(tree, hf_gdsdb_connect_userid, tvb,
446                                                         offset, 4, ENC_ASCII|ENC_NA);
447                 length = tvb_get_ntohl(tvb, offset);
448                 offset += length + 5;
449                 for(i=0;i<count;i++){
450                         ti = proto_tree_add_item(tree, hf_gdsdb_connect_pref,
451                                                 tvb, offset, 20, ENC_NA);
452                         pref_tree = proto_item_add_subtree(ti,
453                                                  ett_gdsdb_connect_pref);
454                         proto_tree_add_item(pref_tree,
455                                         hf_gdsdb_connect_pref_version,
456                                                 tvb, offset, 4, ENC_BIG_ENDIAN);
457                         offset += 4;
458                         proto_tree_add_item(pref_tree,
459                                         hf_gdsdb_connect_pref_architecture,
460                                                 tvb, offset, 4, ENC_BIG_ENDIAN);
461                         offset += 4;
462                         proto_tree_add_item(pref_tree,
463                                         hf_gdsdb_connect_pref_mintype,
464                                                 tvb, offset, 4, ENC_BIG_ENDIAN);
465                         offset += 4;
466                         proto_tree_add_item(pref_tree,
467                                         hf_gdsdb_connect_pref_maxtype,
468                                                 tvb, offset, 4, ENC_BIG_ENDIAN);
469                         offset += 4;
470                         proto_tree_add_item(pref_tree,
471                                         hf_gdsdb_connect_pref_weight,
472                                                 tvb, offset, 4, ENC_BIG_ENDIAN);
473                         offset += 4;
474                 }
475         }
476
477         return tvb_length(tvb);
478 }
479
480 static int
481 gdsdb_accept(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
482 {
483         int offset;
484
485         if (tvb_length(tvb) < 16) {
486                 return 0;
487         }
488         if (tree) {
489                 offset = 4;
490                 proto_tree_add_item(tree, hf_gdsdb_accept_version, tvb,
491                                                         offset, 4, ENC_BIG_ENDIAN);
492                 offset += 4;
493                 proto_tree_add_item(tree, hf_gdsdb_accept_architecture, tvb,
494                                                         offset, 4, ENC_BIG_ENDIAN);
495                 offset += 4;
496         }
497
498         return tvb_length(tvb);
499 }
500
501 static int
502 gdsdb_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
503 {
504         int offset;
505
506         if (tvb_length(tvb) < 20) {
507                 return 0;
508         }
509         if (tree) {
510                 offset = 4;
511                 proto_tree_add_item(tree, hf_gdsdb_request_type, tvb,
512                                                 offset, 4, ENC_BIG_ENDIAN);
513                 offset += 4;
514                 proto_tree_add_item(tree, hf_gdsdb_request_object, tvb,
515                                                 offset, 4, ENC_BIG_ENDIAN);
516                 offset += 4;
517                 proto_tree_add_item(tree, hf_gdsdb_request_partner, tvb,
518                                                 offset, 8, ENC_BIG_ENDIAN);
519         }
520
521         return tvb_length(tvb);
522 }
523
524 static int
525 gdsdb_attach(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
526 {
527         int offset;
528         int length;
529
530         if (tvb_length(tvb) < 20) {
531                 return 0;
532         }
533         if (check_col(pinfo->cinfo, COL_INFO)){
534                 col_append_str(pinfo->cinfo, COL_INFO, ": ");
535                 col_append_str(pinfo->cinfo, COL_INFO,
536                         tvb_format_text(tvb, 12,
537                                 tvb_get_ntohl(tvb, 8)));
538         }
539         if (tree) {
540                 offset = 4;
541                 proto_tree_add_item(tree, hf_gdsdb_attach_database, tvb,
542                                                         offset, 4, ENC_BIG_ENDIAN);
543                 offset += 4;
544                 proto_tree_add_item(tree, hf_gdsdb_attach_filename, tvb,
545                                                         offset, 4, ENC_ASCII|ENC_NA);
546                 length = tvb_get_ntohl(tvb, offset);
547                 offset += length + 6;
548                 proto_tree_add_uint_format_value(tree,
549                                 hf_gdsdb_attach_dpb, tvb, offset, 4 + length,
550                                         length, "%i data bytes", length);
551         }
552
553         return tvb_length(tvb);
554 }
555
556 static int
557 gdsdb_compile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
558 {
559         int offset;
560
561         if (tvb_length(tvb) < 20) {
562                 return 0;
563         }
564         if (tree) {
565                 offset = 4;
566                 proto_tree_add_item(tree, hf_gdsdb_compile_database, tvb,
567                                                         offset, 4, ENC_BIG_ENDIAN);
568                 offset += 4;
569                 proto_tree_add_item(tree, hf_gdsdb_compile_blr, tvb,
570                                                         offset, 4, ENC_ASCII|ENC_NA);
571         }
572
573         return tvb_length(tvb);
574 }
575
576 static int
577 gdsdb_receive(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
578 {
579         int offset;
580
581         if (tvb_length(tvb) < 20) {
582                 return 0;
583         }
584         if (tree) {
585                 offset = 4;
586                 proto_tree_add_item(tree, hf_gdsdb_receive_request, tvb,
587                                                         offset, 4, ENC_BIG_ENDIAN);
588                 offset += 4;
589                 proto_tree_add_item(tree, hf_gdsdb_receive_incarnation, tvb,
590                                                         offset, 4, ENC_BIG_ENDIAN);
591                 offset += 4;
592                 proto_tree_add_item(tree, hf_gdsdb_receive_transaction, tvb,
593                                                         offset, 4, ENC_BIG_ENDIAN);
594                 offset += 4;
595                 proto_tree_add_item(tree, hf_gdsdb_receive_msgnr, tvb,
596                                                         offset, 4, ENC_BIG_ENDIAN);
597                 offset += 4;
598                 proto_tree_add_item(tree, hf_gdsdb_receive_messages, tvb,
599                                                         offset, 4, ENC_BIG_ENDIAN);
600                 offset += 4;
601                 while(tvb_bytes_exist(tvb, offset, 12)) {
602                         proto_tree_add_item(tree, hf_gdsdb_receive_direction,
603                                                 tvb, offset, 4, ENC_BIG_ENDIAN);
604                         offset += 4;
605                         proto_tree_add_item(tree, hf_gdsdb_receive_offset,
606                                                  tvb, offset, 8, ENC_BIG_ENDIAN);
607                         offset += 8;
608                 }
609         }
610
611         return tvb_length(tvb);
612 }
613
614 static int
615 gdsdb_send(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
616 {
617         int offset;
618
619         if (tvb_length(tvb) < 20) {
620                 return 0;
621         }
622         if (tree) {
623                 offset = 4;
624                 proto_tree_add_item(tree, hf_gdsdb_send_request, tvb,
625                                                         offset, 4, ENC_BIG_ENDIAN);
626                 offset += 4;
627                 proto_tree_add_item(tree, hf_gdsdb_send_incarnation, tvb,
628                                                         offset, 4, ENC_BIG_ENDIAN);
629                 offset += 4;
630                 proto_tree_add_item(tree, hf_gdsdb_send_transaction, tvb,
631                                                         offset, 4, ENC_BIG_ENDIAN);
632                 offset += 4;
633                 proto_tree_add_item(tree, hf_gdsdb_send_msgnr, tvb,
634                                                         offset, 4, ENC_BIG_ENDIAN);
635                 offset += 4;
636                 proto_tree_add_item(tree, hf_gdsdb_send_messages, tvb,
637                                                         offset, 4, ENC_BIG_ENDIAN);
638         }
639
640         return tvb_length(tvb);
641 }
642
643 static int
644 gdsdb_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
645 {
646         int offset;
647         int length;
648
649         if (tvb_length(tvb) < 32) {
650                 return 0;
651         }
652         if (tree) {
653                 offset = 4;
654                 proto_tree_add_item(tree, hf_gdsdb_response_object, tvb,
655                                                         offset, 4, ENC_BIG_ENDIAN);
656                 offset += 4;
657                 proto_tree_add_item(tree, hf_gdsdb_response_blobid, tvb,
658                                                         offset, 8, ENC_BIG_ENDIAN);
659                 offset += 8;
660                 proto_tree_add_item(tree, hf_gdsdb_response_data, tvb,
661                                                         offset, 4, ENC_ASCII|ENC_NA);
662                 length = tvb_get_ntohl(tvb, offset);
663                 offset += length + 4;
664                 proto_tree_add_item(tree, hf_gdsdb_response_status, tvb,
665                                 offset, tvb_length(tvb) - offset, ENC_NA);
666         }
667
668         return tvb_length(tvb);
669
670 }
671
672 static int
673 gdsdb_transact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
674 {
675         int offset;
676
677         if (tvb_length(tvb) < 20) {
678                 return 0;
679         }
680         if (tree) {
681                 offset = 4;
682                 proto_tree_add_item(tree, hf_gdsdb_transact_database, tvb,
683                                                         offset, 4, ENC_BIG_ENDIAN);
684                 offset += 4;
685                 proto_tree_add_item(tree, hf_gdsdb_transact_transaction, tvb,
686                                                         offset, 4, ENC_BIG_ENDIAN);
687         }
688
689         return tvb_length(tvb);
690 }
691
692 static int
693 gdsdb_transact_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
694 {
695
696         int offset;
697
698         if (tvb_length(tvb) < 8) {
699                 return 0;
700         }
701         if (tree) {
702                 offset = 4;
703                 proto_tree_add_item(tree, hf_gdsdb_transactresponse_messages,
704                                                 tvb, offset, 4, ENC_BIG_ENDIAN);
705         }
706
707         return tvb_length(tvb);
708 }
709
710 static int
711 gdsdb_open_blob2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
712 {
713         int offset;
714         int length;
715
716         if (!tvb_bytes_exist(tvb, 0, 20)) {
717                 return 0;
718         }
719         if (tree) {
720                 offset = 4;
721                 proto_tree_add_item(tree, hf_gdsdb_openblob2_bpb, tvb, offset,
722                                                                 4, ENC_ASCII|ENC_NA);
723                 length = tvb_get_ntohl(tvb, offset);
724                 offset += length + 6;
725                 proto_tree_add_item(tree, hf_gdsdb_openblob_transaction, tvb,
726                                                         offset, 4, ENC_BIG_ENDIAN);
727                 offset += 4;
728                 proto_tree_add_item(tree, hf_gdsdb_openblob_id, tvb, offset,
729                                                                 8, ENC_BIG_ENDIAN);
730         }
731
732         return tvb_length(tvb);
733 }
734
735 static int
736 gdsdb_open_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
737 {
738         int offset;
739
740         if (tvb_length(tvb) < 16) {
741                 return 0;
742         }
743         if (tree) {
744                 offset = 4;
745                 proto_tree_add_item(tree, hf_gdsdb_openblob_transaction, tvb,
746                                                         offset, 4, ENC_BIG_ENDIAN);
747                 offset += 4;
748                 proto_tree_add_item(tree, hf_gdsdb_openblob_id, tvb, offset,
749                                                                 8, ENC_BIG_ENDIAN);
750         }
751
752         return tvb_length(tvb);
753 }
754
755 static int
756 gdsdb_segment(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
757 {
758         /* int offset; */
759
760         if (tvb_length(tvb) < 16) {
761                 return 0;
762         }
763         if (tree) {
764 /* hf_gdsdb_segment_blob */
765 /* hf_gdsdb_segment_length */
766 /* hf_gdsdb_segment_segment */
767         }
768
769         return tvb_length(tvb);
770 }
771
772 static int
773 gdsdb_seek_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
774 {
775         /* int offset; */
776
777         if (tvb_length(tvb) < 16) {
778                 return 0;
779         }
780         if (tree) {
781 /* hf_gdsdb_seekblob_blob */
782 /* hf_gdsdb_seekblob_mode */
783         }
784
785         return tvb_length(tvb);
786 }
787
788 static int
789 gdsdb_reconnect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
790 {
791         /* int offset; */
792
793         if (tvb_length(tvb) < 12) {
794                 return 0;
795         }
796         if (tree) {
797 /* hf_gdsdb_reconnect_database */
798         }
799
800         return tvb_length(tvb);
801 }
802
803 static int
804 gdsdb_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
805 {
806         int offset;
807         int length;
808         guint opcode;
809
810         if (tvb_length(tvb) < 20) {
811                 return 0;
812         }
813
814         opcode = tvb_get_ntohl(tvb, 0);
815
816         if (tree) {
817                 offset = 4;
818                 proto_tree_add_item(tree, hf_gdsdb_info_object, tvb, offset,
819                                                                 4, ENC_BIG_ENDIAN);
820                 offset += 4;
821                 proto_tree_add_item(tree, hf_gdsdb_info_incarnation, tvb,
822                                                         offset, 4, ENC_BIG_ENDIAN);
823                 offset += 4;
824                 if(opcode == op_service_info) {
825                         proto_tree_add_item(tree, hf_gdsdb_info_items, tvb,
826                                                         offset, 4, ENC_ASCII|ENC_NA);
827                         length = tvb_get_ntohl(tvb, offset);
828                         offset += length + 6;
829                 }
830                 proto_tree_add_item(tree, hf_gdsdb_info_buffer_length, tvb,
831                                                         offset, 4, ENC_BIG_ENDIAN);
832         }
833
834         return tvb_length(tvb);
835 }
836
837 static int
838 gdsdb_service_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
839 {
840         /* int offset; */
841
842         if (tvb_length(tvb) < 16) {
843                 return 0;
844         }
845         if (tree) {
846 /* hf_gdsdb_info_object */
847 /* hf_gdsdb_info_incarnation */
848 /* hf_gdsdb_info_items */
849 /* hf_gdsdb_info_buffer_length */
850         }
851
852         return tvb_length(tvb);
853 }
854
855 static int
856 gdsdb_release(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
857 {
858         /* int offset; */
859
860         if (tvb_length(tvb) < 8) {
861                 return 0;
862         }
863         if (tree) {
864 /* hf_gdsdb_release_object */
865         }
866
867         return tvb_length(tvb);
868 }
869
870 #if 0
871 static int
872 gdsdb_prepare2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
873 {
874         /* int offset; */
875
876         if (tvb_length(tvb) < 12) {
877                 return 0;
878         }
879         if (tree) {
880 /* hf_gdsdb_prepare2_transaction */
881         }
882
883         return tvb_length(tvb);
884 }
885 #endif
886
887 static int
888 gdsdb_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
889 {
890          /* int offset; */
891
892         if (tvb_length(tvb) < 24) {
893                 return 0;
894         }
895         if (tree) {
896 /* hf_gdsdb_event_database */
897 /* hf_gdsdb_event_items */
898 /* hf_gdsdb_event_ast */
899 /* hf_gdsdb_event_arg */
900 /* hf_gdsdb_event_rid */
901         }
902         return tvb_length(tvb);
903 }
904
905 static int
906 gdsdb_cancel_events(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
907 {
908         /* int offset; */
909
910         if (tvb_length(tvb) < 12) {
911                 return 0;
912         }
913         if (tree) {
914 /* hf_gdsdb_event_database */
915         }
916
917         return tvb_length(tvb);
918 }
919
920 static int
921 gdsdb_ddl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
922 {
923         /* int offset; */
924
925         if (tvb_length(tvb) < 16) {
926                 return 0;
927         }
928         if (tree) {
929 /* hf_gdsdb_ddl_database */
930 /* hf_gdsdb_ddl_transaction */
931 /* hf_gdsdb_ddl_blr */
932         }
933
934         return tvb_length(tvb);
935 }
936
937 static int
938 gdsdb_slice(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
939 {
940         /* int offset; */
941
942         if (tvb_length(tvb) < 24) {
943                 return 0;
944         }
945         if (tree) {
946 /* hf_gdsdb_slice_transaction */
947 /* hf_gdsdb_slice_id */
948 /* hf_gdsdb_slice_sdl */
949 /* hf_gdsdb_slice_parameters */
950         }
951
952         return tvb_length(tvb);
953 }
954
955 static int
956 gdsdb_slice_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
957 {
958         /* int offset; */
959
960         if (tvb_length(tvb) < 8) {
961                 return 0;
962         }
963         if (tree) {
964 /* hf_gdsdb_sliceresponse_length */
965         }
966
967         return tvb_length(tvb);
968 }
969
970 static int
971 gdsdb_execute(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
972 {
973         /* int offset; */
974
975         if (tvb_length(tvb) < 12) {
976                 return 0;
977         }
978         if (tree) {
979 /* hf_gdsdb_execute_statement */
980 /* hf_gdsdb_execute_transaction */
981 /* hf_gdsdb_execute_message_number */
982 /* hf_gdsdb_execute_messages */
983         }
984
985         return tvb_length(tvb);
986 }
987
988 static int
989 gdsdb_exec_immediate2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
990 {
991         /* int offset; */
992
993         if (tvb_length(tvb) < 44) {
994                 return 0;
995         }
996         if (tree) {
997 /* hf_gdsdb_prepare2_blr */
998 /* hf_gdsdb_prepare2_number */
999 /* hf_gdsdb_prepare2_messages */
1000 /* hf_gdsdb_prepare2_outblr */
1001 /* hf_gdsdb_prepare2_outmsgnr */
1002         }
1003
1004         return tvb_length(tvb);
1005 }
1006
1007 static int
1008 gdsdb_prepare(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1009 {
1010         int offset;
1011         int length;
1012
1013         if (tvb_length(tvb) < 32) {
1014                 return 0;
1015         }
1016         if (check_col(pinfo->cinfo, COL_INFO)){
1017                 col_append_str(pinfo->cinfo, COL_INFO, ": ");
1018                 col_append_str(pinfo->cinfo, COL_INFO,
1019                         tvb_format_text(tvb, 20,
1020                                 tvb_get_ntohl(tvb, 16)));
1021         }
1022         if(tree) {
1023                 offset = 4;
1024                 proto_tree_add_item(tree, hf_gdsdb_prepare_transaction, tvb,
1025                                                         offset, 4, ENC_BIG_ENDIAN);
1026                 offset += 4;
1027                 proto_tree_add_item(tree, hf_gdsdb_prepare_statement, tvb,
1028                                                         offset, 4, ENC_BIG_ENDIAN);
1029                 offset += 4;
1030                 proto_tree_add_item(tree, hf_gdsdb_prepare_dialect, tvb,
1031                                                         offset, 4, ENC_BIG_ENDIAN);
1032                 offset += 4;
1033                 proto_tree_add_item(tree, hf_gdsdb_prepare_querystr, tvb,
1034                                                         offset, 4, ENC_ASCII|ENC_NA);
1035                 length = tvb_get_ntohl(tvb, offset);
1036                 offset += length + 6;
1037                 proto_tree_add_uint_format_value(tree,
1038                         hf_gdsdb_prepare_items, tvb, offset, 4 + length,
1039                                         length, "%i data bytes", length);
1040                 offset += tvb_get_ntohl(tvb, offset) + 6;
1041                 proto_tree_add_item(tree, hf_gdsdb_prepare_bufferlength, tvb,
1042                                                         offset, 2, ENC_BIG_ENDIAN);
1043         }
1044
1045         return tvb_length(tvb);
1046 }
1047
1048 static int
1049 gdsdb_fetch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1050 {
1051         /* int offset; */
1052
1053         if (tvb_length(tvb) < 16) {
1054                 return 0;
1055         }
1056         if (tree) {
1057 /* hf_gdsdb_fetch_statement */
1058 /* hf_gdsdb_fetch_message_number */
1059 /* hf_gdsdb_fetch_messages */
1060         }
1061
1062         return tvb_length(tvb);
1063 }
1064
1065 static int
1066 gdsdb_fetch_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1067 {
1068         /* int offset; */
1069
1070         if (tvb_length(tvb) < 12) {
1071                 return 0;
1072         }
1073         if (tree) {
1074 /* hf_gdsdb_fetchresponse_status */
1075 /* hf_gdsdb_fetchresponse_messages */
1076         }
1077
1078         return tvb_length(tvb);
1079 }
1080
1081 static int
1082 gdsdb_free_statement(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1083 {
1084         /* int offset; */
1085
1086         if (tvb_length(tvb) < 12) {
1087                 return 0;
1088         }
1089         if (tree) {
1090 /* hf_gdsdb_free_statement */
1091 /* hf_gdsdb_free_option */
1092         }
1093
1094         return tvb_length(tvb);
1095 }
1096
1097 static int
1098 gdsdb_insert(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1099 {
1100         /* int offset; */
1101
1102         if (tvb_length(tvb) < 16) {
1103                 return 0;
1104         }
1105         if (tree) {
1106 /* hf_gdsdb_insert_statement */
1107 /* hf_gdsdb_insert_message_number */
1108 /* hf_gdsdb_insert_messages */
1109         }
1110
1111         return tvb_length(tvb);
1112 }
1113
1114 static int
1115 gdsdb_cursor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1116 {
1117         /* int offset; */
1118
1119         if (tvb_length(tvb) < 16) {
1120                 return 0;
1121         }
1122         if (tree) {
1123 /* hf_gdsdb_cursor_statement */
1124 /* hf_gdsdb_cursor_type */
1125         }
1126
1127         return tvb_length(tvb);
1128 }
1129
1130 static int
1131 gdsdb_sql_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1132 {
1133         /* int offset; */
1134
1135         if (tvb_length(tvb) < 8) {
1136                 return 0;
1137         }
1138         if (tree) {
1139 /* hf_gdsdb_sqlresponse_messages */
1140         }
1141
1142         return tvb_length(tvb);
1143 }
1144
1145 static int (*gdsdb_handle_opcode[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) = {
1146         gdsdb_dummy,    /* op_void */
1147         gdsdb_connect,  /* op_connect */
1148         gdsdb_dummy,    /* op_exit */
1149         gdsdb_accept,   /* op_accept */
1150         gdsdb_dummy,    /* op_reject */
1151         gdsdb_dummy,    /* op_protocol */
1152         gdsdb_dummy,    /* op_disconnect */
1153         gdsdb_dummy,    /* op_credit */
1154         gdsdb_dummy,    /* op_continuation */
1155         gdsdb_response, /* op_response */
1156         gdsdb_dummy,    /* op_open_file */
1157         gdsdb_dummy,    /* op_create_file */
1158         gdsdb_dummy,    /* op_close_file */
1159         gdsdb_dummy,    /* op_read_page */
1160         gdsdb_dummy,    /* op_write_page */
1161         gdsdb_dummy,    /* op_lock */
1162         gdsdb_dummy,    /* op_convert_lock */
1163         gdsdb_dummy,    /* op_release_lock */
1164         gdsdb_dummy,    /* op_blocking */
1165         gdsdb_attach,   /* op_attach */
1166         gdsdb_attach,   /* op_create */
1167         gdsdb_release,  /* op_detach */
1168         gdsdb_compile,  /* op_compile */
1169         gdsdb_receive,  /* op_start */
1170         gdsdb_send,     /* op_start_and_send */
1171         gdsdb_send,     /* op_send */
1172         gdsdb_receive,  /* op_receive */
1173         gdsdb_release,  /* op_unwind */
1174         gdsdb_release,  /* op_release */
1175         gdsdb_reconnect,        /* op_transaction */
1176         gdsdb_release,  /* op_commit */
1177         gdsdb_release,  /* op_rollback */
1178         gdsdb_release,  /* op_prepare */
1179         gdsdb_reconnect,        /* op_reconnect */
1180         gdsdb_open_blob2,       /* op_create_blob */
1181         gdsdb_open_blob,        /* op_open_blob */
1182         gdsdb_segment,  /* op_get_segment */
1183         gdsdb_segment,  /* op_put_segment */
1184         gdsdb_release,  /* op_cancel_blob */
1185         gdsdb_release,  /* op_close_blob */
1186         gdsdb_info,     /* op_info_database */
1187         gdsdb_info,     /* op_info_request */
1188         gdsdb_info,     /* op_info_transaction */
1189         gdsdb_info,     /* op_info_blob */
1190         gdsdb_segment,  /* op_batch_segments */
1191         gdsdb_dummy,    /* op_mgr_set_affinity */
1192         gdsdb_dummy,    /* op_mgr_clear_affinity */
1193         gdsdb_dummy,    /* op_mgr_report */
1194         gdsdb_event,    /* op_que_events */
1195         gdsdb_cancel_events,    /* op_cancel_events */
1196         gdsdb_release,  /* op_commit_retaining */
1197         gdsdb_release,  /* op_prepare */
1198         gdsdb_event,    /* op_event */
1199         gdsdb_request,  /* op_connect_request */
1200         gdsdb_request,  /* op_aux_connect */
1201         gdsdb_ddl,      /* op_ddl */
1202         gdsdb_open_blob2,       /* op_open_blob2 */
1203         gdsdb_open_blob2,       /* op_create_blob2 */
1204         gdsdb_slice,    /* op_get_slice */
1205         gdsdb_slice,    /* op_put_slice */
1206         gdsdb_slice_response,   /* op_slice */
1207         gdsdb_seek_blob,        /* op_seek_blob */
1208         gdsdb_release,  /* op_allocate_statement */
1209         gdsdb_execute,  /* op_execute */
1210         gdsdb_prepare,  /* op_exec_immediate */
1211         gdsdb_fetch,    /* op_fetch */
1212         gdsdb_fetch_response,   /* op_fetch_response */
1213         gdsdb_free_statement,   /* op_free_statement */
1214         gdsdb_prepare,  /* op_prepare_statement */
1215         gdsdb_cursor,   /* op_set_cursor */
1216         gdsdb_info,     /* op_info_sql */
1217         gdsdb_dummy,    /* op_dummy */
1218         gdsdb_response, /* op_response_piggyback */
1219         gdsdb_receive,  /* op_start_and_receive */
1220         gdsdb_send,     /* op_start_send_and_receive */
1221         gdsdb_exec_immediate2,  /* op_exec_immediate2 */
1222         gdsdb_execute,  /* op_execute2 */
1223         gdsdb_insert,   /* op_insert */
1224         gdsdb_sql_response,     /* op_sql_response */
1225         gdsdb_transact, /* op_transact */
1226         gdsdb_transact_response,        /* op_transact_response */
1227         gdsdb_release,  /* op_drop_database */
1228         gdsdb_attach,   /* op_service_attach */
1229         gdsdb_release,  /* op_service_detach */
1230         gdsdb_info,     /* op_service_info */
1231         gdsdb_service_start,    /* op_service_start */
1232         gdsdb_release   /* op_rollback_retaining */
1233 };
1234
1235 static int
1236 dissect_gdsdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1237 {
1238         proto_item *ti;
1239         proto_tree *gdsdb_tree;
1240         guint opcode;
1241         packet_info nopi;
1242
1243         gdsdb_tree = NULL; /* So the opcode functions can check on if(tree) */
1244         nopi.cinfo = NULL;
1245
1246         if (tvb_length(tvb) < 4)
1247                 return 0;
1248
1249         opcode = tvb_get_ntohl(tvb, 0);
1250         if(opcode >= op_max)
1251                 return 0;
1252         if(!gdsdb_handle_opcode[opcode](tvb, &nopi, NULL))
1253                 return 0;
1254
1255         col_set_str(pinfo->cinfo, COL_PROTOCOL, "GDS DB");
1256
1257         if (check_col(pinfo->cinfo, COL_INFO))
1258                 col_add_str(pinfo->cinfo, COL_INFO,
1259                                 val_to_str(opcode, gdsdb_opcode, "Unknown opcode %u"));
1260
1261         if (tree) {
1262                 ti = proto_tree_add_item(tree, proto_gdsdb, tvb, 0, -1,
1263                                                                    ENC_NA);
1264                 gdsdb_tree = proto_item_add_subtree(ti, ett_gdsdb);
1265                 proto_tree_add_item(gdsdb_tree, hf_gdsdb_opcode, tvb,
1266                                                         0, 4, ENC_BIG_ENDIAN);
1267         }
1268
1269         /* opcode < op_max */
1270         return gdsdb_handle_opcode[opcode](tvb, pinfo, gdsdb_tree);
1271 }
1272
1273 void
1274 proto_register_gdsdb(void)
1275 {
1276         static hf_register_info hf[] = {
1277                 { &hf_gdsdb_opcode,
1278                         { "Opcode", "gdsdb.opcode",
1279                         FT_UINT32, BASE_DEC, VALS(gdsdb_opcode), 0x0,
1280                         NULL, HFILL }
1281                 },
1282                 /* gdsdb_dummy */
1283                 /* gdsdb_connect */
1284                 { &hf_gdsdb_connect_operation,
1285                         { "Operation", "gdsdb.connect.operation",
1286                         FT_UINT32, BASE_DEC, VALS(gdsdb_opcode), 0x0,
1287                         NULL, HFILL }
1288                 },
1289                 { &hf_gdsdb_connect_version,
1290                         { "Version", "gdsdb.connect.version",
1291                         FT_UINT32, BASE_DEC, NULL, 0x0,
1292                         NULL, HFILL }
1293                 },
1294                 { &hf_gdsdb_connect_client,
1295                         { "Client Architecture", "gdsdb.connect.client",
1296                         FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1297                         NULL, HFILL }
1298                 },
1299                 { &hf_gdsdb_connect_filename,
1300                         { "Filename", "gdsdb.connect.filename",
1301                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1302                         NULL, HFILL }
1303                 },
1304                 { &hf_gdsdb_connect_count,
1305                         { "Version option count", "gdsdb.connect.count",
1306                         FT_UINT32, BASE_DEC, NULL, 0x0,
1307                         NULL, HFILL }
1308                 },
1309                 { &hf_gdsdb_connect_userid,
1310                         { "User ID", "gdsdb.connect.userid",
1311                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1312                         NULL, HFILL }
1313                 },
1314                 { &hf_gdsdb_connect_pref,
1315                         { "Preferred version", "gdsdb.connect.pref",
1316                         FT_NONE, BASE_NONE, NULL, 0x0,
1317                         NULL, HFILL }
1318                 },
1319                 { &hf_gdsdb_connect_pref_version,
1320                         { "Version", "gdsdb.connect.pref.version",
1321                         FT_UINT32, BASE_DEC, NULL, 0x0,
1322                         NULL, HFILL }
1323                 },
1324                 { &hf_gdsdb_connect_pref_architecture,
1325                         { "Architecture", "gdsdb.connect.pref.arch",
1326                         FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1327                         NULL, HFILL }
1328                 },
1329                 { &hf_gdsdb_connect_pref_mintype,
1330                         { "Minimum type", "gdsdb.connect.pref.mintype",
1331                         FT_UINT32, BASE_DEC, NULL, 0x0,
1332                         NULL, HFILL }
1333                 },
1334                 { &hf_gdsdb_connect_pref_maxtype,
1335                         { "Maximum type", "gdsdb.connect.pref.maxtype",
1336                         FT_UINT32, BASE_DEC, NULL, 0x0,
1337                         NULL, HFILL }
1338                 },
1339                 { &hf_gdsdb_connect_pref_weight,
1340                         { "Preference weight", "gdsdb.connect.pref.weight",
1341                         FT_UINT32, BASE_DEC, NULL, 0x0,
1342                         NULL, HFILL }
1343                 },
1344                 /* gdsdb_accept */
1345                 { &hf_gdsdb_accept_version,
1346                         { "Version", "gdsdb.accept.version",
1347                         FT_UINT32, BASE_DEC, NULL, 0x0,
1348                         NULL, HFILL }
1349                 },
1350                 { &hf_gdsdb_accept_architecture,
1351                         { "Architecture", "gdsdb.accept.arch",
1352                         FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1353                         NULL, HFILL }
1354                 },
1355                 /* gdsdb_request */
1356                 { &hf_gdsdb_request_type,
1357                         { "Type", "gdsdb.connect.type",
1358                         FT_UINT32, BASE_DEC, NULL, 0x0,
1359                         NULL, HFILL }
1360                 },
1361                 { &hf_gdsdb_request_object,
1362                         { "Object", "gdsdb.connect.object",
1363                         FT_UINT32, BASE_DEC, NULL, 0x0,
1364                         NULL, HFILL }
1365                 },
1366                 { &hf_gdsdb_request_partner,
1367                         { "Partner", "gdsdb.connect.partner",
1368                         FT_UINT64, BASE_DEC, NULL, 0x0,
1369                         NULL, HFILL }
1370                 },
1371                 /* gdsdb_attach */
1372                 { &hf_gdsdb_attach_database,
1373                         { "Database", "gdsdb.attach.database",
1374                         FT_UINT32, BASE_DEC, NULL, 0x0,
1375                         NULL, HFILL }
1376                 },
1377                 { &hf_gdsdb_attach_filename,
1378                         { "Filename", "gdsdb.attach.filename",
1379                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1380                         NULL, HFILL }
1381                 },
1382                 { &hf_gdsdb_attach_dpb,
1383                         { "Database parameter block", "gdsdb.attach.dpblength",
1384                         FT_UINT32, BASE_DEC, NULL, 0x0,
1385                         NULL, HFILL }
1386                 },
1387                 /* gdsdb_compile */
1388                 { &hf_gdsdb_compile_database,
1389                         { "Database", "gdsdb.compile.filename",
1390                         FT_UINT32, BASE_DEC, NULL, 0x0,
1391                         NULL, HFILL }
1392                 },
1393                 { &hf_gdsdb_compile_blr,
1394                         { "BLR", "gdsdb.compile.blr",
1395                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1396                         NULL, HFILL }
1397                 },
1398                 /* gdsdb_receive */
1399                 { &hf_gdsdb_receive_request,
1400                         { "Request", "gdsdb.receive.request",
1401                         FT_UINT32, BASE_DEC, NULL, 0x0,
1402                         NULL, HFILL }
1403                 },
1404                 { &hf_gdsdb_receive_incarnation,
1405                         { "Incarnation", "gdsdb.receive.incarnation",
1406                         FT_UINT32, BASE_DEC, NULL, 0x0,
1407                         NULL, HFILL }
1408                 },
1409                 { &hf_gdsdb_receive_transaction,
1410                         { "Transaction", "gdsdb.receive.transaction",
1411                         FT_UINT32, BASE_DEC, NULL, 0x0,
1412                         NULL, HFILL }
1413                 },
1414                 { &hf_gdsdb_receive_msgnr,
1415                         { "Message number", "gdsdb.receive.msgnr",
1416                         FT_UINT32, BASE_DEC, NULL, 0x0,
1417                         NULL, HFILL }
1418                 },
1419                 { &hf_gdsdb_receive_messages,
1420                         { "Message Count", "gdsdb.receive.msgcount",
1421                         FT_UINT32, BASE_DEC, NULL, 0x0,
1422                         NULL, HFILL }
1423                 },
1424                 { &hf_gdsdb_receive_direction,
1425                         { "Scroll direction", "gdsdb.receive.direction",
1426                         FT_UINT32, BASE_DEC, NULL, 0x0,
1427                         NULL, HFILL }
1428                 },
1429                 { &hf_gdsdb_receive_offset,
1430                         { "Scroll offset", "gdsdb.receive.offset",
1431                         FT_UINT32, BASE_DEC, NULL, 0x0,
1432                         NULL, HFILL }
1433                 },
1434                 /* gdsdb_send */
1435                 { &hf_gdsdb_send_request,
1436                         { "Send request", "gdsdb.send.request",
1437                         FT_UINT32, BASE_DEC, NULL, 0x0,
1438                         NULL, HFILL }
1439                 },
1440                 { &hf_gdsdb_send_incarnation,
1441                         { "Send request", "gdsdb.send.incarnation",
1442                         FT_UINT32, BASE_DEC, NULL, 0x0,
1443                         NULL, HFILL }
1444                 },
1445                 { &hf_gdsdb_send_transaction,
1446                         { "Send request", "gdsdb.send.transaction",
1447                         FT_UINT32, BASE_DEC, NULL, 0x0,
1448                         NULL, HFILL }
1449                 },
1450                 { &hf_gdsdb_send_msgnr,
1451                         { "Send request", "gdsdb.send.msgnr",
1452                         FT_UINT32, BASE_DEC, NULL, 0x0,
1453                         NULL, HFILL }
1454                 },
1455                 { &hf_gdsdb_send_messages,
1456                         { "Send request", "gdsdb.send.messages",
1457                         FT_UINT32, BASE_DEC, NULL, 0x0,
1458                         NULL, HFILL }
1459                 },
1460                 /* gdsdb_response */
1461                 { &hf_gdsdb_response_object,
1462                         { "Response object", "gdsdb.response.object",
1463                         FT_UINT32, BASE_HEX, NULL, 0x0,
1464                         NULL, HFILL }
1465                 },
1466                 { &hf_gdsdb_response_blobid,
1467                         { "Blob ID", "gdsdb.response.blobid",
1468                         FT_UINT64, BASE_HEX, NULL, 0x0,
1469                         NULL, HFILL }
1470                 },
1471                 { &hf_gdsdb_response_data,
1472                         { "Data", "gdsdb.response.data",
1473                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1474                         NULL, HFILL }
1475                 },
1476                 { &hf_gdsdb_response_status,
1477                         { "Status vector", "gdsdb.response.status",
1478                         FT_NONE, BASE_NONE, NULL, 0x0,
1479                         NULL, HFILL }
1480                 },
1481                 /* gdsdb_transact */
1482                 { &hf_gdsdb_transact_database,
1483                         { "Database", "gdsdb.transact.database",
1484                         FT_UINT32, BASE_DEC, NULL, 0x0,
1485                         NULL, HFILL }
1486                 },
1487                 { &hf_gdsdb_transact_transaction,
1488                         { "Database", "gdsdb.transact.transaction",
1489                         FT_UINT32, BASE_DEC, NULL, 0x0,
1490                         NULL, HFILL }
1491                 },
1492                 { &hf_gdsdb_transact_messages,
1493                         { "Messages", "gdsdb.transact.messages",
1494                         FT_UINT32, BASE_DEC, NULL, 0x0,
1495                         NULL, HFILL }
1496                 },
1497                 /* gdsdb_transact_response */
1498                 { &hf_gdsdb_transactresponse_messages,
1499                         { "Messages", "gdsdb.transactresponse.messages",
1500                         FT_UINT32, BASE_DEC, NULL, 0x0,
1501                         NULL, HFILL }
1502                 },
1503                 /* gdsdb_open_blob2 */
1504                 { &hf_gdsdb_openblob2_bpb,
1505                         { "Blob parameter block", "gdsdb.openblob2.bpb",
1506                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1507                         NULL, HFILL }
1508                 },
1509                 /* gdsdb_open_blob */
1510                 { &hf_gdsdb_openblob_transaction,
1511                         { "Transaction", "gdsdb.openblob2.transaction",
1512                         FT_UINT32, BASE_DEC, NULL, 0x0,
1513                         NULL, HFILL }
1514                 },
1515                 { &hf_gdsdb_openblob_id,
1516                         { "ID", "gdsdb.openblob.id",
1517                         FT_UINT64, BASE_HEX, NULL, 0x0,
1518                         NULL, HFILL }
1519                 },
1520                 /* gdsdb_segment */
1521                 { &hf_gdsdb_segment_blob,
1522                         { "Blob", "gdsdb.segment.blob",
1523                         FT_UINT32, BASE_DEC, NULL, 0x0,
1524                         NULL, HFILL }
1525                 },
1526                 { &hf_gdsdb_segment_length,
1527                         { "Length", "gdsdb.segment.length",
1528                         FT_UINT32, BASE_DEC, NULL, 0x0,
1529                         NULL, HFILL }
1530                 },
1531                 { &hf_gdsdb_segment_segment,
1532                         { "Segment", "gdsdb.segment.segment",
1533                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1534                         NULL, HFILL }
1535                 },
1536                 /* gdsdb_seek_blob */
1537                 { &hf_gdsdb_seekblob_blob,
1538                         { "Blob", "gdsdb.seekblob.blob",
1539                         FT_UINT32, BASE_DEC, NULL, 0x0,
1540                         NULL, HFILL }
1541                 },
1542                 { &hf_gdsdb_seekblob_mode,
1543                         { "Mode", "gdsdb.seekblob.mode",
1544                         FT_UINT32, BASE_DEC, NULL, 0x0,
1545                         NULL, HFILL }
1546                 },
1547                 /* gdsdb_reconnect */
1548                 { &hf_gdsdb_reconnect_database,
1549                         { "Database", "gdsdb.reconnect.database",
1550                         FT_UINT32, BASE_DEC, NULL, 0x0,
1551                         NULL, HFILL }
1552                 },
1553                 /* gdsdb_info & gdsdb_service_start */
1554                 { &hf_gdsdb_info_object,
1555                         { "Object", "gdsdb.info.object",
1556                         FT_UINT32, BASE_DEC, NULL, 0x0,
1557                         NULL, HFILL }
1558                 },
1559                 { &hf_gdsdb_info_incarnation,
1560                         { "Incarnation", "gdsdb.info.incarnation",
1561                         FT_UINT32, BASE_DEC, NULL, 0x0,
1562                         NULL, HFILL }
1563                 },
1564                 { &hf_gdsdb_info_items,
1565                         { "Items", "gdsdb.info.items",
1566                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1567                         NULL, HFILL }
1568                 },
1569                 { &hf_gdsdb_info_buffer_length,
1570                         { "Buffer length", "gdsdb.info.bufferlength",
1571                         FT_UINT32, BASE_DEC, NULL, 0x0,
1572                         NULL, HFILL }
1573                 },
1574                 /* gdsdb_release */
1575                 { &hf_gdsdb_release_object,
1576                         { "Object", "gdsdb.release.object",
1577                         FT_UINT32, BASE_DEC, NULL, 0x0,
1578                         NULL, HFILL }
1579                 },
1580                 /* gdsdb_prepare2 */
1581                 { &hf_gdsdb_prepare2_transaction,
1582                         { "Transaction", "gdsdb.prepare2.transaction",
1583                         FT_UINT32, BASE_DEC, NULL, 0x0,
1584                         NULL, HFILL }
1585                 },
1586                 /* gdsdb_event & gdsdb_cancel_events */
1587                 { &hf_gdsdb_event_database,
1588                         { "Database", "gdsdb.event.database",
1589                         FT_UINT32, BASE_DEC, NULL, 0x0,
1590                         NULL, HFILL }
1591                 },
1592                 { &hf_gdsdb_event_items,
1593                         { "Event description block", "gdsdb.event.items",
1594                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1595                         NULL, HFILL }
1596                 },
1597                 { &hf_gdsdb_event_ast,
1598                         { "ast routine", "gdsdb.event.ast",
1599                         FT_UINT32, BASE_DEC, NULL, 0x0,
1600                         NULL, HFILL }
1601                 },
1602                 { &hf_gdsdb_event_arg,
1603                         { "Argument to ast routine", "gdsdb.event.arg",
1604                         FT_UINT32, BASE_DEC, NULL, 0x0,
1605                         NULL, HFILL }
1606                 },
1607                 { &hf_gdsdb_event_rid,
1608                         { "ID", "gdsdb.event.id",
1609                         FT_UINT32, BASE_DEC, NULL, 0x0,
1610                         NULL, HFILL }
1611                 },
1612                 /* gdsdb_ddl */
1613                 { &hf_gdsdb_ddl_database,
1614                         { "Database", "gdsdb.ddl.database",
1615                         FT_UINT32, BASE_DEC, NULL, 0x0,
1616                         NULL, HFILL }
1617                 },
1618                 { &hf_gdsdb_ddl_transaction,
1619                         { "Transaction", "gdsdb.ddl.transaction",
1620                         FT_UINT32, BASE_DEC, NULL, 0x0,
1621                         NULL, HFILL }
1622                 },
1623                 { &hf_gdsdb_ddl_blr,
1624                         { "BLR", "gdsdb.ddl.blr",
1625                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1626                         NULL, HFILL }
1627                 },
1628                 /* gdsdb_slice */
1629                 { &hf_gdsdb_slice_transaction,
1630                         { "Transaction", "gdsdb.slice.transaction",
1631                         FT_UINT32, BASE_DEC, NULL, 0x0,
1632                         NULL, HFILL }
1633                 },
1634                 { &hf_gdsdb_slice_id,
1635                         { "ID", "gdsdb.slice.id",
1636                         FT_UINT64, BASE_HEX, NULL, 0x0,
1637                         NULL, HFILL }
1638                 },
1639                 { &hf_gdsdb_slice_sdl,
1640                         { "Slice description language", "gdsdb.slice.sdl",
1641                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1642                         NULL, HFILL }
1643                 },
1644                 { &hf_gdsdb_slice_parameters,
1645                         { "Parameters", "gdsdb.slice.parameters",
1646                         FT_UINT32, BASE_DEC, NULL, 0x0,
1647                         NULL, HFILL }
1648                 },
1649                 /* gdsdb_slice_response */
1650                 { &hf_gdsdb_sliceresponse_length,
1651                         { "Length", "gdsdb.sliceresponse.length",
1652                         FT_UINT32, BASE_DEC, NULL, 0x0,
1653                         NULL, HFILL }
1654                 },
1655                 /* gdsdb_execute */
1656                 { &hf_gdsdb_execute_statement,
1657                         { "Statement", "gdsdb.execute.statement",
1658                         FT_UINT32, BASE_DEC, NULL, 0x0,
1659                         NULL, HFILL }
1660                 },
1661                 { &hf_gdsdb_execute_transaction,
1662                         { "Transaction", "gdsdb.execute.transaction",
1663                         FT_UINT32, BASE_DEC, NULL, 0x0,
1664                         NULL, HFILL }
1665                 },
1666                 { &hf_gdsdb_execute_message_number,
1667                         { "Message number", "gdsdb.execute.messagenumber",
1668                         FT_UINT32, BASE_DEC, NULL, 0x0,
1669                         NULL, HFILL }
1670                 },
1671                 { &hf_gdsdb_execute_messages,
1672                         { "Number of messages", "gdsdb.execute.messages",
1673                         FT_UINT32, BASE_DEC, NULL, 0x0,
1674                         NULL, HFILL }
1675                 },
1676                 /* gdsdb_execute2 */
1677                 { &hf_gdsdb_execute_outblr,
1678                         { "Output BLR", "gdsdb.execute.outblr",
1679                         FT_UINT32, BASE_DEC, NULL, 0x0,
1680                         NULL, HFILL }
1681                 },
1682                 { &hf_gdsdb_execute_outmsgnr,
1683                         { "Output Message number", "gdsdb.execute.outmsgnr",
1684                         FT_UINT32, BASE_DEC, NULL, 0x0,
1685                         NULL, HFILL }
1686                 },
1687                 /* gdsdb_exec_immediate2 */
1688                 { &hf_gdsdb_prepare2_blr,
1689                         { "BLR", "gdsdb.prepare.blr",
1690                         FT_UINT32, BASE_DEC, NULL, 0x0,
1691                         NULL, HFILL }
1692                 },
1693                 { &hf_gdsdb_prepare2_number,
1694                         { "Message number", "gdsdb.prepare2.messagenumber",
1695                         FT_UINT32, BASE_DEC, NULL, 0x0,
1696                         NULL, HFILL }
1697                 },
1698                 { &hf_gdsdb_prepare2_messages,
1699                         { "Number of messages", "gdsdb.prepare2.messages",
1700                         FT_UINT32, BASE_DEC, NULL, 0x0,
1701                         NULL, HFILL }
1702                 },
1703                 { &hf_gdsdb_prepare2_outblr,
1704                         { "Output BLR", "gdsdb.prepare2.outblr",
1705                         FT_UINT32, BASE_DEC, NULL, 0x0,
1706                         NULL, HFILL }
1707                 },
1708                 { &hf_gdsdb_prepare2_outmsgnr,
1709                         { "Output Message number", "gdsdb.prepare2.outmsgnr",
1710                         FT_UINT32, BASE_DEC, NULL, 0x0,
1711                         NULL, HFILL }
1712                 },
1713                 /* gdsdb_prepare */
1714                 { &hf_gdsdb_prepare_transaction,
1715                         { "Prepare, Transaction", "gdsdb.prepare.transaction",
1716                         FT_UINT32, BASE_DEC, NULL, 0x0,
1717                         NULL, HFILL }
1718                 },
1719                 { &hf_gdsdb_prepare_statement,
1720                         { "Prepare, Statement", "gdsdb.prepare.statement",
1721                         FT_UINT32, BASE_DEC, NULL, 0x0,
1722                         NULL, HFILL }
1723                 },
1724                 { &hf_gdsdb_prepare_dialect,
1725                         { "Prepare, Dialect", "gdsdb.prepare.dialect",
1726                         FT_UINT32, BASE_DEC, NULL, 0x0,
1727                         NULL, HFILL }
1728                 },
1729                 { &hf_gdsdb_prepare_querystr,
1730                         { "Prepare, Query", "gdsdb.prepare.querystr",
1731                         FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1732                         NULL, HFILL }
1733                 },
1734                 { &hf_gdsdb_prepare_items,
1735                         { "Prepare, Information items", "gdsdb.prepare.items",
1736                         FT_UINT32, BASE_DEC, NULL, 0x0,
1737                         NULL, HFILL }
1738                 },
1739                 { &hf_gdsdb_prepare_bufferlength,
1740                         { "Prepare, Bufferlength", "gdsdb.prepare.bufferlen",
1741                         FT_UINT32, BASE_DEC, NULL, 0x0,
1742                         NULL, HFILL }
1743                 },
1744                 /* gdsdb_fetch */
1745                 { &hf_gdsdb_fetch_statement,
1746                         { "Statement", "gdsdb.fetch.statement",
1747                         FT_UINT32, BASE_DEC, NULL, 0x0,
1748                         NULL, HFILL }
1749                 },
1750                 { &hf_gdsdb_fetch_message_number,
1751                         { "Message number", "gdsdb.fetch.messagenr",
1752                         FT_UINT32, BASE_DEC, NULL, 0x0,
1753                         NULL, HFILL }
1754                 },
1755                 { &hf_gdsdb_fetch_messages,
1756                         { "Number of messages", "gdsdb.fetch.messages",
1757                         FT_UINT32, BASE_DEC, NULL, 0x0,
1758                         NULL, HFILL }
1759                 },
1760                 /* gdsdb_fetch_response */
1761                 { &hf_gdsdb_fetchresponse_status,
1762                         { "Status", "gdsdb.fetchresponse.status",
1763                         FT_UINT32, BASE_DEC, NULL, 0x0,
1764                         NULL, HFILL }
1765                 },
1766                 { &hf_gdsdb_fetchresponse_messages,
1767                         { "Number of messages", "gdsdb.fetchresponse.messages",
1768                         FT_UINT32, BASE_DEC, NULL, 0x0,
1769                         NULL, HFILL }
1770                 },
1771                 /* gdsdb_free_statement */
1772                 { &hf_gdsdb_free_statement,
1773                         { "Statement", "gdsdb.fetchresponse.statement",
1774                         FT_UINT32, BASE_DEC, NULL, 0x0,
1775                         NULL, HFILL }
1776                 },
1777                 { &hf_gdsdb_free_option,
1778                         { "Option", "gdsdb.fetchresponse.option",
1779                         FT_UINT32, BASE_DEC, NULL, 0x0,
1780                         NULL, HFILL }
1781                 },
1782                 /* gdsdb_insert */
1783                 { &hf_gdsdb_insert_statement,
1784                         { "Statement", "gdsdb.insert.statement",
1785                         FT_UINT32, BASE_DEC, NULL, 0x0,
1786                         NULL, HFILL }
1787                 },
1788                 { &hf_gdsdb_insert_message_number,
1789                         { "Message number", "gdsdb.insert.messagenr",
1790                         FT_UINT32, BASE_DEC, NULL, 0x0,
1791                         NULL, HFILL }
1792                 },
1793                 { &hf_gdsdb_insert_messages,
1794                         { "Number of messages", "gdsdb.insert.messages",
1795                         FT_UINT32, BASE_DEC, NULL, 0x0,
1796                         NULL, HFILL }
1797                 },
1798                 /* gdsdb_cursor */
1799                 { &hf_gdsdb_cursor_statement,
1800                         { "Statement", "gdsdb.cursor.statement",
1801                         FT_UINT32, BASE_DEC, NULL, 0x0,
1802                         NULL, HFILL }
1803                 },
1804                 { &hf_gdsdb_cursor_type,
1805                         { "Type", "gdsdb.cursor.type",
1806                         FT_UINT32, BASE_DEC, NULL, 0x0,
1807                         NULL, HFILL }
1808                 },
1809                 /* gdsdb_sql_response */
1810                 { &hf_gdsdb_sqlresponse_messages,
1811                         { "SQL Response, Message Count", "gdsdb.sqlresponse.msgcount",
1812                         FT_UINT32, BASE_DEC, NULL, 0x0,
1813                         NULL, HFILL }
1814                 }
1815         };
1816
1817         static gint *ett[] = {
1818                 &ett_gdsdb,
1819                 &ett_gdsdb_opcode,
1820                 &ett_gdsdb_connect_pref
1821         };
1822
1823         proto_gdsdb = proto_register_protocol(
1824                 "Firebird SQL Database Remote Protocol",
1825                 "FB/IB GDS DB", "gdsdb");
1826
1827         proto_register_field_array(proto_gdsdb, hf, array_length(hf));
1828         proto_register_subtree_array(ett, array_length(ett));
1829 }
1830
1831 void
1832 proto_reg_handoff_gdsdb(void)
1833 {
1834         /* Main dissector */
1835
1836         dissector_handle_t gdsdb_handle;
1837
1838         gdsdb_handle = new_create_dissector_handle(dissect_gdsdb,
1839                                                                  proto_gdsdb);
1840         dissector_add_uint("tcp.port", TCP_PORT, gdsdb_handle);
1841 }