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