2 * Routines for Firebird/Interbase dissection
3 * Copyright 2007, Moshe van der Sterre <moshevds@gmail.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
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.
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.
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.
30 #include <epan/packet.h>
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;
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;
55 static int hf_gdsdb_accept_version = -1;
56 static int hf_gdsdb_accept_architecture = -1;
58 static int hf_gdsdb_request_type = -1;
59 static int hf_gdsdb_request_object = -1;
60 static int hf_gdsdb_request_partner = -1;
62 static int hf_gdsdb_attach_database = -1;
63 static int hf_gdsdb_attach_filename = -1;
64 static int hf_gdsdb_attach_dpb = -1;
66 static int hf_gdsdb_compile_database = -1;
67 static int hf_gdsdb_compile_blr = -1;
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;
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;
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;
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;
96 static int hf_gdsdb_openblob_transaction = -1;
97 static int hf_gdsdb_openblob_id = -1;
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;
113 static int hf_gdsdb_release_object = -1;
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;
123 static int hf_gdsdb_ddl_database = -1;
124 static int hf_gdsdb_ddl_transaction = -1;
125 static int hf_gdsdb_ddl_blr = -1;
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;
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;
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;
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;
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;
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;
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;
192 op_convert_lock = 16,
193 op_release_lock = 17,
200 op_start_and_send = 24,
216 op_info_database = 40,
217 op_info_request = 41,
218 op_info_transaction = 42,
220 op_batch_segments = 44,
221 op_mgr_set_affinity = 45,
222 op_mgr_clear_affinity = 46,
225 op_cancel_events = 49,
226 op_commit_retaining = 50,
229 op_connect_request = 53,
233 op_create_blob2 = 57,
238 op_allocate_statement = 62,
240 op_exec_immediate = 64,
242 op_fetch_response = 66,
243 op_free_statement = 67,
244 op_prepare_statement = 68,
248 op_response_piggyback = 72,
249 op_start_and_receive = 73,
250 op_start_send_and_receive = 74,
251 op_exec_immediate2 = 75,
254 op_sql_response = 78,
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,
266 static const value_string gdsdb_opcode[] = {
268 { op_connect, "Connect" },
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" },
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" },
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" },
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" },
357 static const value_string gdsdb_architectures[] = {
372 { 15, "mips Ultrix" },
377 { 20, "Apollo_dn10k" },
396 { 39, "Darwin PPC" },
401 gdsdb_dummy(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
403 /* Don't tell them we match */
408 gdsdb_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
415 proto_tree *pref_tree;
417 if (tvb_length(tvb) < 16) {
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)));
428 proto_tree_add_item(tree, hf_gdsdb_connect_operation, tvb,
429 offset, 4, ENC_BIG_ENDIAN);
431 proto_tree_add_item(tree, hf_gdsdb_connect_version, tvb,
432 offset, 4, ENC_BIG_ENDIAN);
434 proto_tree_add_item(tree, hf_gdsdb_connect_client, tvb,
435 offset, 4, ENC_BIG_ENDIAN);
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);
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);
458 proto_tree_add_item(pref_tree,
459 hf_gdsdb_connect_pref_architecture,
460 tvb, offset, 4, ENC_BIG_ENDIAN);
462 proto_tree_add_item(pref_tree,
463 hf_gdsdb_connect_pref_mintype,
464 tvb, offset, 4, ENC_BIG_ENDIAN);
466 proto_tree_add_item(pref_tree,
467 hf_gdsdb_connect_pref_maxtype,
468 tvb, offset, 4, ENC_BIG_ENDIAN);
470 proto_tree_add_item(pref_tree,
471 hf_gdsdb_connect_pref_weight,
472 tvb, offset, 4, ENC_BIG_ENDIAN);
477 return tvb_length(tvb);
481 gdsdb_accept(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
485 if (tvb_length(tvb) < 16) {
490 proto_tree_add_item(tree, hf_gdsdb_accept_version, tvb,
491 offset, 4, ENC_BIG_ENDIAN);
493 proto_tree_add_item(tree, hf_gdsdb_accept_architecture, tvb,
494 offset, 4, ENC_BIG_ENDIAN);
498 return tvb_length(tvb);
502 gdsdb_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
506 if (tvb_length(tvb) < 20) {
511 proto_tree_add_item(tree, hf_gdsdb_request_type, tvb,
512 offset, 4, ENC_BIG_ENDIAN);
514 proto_tree_add_item(tree, hf_gdsdb_request_object, tvb,
515 offset, 4, ENC_BIG_ENDIAN);
517 proto_tree_add_item(tree, hf_gdsdb_request_partner, tvb,
518 offset, 8, ENC_BIG_ENDIAN);
521 return tvb_length(tvb);
525 gdsdb_attach(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
530 if (tvb_length(tvb) < 20) {
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)));
541 proto_tree_add_item(tree, hf_gdsdb_attach_database, tvb,
542 offset, 4, ENC_BIG_ENDIAN);
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);
553 return tvb_length(tvb);
557 gdsdb_compile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
561 if (tvb_length(tvb) < 20) {
566 proto_tree_add_item(tree, hf_gdsdb_compile_database, tvb,
567 offset, 4, ENC_BIG_ENDIAN);
569 proto_tree_add_item(tree, hf_gdsdb_compile_blr, tvb,
570 offset, 4, ENC_ASCII|ENC_NA);
573 return tvb_length(tvb);
577 gdsdb_receive(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
581 if (tvb_length(tvb) < 20) {
586 proto_tree_add_item(tree, hf_gdsdb_receive_request, tvb,
587 offset, 4, ENC_BIG_ENDIAN);
589 proto_tree_add_item(tree, hf_gdsdb_receive_incarnation, tvb,
590 offset, 4, ENC_BIG_ENDIAN);
592 proto_tree_add_item(tree, hf_gdsdb_receive_transaction, tvb,
593 offset, 4, ENC_BIG_ENDIAN);
595 proto_tree_add_item(tree, hf_gdsdb_receive_msgnr, tvb,
596 offset, 4, ENC_BIG_ENDIAN);
598 proto_tree_add_item(tree, hf_gdsdb_receive_messages, tvb,
599 offset, 4, ENC_BIG_ENDIAN);
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);
605 proto_tree_add_item(tree, hf_gdsdb_receive_offset,
606 tvb, offset, 8, ENC_BIG_ENDIAN);
611 return tvb_length(tvb);
615 gdsdb_send(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
619 if (tvb_length(tvb) < 20) {
624 proto_tree_add_item(tree, hf_gdsdb_send_request, tvb,
625 offset, 4, ENC_BIG_ENDIAN);
627 proto_tree_add_item(tree, hf_gdsdb_send_incarnation, tvb,
628 offset, 4, ENC_BIG_ENDIAN);
630 proto_tree_add_item(tree, hf_gdsdb_send_transaction, tvb,
631 offset, 4, ENC_BIG_ENDIAN);
633 proto_tree_add_item(tree, hf_gdsdb_send_msgnr, tvb,
634 offset, 4, ENC_BIG_ENDIAN);
636 proto_tree_add_item(tree, hf_gdsdb_send_messages, tvb,
637 offset, 4, ENC_BIG_ENDIAN);
640 return tvb_length(tvb);
644 gdsdb_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
649 if (tvb_length(tvb) < 32) {
654 proto_tree_add_item(tree, hf_gdsdb_response_object, tvb,
655 offset, 4, ENC_BIG_ENDIAN);
657 proto_tree_add_item(tree, hf_gdsdb_response_blobid, tvb,
658 offset, 8, ENC_BIG_ENDIAN);
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);
668 return tvb_length(tvb);
673 gdsdb_transact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
677 if (tvb_length(tvb) < 20) {
682 proto_tree_add_item(tree, hf_gdsdb_transact_database, tvb,
683 offset, 4, ENC_BIG_ENDIAN);
685 proto_tree_add_item(tree, hf_gdsdb_transact_transaction, tvb,
686 offset, 4, ENC_BIG_ENDIAN);
689 return tvb_length(tvb);
693 gdsdb_transact_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
698 if (tvb_length(tvb) < 8) {
703 proto_tree_add_item(tree, hf_gdsdb_transactresponse_messages,
704 tvb, offset, 4, ENC_BIG_ENDIAN);
707 return tvb_length(tvb);
711 gdsdb_open_blob2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
716 if (!tvb_bytes_exist(tvb, 0, 20)) {
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);
728 proto_tree_add_item(tree, hf_gdsdb_openblob_id, tvb, offset,
732 return tvb_length(tvb);
736 gdsdb_open_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
740 if (tvb_length(tvb) < 16) {
745 proto_tree_add_item(tree, hf_gdsdb_openblob_transaction, tvb,
746 offset, 4, ENC_BIG_ENDIAN);
748 proto_tree_add_item(tree, hf_gdsdb_openblob_id, tvb, offset,
752 return tvb_length(tvb);
756 gdsdb_segment(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
760 if (tvb_length(tvb) < 16) {
764 /* hf_gdsdb_segment_blob */
765 /* hf_gdsdb_segment_length */
766 /* hf_gdsdb_segment_segment */
769 return tvb_length(tvb);
773 gdsdb_seek_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
777 if (tvb_length(tvb) < 16) {
781 /* hf_gdsdb_seekblob_blob */
782 /* hf_gdsdb_seekblob_mode */
785 return tvb_length(tvb);
789 gdsdb_reconnect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
793 if (tvb_length(tvb) < 12) {
797 /* hf_gdsdb_reconnect_database */
800 return tvb_length(tvb);
804 gdsdb_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
810 if (tvb_length(tvb) < 20) {
814 opcode = tvb_get_ntohl(tvb, 0);
818 proto_tree_add_item(tree, hf_gdsdb_info_object, tvb, offset,
821 proto_tree_add_item(tree, hf_gdsdb_info_incarnation, tvb,
822 offset, 4, ENC_BIG_ENDIAN);
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;
830 proto_tree_add_item(tree, hf_gdsdb_info_buffer_length, tvb,
831 offset, 4, ENC_BIG_ENDIAN);
834 return tvb_length(tvb);
838 gdsdb_service_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
842 if (tvb_length(tvb) < 16) {
846 /* hf_gdsdb_info_object */
847 /* hf_gdsdb_info_incarnation */
848 /* hf_gdsdb_info_items */
849 /* hf_gdsdb_info_buffer_length */
852 return tvb_length(tvb);
856 gdsdb_release(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
860 if (tvb_length(tvb) < 8) {
864 /* hf_gdsdb_release_object */
867 return tvb_length(tvb);
872 gdsdb_prepare2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
876 if (tvb_length(tvb) < 12) {
880 /* hf_gdsdb_prepare2_transaction */
883 return tvb_length(tvb);
888 gdsdb_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
892 if (tvb_length(tvb) < 24) {
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 */
902 return tvb_length(tvb);
906 gdsdb_cancel_events(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
910 if (tvb_length(tvb) < 12) {
914 /* hf_gdsdb_event_database */
917 return tvb_length(tvb);
921 gdsdb_ddl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
925 if (tvb_length(tvb) < 16) {
929 /* hf_gdsdb_ddl_database */
930 /* hf_gdsdb_ddl_transaction */
931 /* hf_gdsdb_ddl_blr */
934 return tvb_length(tvb);
938 gdsdb_slice(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
942 if (tvb_length(tvb) < 24) {
946 /* hf_gdsdb_slice_transaction */
947 /* hf_gdsdb_slice_id */
948 /* hf_gdsdb_slice_sdl */
949 /* hf_gdsdb_slice_parameters */
952 return tvb_length(tvb);
956 gdsdb_slice_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
960 if (tvb_length(tvb) < 8) {
964 /* hf_gdsdb_sliceresponse_length */
967 return tvb_length(tvb);
971 gdsdb_execute(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
975 if (tvb_length(tvb) < 12) {
979 /* hf_gdsdb_execute_statement */
980 /* hf_gdsdb_execute_transaction */
981 /* hf_gdsdb_execute_message_number */
982 /* hf_gdsdb_execute_messages */
985 return tvb_length(tvb);
989 gdsdb_exec_immediate2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
993 if (tvb_length(tvb) < 44) {
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 */
1004 return tvb_length(tvb);
1008 gdsdb_prepare(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1013 if (tvb_length(tvb) < 32) {
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)));
1024 proto_tree_add_item(tree, hf_gdsdb_prepare_transaction, tvb,
1025 offset, 4, ENC_BIG_ENDIAN);
1027 proto_tree_add_item(tree, hf_gdsdb_prepare_statement, tvb,
1028 offset, 4, ENC_BIG_ENDIAN);
1030 proto_tree_add_item(tree, hf_gdsdb_prepare_dialect, tvb,
1031 offset, 4, ENC_BIG_ENDIAN);
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);
1045 return tvb_length(tvb);
1049 gdsdb_fetch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1053 if (tvb_length(tvb) < 16) {
1057 /* hf_gdsdb_fetch_statement */
1058 /* hf_gdsdb_fetch_message_number */
1059 /* hf_gdsdb_fetch_messages */
1062 return tvb_length(tvb);
1066 gdsdb_fetch_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1070 if (tvb_length(tvb) < 12) {
1074 /* hf_gdsdb_fetchresponse_status */
1075 /* hf_gdsdb_fetchresponse_messages */
1078 return tvb_length(tvb);
1082 gdsdb_free_statement(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1086 if (tvb_length(tvb) < 12) {
1090 /* hf_gdsdb_free_statement */
1091 /* hf_gdsdb_free_option */
1094 return tvb_length(tvb);
1098 gdsdb_insert(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1102 if (tvb_length(tvb) < 16) {
1106 /* hf_gdsdb_insert_statement */
1107 /* hf_gdsdb_insert_message_number */
1108 /* hf_gdsdb_insert_messages */
1111 return tvb_length(tvb);
1115 gdsdb_cursor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1119 if (tvb_length(tvb) < 16) {
1123 /* hf_gdsdb_cursor_statement */
1124 /* hf_gdsdb_cursor_type */
1127 return tvb_length(tvb);
1131 gdsdb_sql_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1135 if (tvb_length(tvb) < 8) {
1139 /* hf_gdsdb_sqlresponse_messages */
1142 return tvb_length(tvb);
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 */
1236 dissect_gdsdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1239 proto_tree *gdsdb_tree;
1243 gdsdb_tree = NULL; /* So the opcode functions can check on if(tree) */
1246 if (tvb_length(tvb) < 4)
1249 opcode = tvb_get_ntohl(tvb, 0);
1250 if(opcode >= op_max)
1252 if(!gdsdb_handle_opcode[opcode](tvb, &nopi, NULL))
1255 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GDS DB");
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"));
1262 ti = proto_tree_add_item(tree, proto_gdsdb, tvb, 0, -1,
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);
1269 /* opcode < op_max */
1270 return gdsdb_handle_opcode[opcode](tvb, pinfo, gdsdb_tree);
1274 proto_register_gdsdb(void)
1276 static hf_register_info hf[] = {
1278 { "Opcode", "gdsdb.opcode",
1279 FT_UINT32, BASE_DEC, VALS(gdsdb_opcode), 0x0,
1284 { &hf_gdsdb_connect_operation,
1285 { "Operation", "gdsdb.connect.operation",
1286 FT_UINT32, BASE_DEC, VALS(gdsdb_opcode), 0x0,
1289 { &hf_gdsdb_connect_version,
1290 { "Version", "gdsdb.connect.version",
1291 FT_UINT32, BASE_DEC, NULL, 0x0,
1294 { &hf_gdsdb_connect_client,
1295 { "Client Architecture", "gdsdb.connect.client",
1296 FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1299 { &hf_gdsdb_connect_filename,
1300 { "Filename", "gdsdb.connect.filename",
1301 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1304 { &hf_gdsdb_connect_count,
1305 { "Version option count", "gdsdb.connect.count",
1306 FT_UINT32, BASE_DEC, NULL, 0x0,
1309 { &hf_gdsdb_connect_userid,
1310 { "User ID", "gdsdb.connect.userid",
1311 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1314 { &hf_gdsdb_connect_pref,
1315 { "Preferred version", "gdsdb.connect.pref",
1316 FT_NONE, BASE_NONE, NULL, 0x0,
1319 { &hf_gdsdb_connect_pref_version,
1320 { "Version", "gdsdb.connect.pref.version",
1321 FT_UINT32, BASE_DEC, NULL, 0x0,
1324 { &hf_gdsdb_connect_pref_architecture,
1325 { "Architecture", "gdsdb.connect.pref.arch",
1326 FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1329 { &hf_gdsdb_connect_pref_mintype,
1330 { "Minimum type", "gdsdb.connect.pref.mintype",
1331 FT_UINT32, BASE_DEC, NULL, 0x0,
1334 { &hf_gdsdb_connect_pref_maxtype,
1335 { "Maximum type", "gdsdb.connect.pref.maxtype",
1336 FT_UINT32, BASE_DEC, NULL, 0x0,
1339 { &hf_gdsdb_connect_pref_weight,
1340 { "Preference weight", "gdsdb.connect.pref.weight",
1341 FT_UINT32, BASE_DEC, NULL, 0x0,
1345 { &hf_gdsdb_accept_version,
1346 { "Version", "gdsdb.accept.version",
1347 FT_UINT32, BASE_DEC, NULL, 0x0,
1350 { &hf_gdsdb_accept_architecture,
1351 { "Architecture", "gdsdb.accept.arch",
1352 FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1356 { &hf_gdsdb_request_type,
1357 { "Type", "gdsdb.connect.type",
1358 FT_UINT32, BASE_DEC, NULL, 0x0,
1361 { &hf_gdsdb_request_object,
1362 { "Object", "gdsdb.connect.object",
1363 FT_UINT32, BASE_DEC, NULL, 0x0,
1366 { &hf_gdsdb_request_partner,
1367 { "Partner", "gdsdb.connect.partner",
1368 FT_UINT64, BASE_DEC, NULL, 0x0,
1372 { &hf_gdsdb_attach_database,
1373 { "Database", "gdsdb.attach.database",
1374 FT_UINT32, BASE_DEC, NULL, 0x0,
1377 { &hf_gdsdb_attach_filename,
1378 { "Filename", "gdsdb.attach.filename",
1379 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1382 { &hf_gdsdb_attach_dpb,
1383 { "Database parameter block", "gdsdb.attach.dpblength",
1384 FT_UINT32, BASE_DEC, NULL, 0x0,
1388 { &hf_gdsdb_compile_database,
1389 { "Database", "gdsdb.compile.filename",
1390 FT_UINT32, BASE_DEC, NULL, 0x0,
1393 { &hf_gdsdb_compile_blr,
1394 { "BLR", "gdsdb.compile.blr",
1395 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1399 { &hf_gdsdb_receive_request,
1400 { "Request", "gdsdb.receive.request",
1401 FT_UINT32, BASE_DEC, NULL, 0x0,
1404 { &hf_gdsdb_receive_incarnation,
1405 { "Incarnation", "gdsdb.receive.incarnation",
1406 FT_UINT32, BASE_DEC, NULL, 0x0,
1409 { &hf_gdsdb_receive_transaction,
1410 { "Transaction", "gdsdb.receive.transaction",
1411 FT_UINT32, BASE_DEC, NULL, 0x0,
1414 { &hf_gdsdb_receive_msgnr,
1415 { "Message number", "gdsdb.receive.msgnr",
1416 FT_UINT32, BASE_DEC, NULL, 0x0,
1419 { &hf_gdsdb_receive_messages,
1420 { "Message Count", "gdsdb.receive.msgcount",
1421 FT_UINT32, BASE_DEC, NULL, 0x0,
1424 { &hf_gdsdb_receive_direction,
1425 { "Scroll direction", "gdsdb.receive.direction",
1426 FT_UINT32, BASE_DEC, NULL, 0x0,
1429 { &hf_gdsdb_receive_offset,
1430 { "Scroll offset", "gdsdb.receive.offset",
1431 FT_UINT32, BASE_DEC, NULL, 0x0,
1435 { &hf_gdsdb_send_request,
1436 { "Send request", "gdsdb.send.request",
1437 FT_UINT32, BASE_DEC, NULL, 0x0,
1440 { &hf_gdsdb_send_incarnation,
1441 { "Send request", "gdsdb.send.incarnation",
1442 FT_UINT32, BASE_DEC, NULL, 0x0,
1445 { &hf_gdsdb_send_transaction,
1446 { "Send request", "gdsdb.send.transaction",
1447 FT_UINT32, BASE_DEC, NULL, 0x0,
1450 { &hf_gdsdb_send_msgnr,
1451 { "Send request", "gdsdb.send.msgnr",
1452 FT_UINT32, BASE_DEC, NULL, 0x0,
1455 { &hf_gdsdb_send_messages,
1456 { "Send request", "gdsdb.send.messages",
1457 FT_UINT32, BASE_DEC, NULL, 0x0,
1460 /* gdsdb_response */
1461 { &hf_gdsdb_response_object,
1462 { "Response object", "gdsdb.response.object",
1463 FT_UINT32, BASE_HEX, NULL, 0x0,
1466 { &hf_gdsdb_response_blobid,
1467 { "Blob ID", "gdsdb.response.blobid",
1468 FT_UINT64, BASE_HEX, NULL, 0x0,
1471 { &hf_gdsdb_response_data,
1472 { "Data", "gdsdb.response.data",
1473 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1476 { &hf_gdsdb_response_status,
1477 { "Status vector", "gdsdb.response.status",
1478 FT_NONE, BASE_NONE, NULL, 0x0,
1481 /* gdsdb_transact */
1482 { &hf_gdsdb_transact_database,
1483 { "Database", "gdsdb.transact.database",
1484 FT_UINT32, BASE_DEC, NULL, 0x0,
1487 { &hf_gdsdb_transact_transaction,
1488 { "Database", "gdsdb.transact.transaction",
1489 FT_UINT32, BASE_DEC, NULL, 0x0,
1492 { &hf_gdsdb_transact_messages,
1493 { "Messages", "gdsdb.transact.messages",
1494 FT_UINT32, BASE_DEC, NULL, 0x0,
1497 /* gdsdb_transact_response */
1498 { &hf_gdsdb_transactresponse_messages,
1499 { "Messages", "gdsdb.transactresponse.messages",
1500 FT_UINT32, BASE_DEC, NULL, 0x0,
1503 /* gdsdb_open_blob2 */
1504 { &hf_gdsdb_openblob2_bpb,
1505 { "Blob parameter block", "gdsdb.openblob2.bpb",
1506 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1509 /* gdsdb_open_blob */
1510 { &hf_gdsdb_openblob_transaction,
1511 { "Transaction", "gdsdb.openblob2.transaction",
1512 FT_UINT32, BASE_DEC, NULL, 0x0,
1515 { &hf_gdsdb_openblob_id,
1516 { "ID", "gdsdb.openblob.id",
1517 FT_UINT64, BASE_HEX, NULL, 0x0,
1521 { &hf_gdsdb_segment_blob,
1522 { "Blob", "gdsdb.segment.blob",
1523 FT_UINT32, BASE_DEC, NULL, 0x0,
1526 { &hf_gdsdb_segment_length,
1527 { "Length", "gdsdb.segment.length",
1528 FT_UINT32, BASE_DEC, NULL, 0x0,
1531 { &hf_gdsdb_segment_segment,
1532 { "Segment", "gdsdb.segment.segment",
1533 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1536 /* gdsdb_seek_blob */
1537 { &hf_gdsdb_seekblob_blob,
1538 { "Blob", "gdsdb.seekblob.blob",
1539 FT_UINT32, BASE_DEC, NULL, 0x0,
1542 { &hf_gdsdb_seekblob_mode,
1543 { "Mode", "gdsdb.seekblob.mode",
1544 FT_UINT32, BASE_DEC, NULL, 0x0,
1547 /* gdsdb_reconnect */
1548 { &hf_gdsdb_reconnect_database,
1549 { "Database", "gdsdb.reconnect.database",
1550 FT_UINT32, BASE_DEC, NULL, 0x0,
1553 /* gdsdb_info & gdsdb_service_start */
1554 { &hf_gdsdb_info_object,
1555 { "Object", "gdsdb.info.object",
1556 FT_UINT32, BASE_DEC, NULL, 0x0,
1559 { &hf_gdsdb_info_incarnation,
1560 { "Incarnation", "gdsdb.info.incarnation",
1561 FT_UINT32, BASE_DEC, NULL, 0x0,
1564 { &hf_gdsdb_info_items,
1565 { "Items", "gdsdb.info.items",
1566 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1569 { &hf_gdsdb_info_buffer_length,
1570 { "Buffer length", "gdsdb.info.bufferlength",
1571 FT_UINT32, BASE_DEC, NULL, 0x0,
1575 { &hf_gdsdb_release_object,
1576 { "Object", "gdsdb.release.object",
1577 FT_UINT32, BASE_DEC, NULL, 0x0,
1580 /* gdsdb_prepare2 */
1581 { &hf_gdsdb_prepare2_transaction,
1582 { "Transaction", "gdsdb.prepare2.transaction",
1583 FT_UINT32, BASE_DEC, NULL, 0x0,
1586 /* gdsdb_event & gdsdb_cancel_events */
1587 { &hf_gdsdb_event_database,
1588 { "Database", "gdsdb.event.database",
1589 FT_UINT32, BASE_DEC, NULL, 0x0,
1592 { &hf_gdsdb_event_items,
1593 { "Event description block", "gdsdb.event.items",
1594 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1597 { &hf_gdsdb_event_ast,
1598 { "ast routine", "gdsdb.event.ast",
1599 FT_UINT32, BASE_DEC, NULL, 0x0,
1602 { &hf_gdsdb_event_arg,
1603 { "Argument to ast routine", "gdsdb.event.arg",
1604 FT_UINT32, BASE_DEC, NULL, 0x0,
1607 { &hf_gdsdb_event_rid,
1608 { "ID", "gdsdb.event.id",
1609 FT_UINT32, BASE_DEC, NULL, 0x0,
1613 { &hf_gdsdb_ddl_database,
1614 { "Database", "gdsdb.ddl.database",
1615 FT_UINT32, BASE_DEC, NULL, 0x0,
1618 { &hf_gdsdb_ddl_transaction,
1619 { "Transaction", "gdsdb.ddl.transaction",
1620 FT_UINT32, BASE_DEC, NULL, 0x0,
1623 { &hf_gdsdb_ddl_blr,
1624 { "BLR", "gdsdb.ddl.blr",
1625 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1629 { &hf_gdsdb_slice_transaction,
1630 { "Transaction", "gdsdb.slice.transaction",
1631 FT_UINT32, BASE_DEC, NULL, 0x0,
1634 { &hf_gdsdb_slice_id,
1635 { "ID", "gdsdb.slice.id",
1636 FT_UINT64, BASE_HEX, NULL, 0x0,
1639 { &hf_gdsdb_slice_sdl,
1640 { "Slice description language", "gdsdb.slice.sdl",
1641 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1644 { &hf_gdsdb_slice_parameters,
1645 { "Parameters", "gdsdb.slice.parameters",
1646 FT_UINT32, BASE_DEC, NULL, 0x0,
1649 /* gdsdb_slice_response */
1650 { &hf_gdsdb_sliceresponse_length,
1651 { "Length", "gdsdb.sliceresponse.length",
1652 FT_UINT32, BASE_DEC, NULL, 0x0,
1656 { &hf_gdsdb_execute_statement,
1657 { "Statement", "gdsdb.execute.statement",
1658 FT_UINT32, BASE_DEC, NULL, 0x0,
1661 { &hf_gdsdb_execute_transaction,
1662 { "Transaction", "gdsdb.execute.transaction",
1663 FT_UINT32, BASE_DEC, NULL, 0x0,
1666 { &hf_gdsdb_execute_message_number,
1667 { "Message number", "gdsdb.execute.messagenumber",
1668 FT_UINT32, BASE_DEC, NULL, 0x0,
1671 { &hf_gdsdb_execute_messages,
1672 { "Number of messages", "gdsdb.execute.messages",
1673 FT_UINT32, BASE_DEC, NULL, 0x0,
1676 /* gdsdb_execute2 */
1677 { &hf_gdsdb_execute_outblr,
1678 { "Output BLR", "gdsdb.execute.outblr",
1679 FT_UINT32, BASE_DEC, NULL, 0x0,
1682 { &hf_gdsdb_execute_outmsgnr,
1683 { "Output Message number", "gdsdb.execute.outmsgnr",
1684 FT_UINT32, BASE_DEC, NULL, 0x0,
1687 /* gdsdb_exec_immediate2 */
1688 { &hf_gdsdb_prepare2_blr,
1689 { "BLR", "gdsdb.prepare.blr",
1690 FT_UINT32, BASE_DEC, NULL, 0x0,
1693 { &hf_gdsdb_prepare2_number,
1694 { "Message number", "gdsdb.prepare2.messagenumber",
1695 FT_UINT32, BASE_DEC, NULL, 0x0,
1698 { &hf_gdsdb_prepare2_messages,
1699 { "Number of messages", "gdsdb.prepare2.messages",
1700 FT_UINT32, BASE_DEC, NULL, 0x0,
1703 { &hf_gdsdb_prepare2_outblr,
1704 { "Output BLR", "gdsdb.prepare2.outblr",
1705 FT_UINT32, BASE_DEC, NULL, 0x0,
1708 { &hf_gdsdb_prepare2_outmsgnr,
1709 { "Output Message number", "gdsdb.prepare2.outmsgnr",
1710 FT_UINT32, BASE_DEC, NULL, 0x0,
1714 { &hf_gdsdb_prepare_transaction,
1715 { "Prepare, Transaction", "gdsdb.prepare.transaction",
1716 FT_UINT32, BASE_DEC, NULL, 0x0,
1719 { &hf_gdsdb_prepare_statement,
1720 { "Prepare, Statement", "gdsdb.prepare.statement",
1721 FT_UINT32, BASE_DEC, NULL, 0x0,
1724 { &hf_gdsdb_prepare_dialect,
1725 { "Prepare, Dialect", "gdsdb.prepare.dialect",
1726 FT_UINT32, BASE_DEC, NULL, 0x0,
1729 { &hf_gdsdb_prepare_querystr,
1730 { "Prepare, Query", "gdsdb.prepare.querystr",
1731 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1734 { &hf_gdsdb_prepare_items,
1735 { "Prepare, Information items", "gdsdb.prepare.items",
1736 FT_UINT32, BASE_DEC, NULL, 0x0,
1739 { &hf_gdsdb_prepare_bufferlength,
1740 { "Prepare, Bufferlength", "gdsdb.prepare.bufferlen",
1741 FT_UINT32, BASE_DEC, NULL, 0x0,
1745 { &hf_gdsdb_fetch_statement,
1746 { "Statement", "gdsdb.fetch.statement",
1747 FT_UINT32, BASE_DEC, NULL, 0x0,
1750 { &hf_gdsdb_fetch_message_number,
1751 { "Message number", "gdsdb.fetch.messagenr",
1752 FT_UINT32, BASE_DEC, NULL, 0x0,
1755 { &hf_gdsdb_fetch_messages,
1756 { "Number of messages", "gdsdb.fetch.messages",
1757 FT_UINT32, BASE_DEC, NULL, 0x0,
1760 /* gdsdb_fetch_response */
1761 { &hf_gdsdb_fetchresponse_status,
1762 { "Status", "gdsdb.fetchresponse.status",
1763 FT_UINT32, BASE_DEC, NULL, 0x0,
1766 { &hf_gdsdb_fetchresponse_messages,
1767 { "Number of messages", "gdsdb.fetchresponse.messages",
1768 FT_UINT32, BASE_DEC, NULL, 0x0,
1771 /* gdsdb_free_statement */
1772 { &hf_gdsdb_free_statement,
1773 { "Statement", "gdsdb.fetchresponse.statement",
1774 FT_UINT32, BASE_DEC, NULL, 0x0,
1777 { &hf_gdsdb_free_option,
1778 { "Option", "gdsdb.fetchresponse.option",
1779 FT_UINT32, BASE_DEC, NULL, 0x0,
1783 { &hf_gdsdb_insert_statement,
1784 { "Statement", "gdsdb.insert.statement",
1785 FT_UINT32, BASE_DEC, NULL, 0x0,
1788 { &hf_gdsdb_insert_message_number,
1789 { "Message number", "gdsdb.insert.messagenr",
1790 FT_UINT32, BASE_DEC, NULL, 0x0,
1793 { &hf_gdsdb_insert_messages,
1794 { "Number of messages", "gdsdb.insert.messages",
1795 FT_UINT32, BASE_DEC, NULL, 0x0,
1799 { &hf_gdsdb_cursor_statement,
1800 { "Statement", "gdsdb.cursor.statement",
1801 FT_UINT32, BASE_DEC, NULL, 0x0,
1804 { &hf_gdsdb_cursor_type,
1805 { "Type", "gdsdb.cursor.type",
1806 FT_UINT32, BASE_DEC, NULL, 0x0,
1809 /* gdsdb_sql_response */
1810 { &hf_gdsdb_sqlresponse_messages,
1811 { "SQL Response, Message Count", "gdsdb.sqlresponse.msgcount",
1812 FT_UINT32, BASE_DEC, NULL, 0x0,
1817 static gint *ett[] = {
1820 &ett_gdsdb_connect_pref
1823 proto_gdsdb = proto_register_protocol(
1824 "Firebird SQL Database Remote Protocol",
1825 "FB/IB GDS DB", "gdsdb");
1827 proto_register_field_array(proto_gdsdb, hf, array_length(hf));
1828 proto_register_subtree_array(ett, array_length(ett));
1832 proto_reg_handoff_gdsdb(void)
1834 /* Main dissector */
1836 dissector_handle_t gdsdb_handle;
1838 gdsdb_handle = new_create_dissector_handle(dissect_gdsdb,
1840 dissector_add_uint("tcp.port", TCP_PORT, gdsdb_handle);