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.
36 #include <epan/packet.h>
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;
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;
61 static int hf_gdsdb_accept_version = -1;
62 static int hf_gdsdb_accept_architecture = -1;
64 static int hf_gdsdb_request_type = -1;
65 static int hf_gdsdb_request_object = -1;
66 static int hf_gdsdb_request_partner = -1;
68 static int hf_gdsdb_attach_database = -1;
69 static int hf_gdsdb_attach_filename = -1;
70 static int hf_gdsdb_attach_dpb = -1;
72 static int hf_gdsdb_compile_database = -1;
73 static int hf_gdsdb_compile_blr = -1;
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;
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;
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;
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;
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;
119 static int hf_gdsdb_release_object = -1;
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;
129 static int hf_gdsdb_ddl_database = -1;
130 static int hf_gdsdb_ddl_transaction = -1;
131 static int hf_gdsdb_ddl_blr = -1;
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;
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;
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;
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;
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;
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;
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;
198 op_convert_lock = 16,
199 op_release_lock = 17,
206 op_start_and_send = 24,
222 op_info_database = 40,
223 op_info_request = 41,
224 op_info_transaction = 42,
226 op_batch_segments = 44,
227 op_mgr_set_affinity = 45,
228 op_mgr_clear_affinity = 46,
231 op_cancel_events = 49,
232 op_commit_retaining = 50,
235 op_connect_request = 53,
239 op_create_blob2 = 57,
244 op_allocate_statement = 62,
246 op_exec_immediate = 64,
248 op_fetch_response = 66,
249 op_free_statement = 67,
250 op_prepare_statement = 68,
254 op_response_piggyback = 72,
255 op_start_and_receive = 73,
256 op_start_send_and_receive = 74,
257 op_exec_immediate2 = 75,
260 op_sql_response = 78,
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,
272 static const value_string gdsdb_opcode[] = {
274 { op_connect, "Connect" },
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" },
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" },
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" },
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" },
363 static const value_string gdsdb_architectures[] = {
378 { 15, "mips Ultrix" },
383 { 20, "Apollo_dn10k" },
402 { 39, "Darwin PPC" },
407 gdsdb_dummy(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
409 /* Don't tell them we match */
414 gdsdb_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
421 proto_tree *pref_tree;
423 if (tvb_length(tvb) < 16) {
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)));
434 proto_tree_add_item(tree, hf_gdsdb_connect_operation, tvb,
437 proto_tree_add_item(tree, hf_gdsdb_connect_version, tvb,
440 proto_tree_add_item(tree, hf_gdsdb_connect_client, tvb,
443 proto_tree_add_item(tree, hf_gdsdb_connect_filename, tvb,
445 length = tvb_get_ntohl(tvb, offset);
446 offset += length + 6;
447 proto_tree_add_item(tree, hf_gdsdb_connect_count, tvb,
449 count = tvb_get_ntohl(tvb, offset);
451 proto_tree_add_item(tree, hf_gdsdb_connect_userid, tvb,
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);
464 proto_tree_add_item(pref_tree,
465 hf_gdsdb_connect_pref_architecture,
466 tvb, offset, 4, FALSE);
468 proto_tree_add_item(pref_tree,
469 hf_gdsdb_connect_pref_mintype,
470 tvb, offset, 4, FALSE);
472 proto_tree_add_item(pref_tree,
473 hf_gdsdb_connect_pref_maxtype,
474 tvb, offset, 4, FALSE);
476 proto_tree_add_item(pref_tree,
477 hf_gdsdb_connect_pref_weight,
478 tvb, offset, 4, FALSE);
483 return tvb_length(tvb);
487 gdsdb_accept(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
491 if (tvb_length(tvb) < 16) {
496 proto_tree_add_item(tree, hf_gdsdb_accept_version, tvb,
499 proto_tree_add_item(tree, hf_gdsdb_accept_architecture, tvb,
504 return tvb_length(tvb);
508 gdsdb_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
512 if (tvb_length(tvb) < 20) {
517 proto_tree_add_item(tree, hf_gdsdb_request_type, tvb,
520 proto_tree_add_item(tree, hf_gdsdb_request_object, tvb,
523 proto_tree_add_item(tree, hf_gdsdb_request_partner, tvb,
527 return tvb_length(tvb);
531 gdsdb_attach(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
536 if (tvb_length(tvb) < 20) {
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)));
547 proto_tree_add_item(tree, hf_gdsdb_attach_database, tvb,
550 proto_tree_add_item(tree, hf_gdsdb_attach_filename, tvb,
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);
559 return tvb_length(tvb);
563 gdsdb_compile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
567 if (tvb_length(tvb) < 20) {
572 proto_tree_add_item(tree, hf_gdsdb_compile_database, tvb,
575 proto_tree_add_item(tree, hf_gdsdb_compile_blr, tvb,
579 return tvb_length(tvb);
583 gdsdb_receive(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
587 if (tvb_length(tvb) < 20) {
592 proto_tree_add_item(tree, hf_gdsdb_receive_request, tvb,
595 proto_tree_add_item(tree, hf_gdsdb_receive_incarnation, tvb,
598 proto_tree_add_item(tree, hf_gdsdb_receive_transaction, tvb,
601 proto_tree_add_item(tree, hf_gdsdb_receive_msgnr, tvb,
604 proto_tree_add_item(tree, hf_gdsdb_receive_messages, tvb,
607 while(tvb_bytes_exist(tvb, offset, 12)) {
608 proto_tree_add_item(tree, hf_gdsdb_receive_direction,
609 tvb, offset, 4, FALSE);
611 proto_tree_add_item(tree, hf_gdsdb_receive_offset,
612 tvb, offset, 8, FALSE);
617 return tvb_length(tvb);
621 gdsdb_send(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
625 if (tvb_length(tvb) < 20) {
630 proto_tree_add_item(tree, hf_gdsdb_send_request, tvb,
633 proto_tree_add_item(tree, hf_gdsdb_send_incarnation, tvb,
636 proto_tree_add_item(tree, hf_gdsdb_send_transaction, tvb,
639 proto_tree_add_item(tree, hf_gdsdb_send_msgnr, tvb,
642 proto_tree_add_item(tree, hf_gdsdb_send_messages, tvb,
646 return tvb_length(tvb);
650 gdsdb_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
655 if (tvb_length(tvb) < 32) {
660 proto_tree_add_item(tree, hf_gdsdb_response_object, tvb,
663 proto_tree_add_item(tree, hf_gdsdb_response_blobid, tvb,
666 proto_tree_add_item(tree, hf_gdsdb_response_data, tvb,
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);
674 return tvb_length(tvb);
679 gdsdb_transact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
683 if (tvb_length(tvb) < 20) {
688 proto_tree_add_item(tree, hf_gdsdb_transact_database, tvb,
691 proto_tree_add_item(tree, hf_gdsdb_transact_transaction, tvb,
695 return tvb_length(tvb);
699 gdsdb_transact_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
704 if (tvb_length(tvb) < 8) {
709 proto_tree_add_item(tree, hf_gdsdb_transactresponse_messages,
710 tvb, offset, 4, FALSE);
713 return tvb_length(tvb);
717 gdsdb_open_blob2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
722 if (!tvb_bytes_exist(tvb, 0, 20)) {
727 proto_tree_add_item(tree, hf_gdsdb_openblob2_bpb, tvb, offset,
729 length = tvb_get_ntohl(tvb, offset);
730 offset += length + 6;
731 proto_tree_add_item(tree, hf_gdsdb_openblob_transaction, tvb,
734 proto_tree_add_item(tree, hf_gdsdb_openblob_id, tvb, offset,
738 return tvb_length(tvb);
742 gdsdb_open_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
746 if (tvb_length(tvb) < 16) {
751 proto_tree_add_item(tree, hf_gdsdb_openblob_transaction, tvb,
754 proto_tree_add_item(tree, hf_gdsdb_openblob_id, tvb, offset,
758 return tvb_length(tvb);
762 gdsdb_segment(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
766 if (tvb_length(tvb) < 16) {
770 /* hf_gdsdb_segment_blob */
771 /* hf_gdsdb_segment_length */
772 /* hf_gdsdb_segment_segment */
775 return tvb_length(tvb);
779 gdsdb_seek_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
783 if (tvb_length(tvb) < 16) {
787 /* hf_gdsdb_seekblob_blob */
788 /* hf_gdsdb_seekblob_mode */
791 return tvb_length(tvb);
795 gdsdb_reconnect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
799 if (tvb_length(tvb) < 12) {
803 /* hf_gdsdb_reconnect_database */
806 return tvb_length(tvb);
810 gdsdb_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
816 if (tvb_length(tvb) < 20) {
820 opcode = tvb_get_ntohl(tvb, 0);
824 proto_tree_add_item(tree, hf_gdsdb_info_object, tvb, offset,
827 proto_tree_add_item(tree, hf_gdsdb_info_incarnation, tvb,
830 if(opcode == op_service_info) {
831 proto_tree_add_item(tree, hf_gdsdb_info_items, tvb,
833 length = tvb_get_ntohl(tvb, offset);
834 offset += length + 6;
836 proto_tree_add_item(tree, hf_gdsdb_info_buffer_length, tvb,
840 return tvb_length(tvb);
844 gdsdb_service_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
848 if (tvb_length(tvb) < 16) {
852 /* hf_gdsdb_info_object */
853 /* hf_gdsdb_info_incarnation */
854 /* hf_gdsdb_info_items */
855 /* hf_gdsdb_info_buffer_length */
858 return tvb_length(tvb);
862 gdsdb_release(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
866 if (tvb_length(tvb) < 8) {
870 /* hf_gdsdb_release_object */
873 return tvb_length(tvb);
878 gdsdb_prepare2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
882 if (tvb_length(tvb) < 12) {
886 /* hf_gdsdb_prepare2_transaction */
889 return tvb_length(tvb);
894 gdsdb_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
898 if (tvb_length(tvb) < 24) {
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 */
908 return tvb_length(tvb);
912 gdsdb_cancel_events(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
916 if (tvb_length(tvb) < 12) {
920 /* hf_gdsdb_event_database */
923 return tvb_length(tvb);
927 gdsdb_ddl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
931 if (tvb_length(tvb) < 16) {
935 /* hf_gdsdb_ddl_database */
936 /* hf_gdsdb_ddl_transaction */
937 /* hf_gdsdb_ddl_blr */
940 return tvb_length(tvb);
944 gdsdb_slice(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
948 if (tvb_length(tvb) < 24) {
952 /* hf_gdsdb_slice_transaction */
953 /* hf_gdsdb_slice_id */
954 /* hf_gdsdb_slice_sdl */
955 /* hf_gdsdb_slice_parameters */
958 return tvb_length(tvb);
962 gdsdb_slice_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
966 if (tvb_length(tvb) < 8) {
970 /* hf_gdsdb_sliceresponse_length */
973 return tvb_length(tvb);
977 gdsdb_execute(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
981 if (tvb_length(tvb) < 12) {
985 /* hf_gdsdb_execute_statement */
986 /* hf_gdsdb_execute_transaction */
987 /* hf_gdsdb_execute_message_number */
988 /* hf_gdsdb_execute_messages */
991 return tvb_length(tvb);
995 gdsdb_exec_immediate2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
999 if (tvb_length(tvb) < 44) {
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 */
1010 return tvb_length(tvb);
1014 gdsdb_prepare(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1019 if (tvb_length(tvb) < 32) {
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)));
1030 proto_tree_add_item(tree, hf_gdsdb_prepare_transaction, tvb,
1033 proto_tree_add_item(tree, hf_gdsdb_prepare_statement, tvb,
1036 proto_tree_add_item(tree, hf_gdsdb_prepare_dialect, tvb,
1039 proto_tree_add_item(tree, hf_gdsdb_prepare_querystr, tvb,
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,
1051 return tvb_length(tvb);
1055 gdsdb_fetch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1059 if (tvb_length(tvb) < 16) {
1063 /* hf_gdsdb_fetch_statement */
1064 /* hf_gdsdb_fetch_message_number */
1065 /* hf_gdsdb_fetch_messages */
1068 return tvb_length(tvb);
1072 gdsdb_fetch_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1076 if (tvb_length(tvb) < 12) {
1080 /* hf_gdsdb_fetchresponse_status */
1081 /* hf_gdsdb_fetchresponse_messages */
1084 return tvb_length(tvb);
1088 gdsdb_free_statement(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1092 if (tvb_length(tvb) < 12) {
1096 /* hf_gdsdb_free_statement */
1097 /* hf_gdsdb_free_option */
1100 return tvb_length(tvb);
1104 gdsdb_insert(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1108 if (tvb_length(tvb) < 16) {
1112 /* hf_gdsdb_insert_statement */
1113 /* hf_gdsdb_insert_message_number */
1114 /* hf_gdsdb_insert_messages */
1117 return tvb_length(tvb);
1121 gdsdb_cursor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1125 if (tvb_length(tvb) < 16) {
1129 /* hf_gdsdb_cursor_statement */
1130 /* hf_gdsdb_cursor_type */
1133 return tvb_length(tvb);
1137 gdsdb_sql_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1141 if (tvb_length(tvb) < 8) {
1145 /* hf_gdsdb_sqlresponse_messages */
1148 return tvb_length(tvb);
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 */
1242 dissect_gdsdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1245 proto_tree *gdsdb_tree;
1249 gdsdb_tree = NULL; /* So the opcode functions can check on if(tree) */
1252 if (tvb_length(tvb) < 4)
1255 opcode = tvb_get_ntohl(tvb, 0);
1256 if(opcode >= op_max)
1258 if(!gdsdb_handle_opcode[opcode](tvb, &nopi, NULL))
1261 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GDS DB");
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"));
1268 ti = proto_tree_add_item(tree, proto_gdsdb, tvb, 0, -1,
1270 gdsdb_tree = proto_item_add_subtree(ti, ett_gdsdb);
1271 proto_tree_add_item(gdsdb_tree, hf_gdsdb_opcode, tvb,
1275 /* opcode < op_max */
1276 return gdsdb_handle_opcode[opcode](tvb, pinfo, gdsdb_tree);
1280 proto_register_gdsdb(void)
1282 static hf_register_info hf[] = {
1284 { "Opcode", "gdsdb.opcode",
1285 FT_UINT32, BASE_DEC, VALS(gdsdb_opcode), 0x0,
1290 { &hf_gdsdb_connect_operation,
1291 { "Operation", "gdsdb.connect.operation",
1292 FT_UINT32, BASE_DEC, VALS(gdsdb_opcode), 0x0,
1295 { &hf_gdsdb_connect_version,
1296 { "Version", "gdsdb.connect.version",
1297 FT_UINT32, BASE_DEC, NULL, 0x0,
1300 { &hf_gdsdb_connect_client,
1301 { "Client Architecture", "gdsdb.connect.client",
1302 FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1305 { &hf_gdsdb_connect_filename,
1306 { "Filename", "gdsdb.connect.filename",
1307 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1310 { &hf_gdsdb_connect_count,
1311 { "Version option count", "gdsdb.connect.count",
1312 FT_UINT32, BASE_DEC, NULL, 0x0,
1315 { &hf_gdsdb_connect_userid,
1316 { "User ID", "gdsdb.connect.userid",
1317 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1320 { &hf_gdsdb_connect_pref,
1321 { "Preferred version", "gdsdb.connect.pref",
1322 FT_NONE, BASE_NONE, NULL, 0x0,
1325 { &hf_gdsdb_connect_pref_version,
1326 { "Version", "gdsdb.connect.pref.version",
1327 FT_UINT32, BASE_DEC, NULL, 0x0,
1330 { &hf_gdsdb_connect_pref_architecture,
1331 { "Architecture", "gdsdb.connect.pref.arch",
1332 FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1335 { &hf_gdsdb_connect_pref_mintype,
1336 { "Minimum type", "gdsdb.connect.pref.mintype",
1337 FT_UINT32, BASE_DEC, NULL, 0x0,
1340 { &hf_gdsdb_connect_pref_maxtype,
1341 { "Maximum type", "gdsdb.connect.pref.maxtype",
1342 FT_UINT32, BASE_DEC, NULL, 0x0,
1345 { &hf_gdsdb_connect_pref_weight,
1346 { "Preference weight", "gdsdb.connect.pref.weight",
1347 FT_UINT32, BASE_DEC, NULL, 0x0,
1351 { &hf_gdsdb_accept_version,
1352 { "Version", "gdsdb.accept.version",
1353 FT_UINT32, BASE_DEC, NULL, 0x0,
1356 { &hf_gdsdb_accept_architecture,
1357 { "Architecture", "gdsdb.accept.arch",
1358 FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1362 { &hf_gdsdb_request_type,
1363 { "Type", "gdsdb.connect.type",
1364 FT_UINT32, BASE_DEC, NULL, 0x0,
1367 { &hf_gdsdb_request_object,
1368 { "Object", "gdsdb.connect.object",
1369 FT_UINT32, BASE_DEC, NULL, 0x0,
1372 { &hf_gdsdb_request_partner,
1373 { "Partner", "gdsdb.connect.partner",
1374 FT_UINT64, BASE_DEC, NULL, 0x0,
1378 { &hf_gdsdb_attach_database,
1379 { "Database", "gdsdb.attach.database",
1380 FT_UINT32, BASE_DEC, NULL, 0x0,
1383 { &hf_gdsdb_attach_filename,
1384 { "Filename", "gdsdb.attach.filename",
1385 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1388 { &hf_gdsdb_attach_dpb,
1389 { "Database parameter block", "gdsdb.attach.dpblength",
1390 FT_UINT32, BASE_DEC, NULL, 0x0,
1394 { &hf_gdsdb_compile_database,
1395 { "Database", "gdsdb.compile.filename",
1396 FT_UINT32, BASE_DEC, NULL, 0x0,
1399 { &hf_gdsdb_compile_blr,
1400 { "BLR", "gdsdb.compile.blr",
1401 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1405 { &hf_gdsdb_receive_request,
1406 { "Request", "gdsdb.receive.request",
1407 FT_UINT32, BASE_DEC, NULL, 0x0,
1410 { &hf_gdsdb_receive_incarnation,
1411 { "Incarnation", "gdsdb.receive.incarnation",
1412 FT_UINT32, BASE_DEC, NULL, 0x0,
1415 { &hf_gdsdb_receive_transaction,
1416 { "Transaction", "gdsdb.receive.transaction",
1417 FT_UINT32, BASE_DEC, NULL, 0x0,
1420 { &hf_gdsdb_receive_msgnr,
1421 { "Message number", "gdsdb.receive.msgnr",
1422 FT_UINT32, BASE_DEC, NULL, 0x0,
1425 { &hf_gdsdb_receive_messages,
1426 { "Message Count", "gdsdb.receive.msgcount",
1427 FT_UINT32, BASE_DEC, NULL, 0x0,
1430 { &hf_gdsdb_receive_direction,
1431 { "Scroll direction", "gdsdb.receive.direction",
1432 FT_UINT32, BASE_DEC, NULL, 0x0,
1435 { &hf_gdsdb_receive_offset,
1436 { "Scroll offset", "gdsdb.receive.offset",
1437 FT_UINT32, BASE_DEC, NULL, 0x0,
1441 { &hf_gdsdb_send_request,
1442 { "Send request", "gdsdb.send.request",
1443 FT_UINT32, BASE_DEC, NULL, 0x0,
1446 { &hf_gdsdb_send_incarnation,
1447 { "Send request", "gdsdb.send.incarnation",
1448 FT_UINT32, BASE_DEC, NULL, 0x0,
1451 { &hf_gdsdb_send_transaction,
1452 { "Send request", "gdsdb.send.transaction",
1453 FT_UINT32, BASE_DEC, NULL, 0x0,
1456 { &hf_gdsdb_send_msgnr,
1457 { "Send request", "gdsdb.send.msgnr",
1458 FT_UINT32, BASE_DEC, NULL, 0x0,
1461 { &hf_gdsdb_send_messages,
1462 { "Send request", "gdsdb.send.messages",
1463 FT_UINT32, BASE_DEC, NULL, 0x0,
1466 /* gdsdb_response */
1467 { &hf_gdsdb_response_object,
1468 { "Response object", "gdsdb.response.object",
1469 FT_UINT32, BASE_HEX, NULL, 0x0,
1472 { &hf_gdsdb_response_blobid,
1473 { "Blob ID", "gdsdb.response.blobid",
1474 FT_UINT64, BASE_HEX, NULL, 0x0,
1477 { &hf_gdsdb_response_data,
1478 { "Data", "gdsdb.response.data",
1479 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1482 { &hf_gdsdb_response_status,
1483 { "Status vector", "gdsdb.response.status",
1484 FT_NONE, BASE_NONE, NULL, 0x0,
1487 /* gdsdb_transact */
1488 { &hf_gdsdb_transact_database,
1489 { "Database", "gdsdb.transact.database",
1490 FT_UINT32, BASE_DEC, NULL, 0x0,
1493 { &hf_gdsdb_transact_transaction,
1494 { "Database", "gdsdb.transact.transaction",
1495 FT_UINT32, BASE_DEC, NULL, 0x0,
1498 { &hf_gdsdb_transact_messages,
1499 { "Messages", "gdsdb.transact.messages",
1500 FT_UINT32, BASE_DEC, NULL, 0x0,
1503 /* gdsdb_transact_response */
1504 { &hf_gdsdb_transactresponse_messages,
1505 { "Messages", "gdsdb.transactresponse.messages",
1506 FT_UINT32, BASE_DEC, NULL, 0x0,
1509 /* gdsdb_open_blob2 */
1510 { &hf_gdsdb_openblob2_bpb,
1511 { "Blob parameter block", "gdsdb.openblob2.bpb",
1512 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1515 /* gdsdb_open_blob */
1516 { &hf_gdsdb_openblob_transaction,
1517 { "Transaction", "gdsdb.openblob2.transaction",
1518 FT_UINT32, BASE_DEC, NULL, 0x0,
1521 { &hf_gdsdb_openblob_id,
1522 { "ID", "gdsdb.openblob.id",
1523 FT_UINT64, BASE_HEX, NULL, 0x0,
1527 { &hf_gdsdb_segment_blob,
1528 { "Blob", "gdsdb.segment.blob",
1529 FT_UINT32, BASE_DEC, NULL, 0x0,
1532 { &hf_gdsdb_segment_length,
1533 { "Length", "gdsdb.segment.length",
1534 FT_UINT32, BASE_DEC, NULL, 0x0,
1537 { &hf_gdsdb_segment_segment,
1538 { "Segment", "gdsdb.segment.segment",
1539 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1542 /* gdsdb_seek_blob */
1543 { &hf_gdsdb_seekblob_blob,
1544 { "Blob", "gdsdb.seekblob.blob",
1545 FT_UINT32, BASE_DEC, NULL, 0x0,
1548 { &hf_gdsdb_seekblob_mode,
1549 { "Mode", "gdsdb.seekblob.mode",
1550 FT_UINT32, BASE_DEC, NULL, 0x0,
1553 /* gdsdb_reconnect */
1554 { &hf_gdsdb_reconnect_database,
1555 { "Database", "gdsdb.reconnect.database",
1556 FT_UINT32, BASE_DEC, NULL, 0x0,
1559 /* gdsdb_info & gdsdb_service_start */
1560 { &hf_gdsdb_info_object,
1561 { "Object", "gdsdb.info.object",
1562 FT_UINT32, BASE_DEC, NULL, 0x0,
1565 { &hf_gdsdb_info_incarnation,
1566 { "Incarnation", "gdsdb.info.object",
1567 FT_UINT32, BASE_DEC, NULL, 0x0,
1570 { &hf_gdsdb_info_items,
1571 { "Items", "gdsdb.info.items",
1572 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1575 { &hf_gdsdb_info_buffer_length,
1576 { "Buffer length", "gdsdb.info.bufferlength",
1577 FT_UINT32, BASE_DEC, NULL, 0x0,
1581 { &hf_gdsdb_release_object,
1582 { "Object", "gdsdb.release.object",
1583 FT_UINT32, BASE_DEC, NULL, 0x0,
1586 /* gdsdb_prepare2 */
1587 { &hf_gdsdb_prepare2_transaction,
1588 { "Transaction", "gdsdb.prepare2.transaction",
1589 FT_UINT32, BASE_DEC, NULL, 0x0,
1592 /* gdsdb_event & gdsdb_cancel_events */
1593 { &hf_gdsdb_event_database,
1594 { "Database", "gdsdb.event.database",
1595 FT_UINT32, BASE_DEC, NULL, 0x0,
1598 { &hf_gdsdb_event_items,
1599 { "Event description block", "gdsdb.event.items",
1600 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1603 { &hf_gdsdb_event_ast,
1604 { "ast routine", "gdsdb.event.ast",
1605 FT_UINT32, BASE_DEC, NULL, 0x0,
1608 { &hf_gdsdb_event_arg,
1609 { "Argument to ast routine", "gdsdb.event.arg",
1610 FT_UINT32, BASE_DEC, NULL, 0x0,
1613 { &hf_gdsdb_event_rid,
1614 { "ID", "gdsdb.event.id",
1615 FT_UINT32, BASE_DEC, NULL, 0x0,
1619 { &hf_gdsdb_ddl_database,
1620 { "Database", "gdsdb.ddl.database",
1621 FT_UINT32, BASE_DEC, NULL, 0x0,
1624 { &hf_gdsdb_ddl_transaction,
1625 { "Transaction", "gdsdb.ddl.transaction",
1626 FT_UINT32, BASE_DEC, NULL, 0x0,
1629 { &hf_gdsdb_ddl_blr,
1630 { "BLR", "gdsdb.ddl.blr",
1631 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1635 { &hf_gdsdb_slice_transaction,
1636 { "Transaction", "gdsdb.slice.transaction",
1637 FT_UINT32, BASE_DEC, NULL, 0x0,
1640 { &hf_gdsdb_slice_id,
1641 { "ID", "gdsdb.slice.id",
1642 FT_UINT64, BASE_HEX, NULL, 0x0,
1645 { &hf_gdsdb_slice_sdl,
1646 { "Slice description language", "gdsdb.slice.sdl",
1647 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1650 { &hf_gdsdb_slice_parameters,
1651 { "Parameters", "gdsdb.slice.parameters",
1652 FT_UINT32, BASE_DEC, NULL, 0x0,
1655 /* gdsdb_slice_response */
1656 { &hf_gdsdb_sliceresponse_length,
1657 { "Length", "gdsdb.sliceresponse.length",
1658 FT_UINT32, BASE_DEC, NULL, 0x0,
1662 { &hf_gdsdb_execute_statement,
1663 { "Statement", "gdsdb.execute.statement",
1664 FT_UINT32, BASE_DEC, NULL, 0x0,
1667 { &hf_gdsdb_execute_transaction,
1668 { "Transaction", "gdsdb.execute.transaction",
1669 FT_UINT32, BASE_DEC, NULL, 0x0,
1672 { &hf_gdsdb_execute_message_number,
1673 { "Message number", "gdsdb.execute.messagenumber",
1674 FT_UINT32, BASE_DEC, NULL, 0x0,
1677 { &hf_gdsdb_execute_messages,
1678 { "Number of messages", "gdsdb.execute.messages",
1679 FT_UINT32, BASE_DEC, NULL, 0x0,
1682 /* gdsdb_execute2 */
1683 { &hf_gdsdb_execute_outblr,
1684 { "Output BLR", "gdsdb.execute.outblr",
1685 FT_UINT32, BASE_DEC, NULL, 0x0,
1688 { &hf_gdsdb_execute_outmsgnr,
1689 { "Output Message number", "gdsdb.execute.outmsgnr",
1690 FT_UINT32, BASE_DEC, NULL, 0x0,
1693 /* gdsdb_exec_immediate2 */
1694 { &hf_gdsdb_prepare2_blr,
1695 { "BLR", "gdsdb.prepare.blr",
1696 FT_UINT32, BASE_DEC, NULL, 0x0,
1699 { &hf_gdsdb_prepare2_number,
1700 { "Message number", "gdsdb.prepare2.messagenumber",
1701 FT_UINT32, BASE_DEC, NULL, 0x0,
1704 { &hf_gdsdb_prepare2_messages,
1705 { "Number of messages", "gdsdb.prepare2.messages",
1706 FT_UINT32, BASE_DEC, NULL, 0x0,
1709 { &hf_gdsdb_prepare2_outblr,
1710 { "Output BLR", "gdsdb.prepare2.outblr",
1711 FT_UINT32, BASE_DEC, NULL, 0x0,
1714 { &hf_gdsdb_prepare2_outmsgnr,
1715 { "Output Message number", "gdsdb.prepare2.outmsgnr",
1716 FT_UINT32, BASE_DEC, NULL, 0x0,
1720 { &hf_gdsdb_prepare_transaction,
1721 { "Prepare, Transaction", "gdsdb.prepare.transaction",
1722 FT_UINT32, BASE_DEC, NULL, 0x0,
1725 { &hf_gdsdb_prepare_statement,
1726 { "Prepare, Statement", "gdsdb.prepare.statement",
1727 FT_UINT32, BASE_DEC, NULL, 0x0,
1730 { &hf_gdsdb_prepare_dialect,
1731 { "Prepare, Dialect", "gdsdb.prepare.dialect",
1732 FT_UINT32, BASE_DEC, NULL, 0x0,
1735 { &hf_gdsdb_prepare_querystr,
1736 { "Prepare, Query", "gdsdb.prepare.querystr",
1737 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1740 { &hf_gdsdb_prepare_items,
1741 { "Prepare, Information items", "gdsdb.prepare.items",
1742 FT_UINT32, BASE_DEC, NULL, 0x0,
1745 { &hf_gdsdb_prepare_bufferlength,
1746 { "Prepare, Bufferlength", "gdsdb.prepare.bufferlen",
1747 FT_UINT32, BASE_DEC, NULL, 0x0,
1751 { &hf_gdsdb_fetch_statement,
1752 { "Statement", "gdsdb.fetch.statement",
1753 FT_UINT32, BASE_DEC, NULL, 0x0,
1756 { &hf_gdsdb_fetch_message_number,
1757 { "Message number", "gdsdb.fetch.messagenr",
1758 FT_UINT32, BASE_DEC, NULL, 0x0,
1761 { &hf_gdsdb_fetch_messages,
1762 { "Number of messages", "gdsdb.fetch.messages",
1763 FT_UINT32, BASE_DEC, NULL, 0x0,
1766 /* gdsdb_fetch_response */
1767 { &hf_gdsdb_fetchresponse_status,
1768 { "Status", "gdsdb.fetchresponse.status",
1769 FT_UINT32, BASE_DEC, NULL, 0x0,
1772 { &hf_gdsdb_fetchresponse_messages,
1773 { "Number of messages", "gdsdb.fetchresponse.messages",
1774 FT_UINT32, BASE_DEC, NULL, 0x0,
1777 /* gdsdb_free_statement */
1778 { &hf_gdsdb_free_statement,
1779 { "Statement", "gdsdb.fetchresponse.statement",
1780 FT_UINT32, BASE_DEC, NULL, 0x0,
1783 { &hf_gdsdb_free_option,
1784 { "Option", "gdsdb.fetchresponse.option",
1785 FT_UINT32, BASE_DEC, NULL, 0x0,
1789 { &hf_gdsdb_insert_statement,
1790 { "Statement", "gdsdb.insert.statement",
1791 FT_UINT32, BASE_DEC, NULL, 0x0,
1794 { &hf_gdsdb_insert_message_number,
1795 { "Message number", "gdsdb.insert.messagenr",
1796 FT_UINT32, BASE_DEC, NULL, 0x0,
1799 { &hf_gdsdb_insert_messages,
1800 { "Number of messages", "gdsdb.insert.messages",
1801 FT_UINT32, BASE_DEC, NULL, 0x0,
1805 { &hf_gdsdb_cursor_statement,
1806 { "Statement", "gdsdb.cursor.statement",
1807 FT_UINT32, BASE_DEC, NULL, 0x0,
1810 { &hf_gdsdb_cursor_type,
1811 { "Type", "gdsdb.cursor.type",
1812 FT_UINT32, BASE_DEC, NULL, 0x0,
1815 /* gdsdb_sql_response */
1816 { &hf_gdsdb_sqlresponse_messages,
1817 { "SQL Response, Message Count", "gdsdb.sqlresponse.msgcount",
1818 FT_UINT32, BASE_DEC, NULL, 0x0,
1823 static gint *ett[] = {
1826 &ett_gdsdb_connect_pref
1829 proto_gdsdb = proto_register_protocol(
1830 "Firebird SQL Database Remote Protocol",
1831 "FB/IB GDS DB", "gdsdb");
1833 proto_register_field_array(proto_gdsdb, hf, array_length(hf));
1834 proto_register_subtree_array(ett, array_length(ett));
1838 proto_reg_handoff_gdsdb(void)
1840 /* Main dissector */
1842 dissector_handle_t gdsdb_handle;
1844 gdsdb_handle = new_create_dissector_handle(dissect_gdsdb,
1846 dissector_add("tcp.port", TCP_PORT, gdsdb_handle);