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.
34 #include <epan/packet.h>
38 static int proto_gdsdb = -1;
39 static gint ett_gdsdb = -1;
40 static int hf_gdsdb_opcode = -1;
41 static gint ett_gdsdb_opcode = -1;
45 static int hf_gdsdb_connect_operation = -1;
46 static int hf_gdsdb_connect_version = -1;
47 static int hf_gdsdb_connect_client = -1;
48 static int hf_gdsdb_connect_filename = -1;
49 static int hf_gdsdb_connect_count = -1;
50 static int hf_gdsdb_connect_userid = -1;
51 static int hf_gdsdb_connect_pref = -1;
52 static gint ett_gdsdb_connect_pref = -1;
53 static int hf_gdsdb_connect_pref_version = -1;
54 static int hf_gdsdb_connect_pref_architecture = -1;
55 static int hf_gdsdb_connect_pref_mintype = -1;
56 static int hf_gdsdb_connect_pref_maxtype = -1;
57 static int hf_gdsdb_connect_pref_weight = -1;
59 static int hf_gdsdb_accept_version = -1;
60 static int hf_gdsdb_accept_architecture = -1;
62 static int hf_gdsdb_request_type = -1;
63 static int hf_gdsdb_request_object = -1;
64 static int hf_gdsdb_request_partner = -1;
66 static int hf_gdsdb_attach_database = -1;
67 static int hf_gdsdb_attach_filename = -1;
68 static int hf_gdsdb_attach_dpb = -1;
70 static int hf_gdsdb_compile_database = -1;
71 static int hf_gdsdb_compile_blr = -1;
73 static int hf_gdsdb_receive_request = -1;
74 static int hf_gdsdb_receive_incarnation = -1;
75 static int hf_gdsdb_receive_transaction = -1;
76 static int hf_gdsdb_receive_msgnr = -1;
77 static int hf_gdsdb_receive_messages = -1;
78 static int hf_gdsdb_receive_direction = -1;
79 static int hf_gdsdb_receive_offset = -1;
81 static int hf_gdsdb_send_request = -1;
82 static int hf_gdsdb_send_incarnation = -1;
83 static int hf_gdsdb_send_transaction = -1;
84 static int hf_gdsdb_send_msgnr = -1;
85 static int hf_gdsdb_send_messages = -1;
87 static int hf_gdsdb_response_object = -1;
88 static int hf_gdsdb_response_blobid = -1;
89 static int hf_gdsdb_response_data = -1;
90 static int hf_gdsdb_response_status = -1;
92 static int hf_gdsdb_transact_database = -1;
93 static int hf_gdsdb_transact_transaction = -1;
94 static int hf_gdsdb_transact_messages = -1;
95 /* gdsdb_transact_response */
96 static int hf_gdsdb_transactresponse_messages = -1;
97 /* gdsdb_open_blob2 */
98 static int hf_gdsdb_openblob2_bpb = -1;
100 static int hf_gdsdb_openblob_transaction = -1;
101 static int hf_gdsdb_openblob_id = -1;
103 static int hf_gdsdb_segment_blob = -1;
104 static int hf_gdsdb_segment_length = -1;
105 static int hf_gdsdb_segment_segment = -1;
106 /* gdsdb_seek_blob */
107 static int hf_gdsdb_seekblob_blob = -1;
108 static int hf_gdsdb_seekblob_mode = -1;
109 /* gdsdb_reconnect */
110 static int hf_gdsdb_reconnect_database = -1;
111 /* gdsdb_info & gdsdb_service_start */
112 static int hf_gdsdb_info_object = -1;
113 static int hf_gdsdb_info_incarnation = -1;
114 static int hf_gdsdb_info_items = -1;
115 static int hf_gdsdb_info_buffer_length = -1;
117 static int hf_gdsdb_release_object = -1;
119 static int hf_gdsdb_prepare2_transaction = -1;
120 /* gdsdb_event & gdsdb_cancel_events */
121 static int hf_gdsdb_event_database = -1;
122 static int hf_gdsdb_event_items = -1;
123 static int hf_gdsdb_event_ast = -1;
124 static int hf_gdsdb_event_arg = -1;
125 static int hf_gdsdb_event_rid = -1;
127 static int hf_gdsdb_ddl_database = -1;
128 static int hf_gdsdb_ddl_transaction = -1;
129 static int hf_gdsdb_ddl_blr = -1;
131 static int hf_gdsdb_slice_transaction = -1;
132 static int hf_gdsdb_slice_id = -1;
133 static int hf_gdsdb_slice_sdl = -1;
134 static int hf_gdsdb_slice_parameters = -1;
135 /* gdsdb_slice_response */
136 static int hf_gdsdb_sliceresponse_length = -1;
138 static int hf_gdsdb_execute_statement = -1;
139 static int hf_gdsdb_execute_transaction = -1;
140 static int hf_gdsdb_execute_message_number = -1;
141 static int hf_gdsdb_execute_messages = -1;
143 static int hf_gdsdb_execute_outblr = -1;
144 static int hf_gdsdb_execute_outmsgnr = -1;
145 /* gdsdb_exec_immediate2 */
146 static int hf_gdsdb_prepare2_blr = -1;
147 static int hf_gdsdb_prepare2_number = -1;
148 static int hf_gdsdb_prepare2_messages = -1;
149 static int hf_gdsdb_prepare2_outblr = -1;
150 static int hf_gdsdb_prepare2_outmsgnr = -1;
152 static int hf_gdsdb_prepare_transaction = -1;
153 static int hf_gdsdb_prepare_statement = -1;
154 static int hf_gdsdb_prepare_dialect = -1;
155 static int hf_gdsdb_prepare_querystr = -1;
156 static int hf_gdsdb_prepare_items = -1;
157 static int hf_gdsdb_prepare_bufferlength = -1;
159 static int hf_gdsdb_fetch_statement = -1;
160 static int hf_gdsdb_fetch_message_number = -1;
161 static int hf_gdsdb_fetch_messages = -1;
162 /* gdsdb_fetch_response */
163 static int hf_gdsdb_fetchresponse_status = -1;
164 static int hf_gdsdb_fetchresponse_messages = -1;
165 /* gdsdb_free_statement */
166 static int hf_gdsdb_free_statement = -1;
167 static int hf_gdsdb_free_option = -1;
169 static int hf_gdsdb_insert_statement = -1;
170 static int hf_gdsdb_insert_message_number = -1;
171 static int hf_gdsdb_insert_messages = -1;
173 static int hf_gdsdb_cursor_statement = -1;
174 static int hf_gdsdb_cursor_type = -1;
175 /* gdsdb_sql_response */
176 static int hf_gdsdb_sqlresponse_messages = -1;
196 op_convert_lock = 16,
197 op_release_lock = 17,
204 op_start_and_send = 24,
220 op_info_database = 40,
221 op_info_request = 41,
222 op_info_transaction = 42,
224 op_batch_segments = 44,
225 op_mgr_set_affinity = 45,
226 op_mgr_clear_affinity = 46,
229 op_cancel_events = 49,
230 op_commit_retaining = 50,
233 op_connect_request = 53,
237 op_create_blob2 = 57,
242 op_allocate_statement = 62,
244 op_exec_immediate = 64,
246 op_fetch_response = 66,
247 op_free_statement = 67,
248 op_prepare_statement = 68,
252 op_response_piggyback = 72,
253 op_start_and_receive = 73,
254 op_start_send_and_receive = 74,
255 op_exec_immediate2 = 75,
258 op_sql_response = 78,
260 op_transact_response = 80,
261 op_drop_database = 81,
262 op_service_attach = 82,
263 op_service_detach = 83,
264 op_service_info = 84,
265 op_service_start = 85,
266 op_rollback_retaining = 86,
270 static const value_string gdsdb_opcode[] = {
272 { op_connect, "Connect" },
274 { op_accept, "Accept" },
275 { op_reject, "Reject" },
276 { op_protocol, "Protocol" },
277 { op_disconnect, "Disconnect" },
278 { op_credit, "Credit" },
279 { op_continuation, "Continuation" },
280 { op_response, "Response" },
281 { op_open_file, "Open file" },
282 { op_create_file, "Create file" },
283 { op_close_file, "Close file" },
284 { op_read_page, "Read page" },
285 { op_write_page, "Write page" },
287 { op_convert_lock, "Convert lock" },
288 { op_release_lock, "Release lock" },
289 { op_blocking, "Blocking" },
290 { op_attach, "Attach" },
291 { op_create, "Create" },
292 { op_detach, "Detach" },
293 { op_compile, "Compile" },
294 { op_start, "Start" },
295 { op_start_and_send, "Start and send" },
297 { op_receive, "Receive" },
298 { op_unwind, "Unwind" },
299 { op_release, "Release" },
300 { op_transaction, "Transaction" },
301 { op_commit, "Commit" },
302 { op_rollback, "Rollback" },
303 { op_prepare, "Prepare" },
304 { op_reconnect, "Reconnect" },
305 { op_create_blob, "Create blob" },
306 { op_open_blob, "Open blob" },
307 { op_get_segment, "Get segment" },
308 { op_put_segment, "Put segment" },
309 { op_cancel_blob, "Cancel blob" },
310 { op_close_blob, "Close blob" },
311 { op_info_database, "Info database" },
312 { op_info_request, "Info request" },
313 { op_transaction, "Info transaction" },
314 { op_info_blob, "Info blob" },
315 { op_batch_segments, "Batch segments" },
316 { op_mgr_set_affinity, "Mgr set affinity" },
317 { op_mgr_clear_affinity, "Mgr clear affinity" },
318 { op_mgr_report, "Mgr report" },
319 { op_que_events, "Que events" },
320 { op_cancel_events, "Cancel events" },
321 { op_commit_retaining, "Commit retaining" },
322 { op_prepare2, "Prepare 2" },
323 { op_event, "Event" },
324 { op_connect_request, "Connect request" },
325 { op_aux_connect, "Aux connect" },
327 { op_open_blob2, "Open blob 2" },
328 { op_create_blob2, "Create blob 2" },
329 { op_get_slice, "Get slice" },
330 { op_put_slice, "Put slice" },
331 { op_slice, "Slice" },
332 { op_seek_blob, "Seek blob" },
333 { op_allocate_statement, "Allocate statement" },
334 { op_execute, "Execute" },
335 { op_exec_immediate, "Exec immediate" },
336 { op_fetch, "Fetch" },
337 { op_fetch_response, "Fetch response" },
338 { op_free_statement, "Free statement" },
339 { op_prepare_statement, "Prepare statement" },
340 { op_set_cursor, "Set cursor" },
341 { op_info_sql, "Info sql" },
342 { op_dummy, "Dummy" },
343 { op_response_piggyback, "Response piggyback" },
344 { op_start_and_receive, "Start and receive" },
345 { op_start_send_and_receive, "Start send and receive" },
346 { op_exec_immediate2, "Exec immediate 2" },
347 { op_execute2, "Execute 2" },
348 { op_insert, "Insert" },
349 { op_sql_response, "Sql response" },
350 { op_transact_response, "Transact" },
351 { op_transact_response, "Transact response" },
352 { op_drop_database, "Drop database" },
353 { op_service_attach, "Service attach" },
354 { op_service_detach, "Service detach" },
355 { op_service_info, "Service info" },
356 { op_service_start, "Service start" },
357 { op_rollback_retaining, "Rollback retaining" },
361 static const value_string gdsdb_architectures[] = {
376 { 15, "mips Ultrix" },
381 { 20, "Apollo_dn10k" },
400 { 39, "Darwin PPC" },
405 gdsdb_dummy(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
407 /* Don't tell them we match */
412 gdsdb_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
419 proto_tree *pref_tree;
421 if (tvb_length(tvb) < 16) {
424 if (check_col(pinfo->cinfo, COL_INFO)){
425 col_append_str(pinfo->cinfo, COL_INFO, ": ");
426 col_append_str(pinfo->cinfo, COL_INFO,
427 tvb_format_text(tvb, 20,
428 tvb_get_ntohl(tvb, 16)));
432 proto_tree_add_item(tree, hf_gdsdb_connect_operation, tvb,
433 offset, 4, ENC_BIG_ENDIAN);
435 proto_tree_add_item(tree, hf_gdsdb_connect_version, tvb,
436 offset, 4, ENC_BIG_ENDIAN);
438 proto_tree_add_item(tree, hf_gdsdb_connect_client, tvb,
439 offset, 4, ENC_BIG_ENDIAN);
441 proto_tree_add_item(tree, hf_gdsdb_connect_filename, tvb,
442 offset, 4, ENC_ASCII|ENC_BIG_ENDIAN);
443 length = tvb_get_ntohl(tvb, offset);
444 offset += length + 6;
445 proto_tree_add_item(tree, hf_gdsdb_connect_count, tvb,
446 offset, 4, ENC_BIG_ENDIAN);
447 count = tvb_get_ntohl(tvb, offset);
449 proto_tree_add_item(tree, hf_gdsdb_connect_userid, tvb,
450 offset, 4, ENC_ASCII|ENC_BIG_ENDIAN);
451 length = tvb_get_ntohl(tvb, offset);
452 offset += length + 5;
453 for(i=0;i<count;i++){
454 ti = proto_tree_add_item(tree, hf_gdsdb_connect_pref,
455 tvb, offset, 20, ENC_NA);
456 pref_tree = proto_item_add_subtree(ti,
457 ett_gdsdb_connect_pref);
458 proto_tree_add_item(pref_tree,
459 hf_gdsdb_connect_pref_version,
460 tvb, offset, 4, ENC_BIG_ENDIAN);
462 proto_tree_add_item(pref_tree,
463 hf_gdsdb_connect_pref_architecture,
464 tvb, offset, 4, ENC_BIG_ENDIAN);
466 proto_tree_add_item(pref_tree,
467 hf_gdsdb_connect_pref_mintype,
468 tvb, offset, 4, ENC_BIG_ENDIAN);
470 proto_tree_add_item(pref_tree,
471 hf_gdsdb_connect_pref_maxtype,
472 tvb, offset, 4, ENC_BIG_ENDIAN);
474 proto_tree_add_item(pref_tree,
475 hf_gdsdb_connect_pref_weight,
476 tvb, offset, 4, ENC_BIG_ENDIAN);
481 return tvb_length(tvb);
485 gdsdb_accept(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
489 if (tvb_length(tvb) < 16) {
494 proto_tree_add_item(tree, hf_gdsdb_accept_version, tvb,
495 offset, 4, ENC_BIG_ENDIAN);
497 proto_tree_add_item(tree, hf_gdsdb_accept_architecture, tvb,
498 offset, 4, ENC_BIG_ENDIAN);
502 return tvb_length(tvb);
506 gdsdb_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
510 if (tvb_length(tvb) < 20) {
515 proto_tree_add_item(tree, hf_gdsdb_request_type, tvb,
516 offset, 4, ENC_BIG_ENDIAN);
518 proto_tree_add_item(tree, hf_gdsdb_request_object, tvb,
519 offset, 4, ENC_BIG_ENDIAN);
521 proto_tree_add_item(tree, hf_gdsdb_request_partner, tvb,
522 offset, 8, ENC_BIG_ENDIAN);
525 return tvb_length(tvb);
529 gdsdb_attach(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
534 if (tvb_length(tvb) < 20) {
537 if (check_col(pinfo->cinfo, COL_INFO)){
538 col_append_str(pinfo->cinfo, COL_INFO, ": ");
539 col_append_str(pinfo->cinfo, COL_INFO,
540 tvb_format_text(tvb, 12,
541 tvb_get_ntohl(tvb, 8)));
545 proto_tree_add_item(tree, hf_gdsdb_attach_database, tvb,
546 offset, 4, ENC_BIG_ENDIAN);
548 proto_tree_add_item(tree, hf_gdsdb_attach_filename, tvb,
549 offset, 4, ENC_ASCII|ENC_BIG_ENDIAN);
550 length = tvb_get_ntohl(tvb, offset);
551 offset += length + 6;
552 proto_tree_add_uint_format_value(tree,
553 hf_gdsdb_attach_dpb, tvb, offset, 4 + length,
554 length, "%i data bytes", length);
557 return tvb_length(tvb);
561 gdsdb_compile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
565 if (tvb_length(tvb) < 20) {
570 proto_tree_add_item(tree, hf_gdsdb_compile_database, tvb,
571 offset, 4, ENC_BIG_ENDIAN);
573 proto_tree_add_item(tree, hf_gdsdb_compile_blr, tvb,
574 offset, 4, ENC_ASCII|ENC_BIG_ENDIAN);
577 return tvb_length(tvb);
581 gdsdb_receive(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
585 if (tvb_length(tvb) < 20) {
590 proto_tree_add_item(tree, hf_gdsdb_receive_request, tvb,
591 offset, 4, ENC_BIG_ENDIAN);
593 proto_tree_add_item(tree, hf_gdsdb_receive_incarnation, tvb,
594 offset, 4, ENC_BIG_ENDIAN);
596 proto_tree_add_item(tree, hf_gdsdb_receive_transaction, tvb,
597 offset, 4, ENC_BIG_ENDIAN);
599 proto_tree_add_item(tree, hf_gdsdb_receive_msgnr, tvb,
600 offset, 4, ENC_BIG_ENDIAN);
602 proto_tree_add_item(tree, hf_gdsdb_receive_messages, tvb,
603 offset, 4, ENC_BIG_ENDIAN);
605 while(tvb_bytes_exist(tvb, offset, 12)) {
606 proto_tree_add_item(tree, hf_gdsdb_receive_direction,
607 tvb, offset, 4, ENC_BIG_ENDIAN);
609 proto_tree_add_item(tree, hf_gdsdb_receive_offset,
610 tvb, offset, 8, ENC_BIG_ENDIAN);
615 return tvb_length(tvb);
619 gdsdb_send(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
623 if (tvb_length(tvb) < 20) {
628 proto_tree_add_item(tree, hf_gdsdb_send_request, tvb,
629 offset, 4, ENC_BIG_ENDIAN);
631 proto_tree_add_item(tree, hf_gdsdb_send_incarnation, tvb,
632 offset, 4, ENC_BIG_ENDIAN);
634 proto_tree_add_item(tree, hf_gdsdb_send_transaction, tvb,
635 offset, 4, ENC_BIG_ENDIAN);
637 proto_tree_add_item(tree, hf_gdsdb_send_msgnr, tvb,
638 offset, 4, ENC_BIG_ENDIAN);
640 proto_tree_add_item(tree, hf_gdsdb_send_messages, tvb,
641 offset, 4, ENC_BIG_ENDIAN);
644 return tvb_length(tvb);
648 gdsdb_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
653 if (tvb_length(tvb) < 32) {
658 proto_tree_add_item(tree, hf_gdsdb_response_object, tvb,
659 offset, 4, ENC_BIG_ENDIAN);
661 proto_tree_add_item(tree, hf_gdsdb_response_blobid, tvb,
662 offset, 8, ENC_BIG_ENDIAN);
664 proto_tree_add_item(tree, hf_gdsdb_response_data, tvb,
665 offset, 4, ENC_ASCII|ENC_BIG_ENDIAN);
666 length = tvb_get_ntohl(tvb, offset);
667 offset += length + 4;
668 proto_tree_add_item(tree, hf_gdsdb_response_status, tvb,
669 offset, tvb_length(tvb) - offset, ENC_NA);
672 return tvb_length(tvb);
677 gdsdb_transact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
681 if (tvb_length(tvb) < 20) {
686 proto_tree_add_item(tree, hf_gdsdb_transact_database, tvb,
687 offset, 4, ENC_BIG_ENDIAN);
689 proto_tree_add_item(tree, hf_gdsdb_transact_transaction, tvb,
690 offset, 4, ENC_BIG_ENDIAN);
693 return tvb_length(tvb);
697 gdsdb_transact_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
702 if (tvb_length(tvb) < 8) {
707 proto_tree_add_item(tree, hf_gdsdb_transactresponse_messages,
708 tvb, offset, 4, ENC_BIG_ENDIAN);
711 return tvb_length(tvb);
715 gdsdb_open_blob2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
720 if (!tvb_bytes_exist(tvb, 0, 20)) {
725 proto_tree_add_item(tree, hf_gdsdb_openblob2_bpb, tvb, offset,
726 4, ENC_ASCII|ENC_BIG_ENDIAN);
727 length = tvb_get_ntohl(tvb, offset);
728 offset += length + 6;
729 proto_tree_add_item(tree, hf_gdsdb_openblob_transaction, tvb,
730 offset, 4, ENC_BIG_ENDIAN);
732 proto_tree_add_item(tree, hf_gdsdb_openblob_id, tvb, offset,
736 return tvb_length(tvb);
740 gdsdb_open_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
744 if (tvb_length(tvb) < 16) {
749 proto_tree_add_item(tree, hf_gdsdb_openblob_transaction, tvb,
750 offset, 4, ENC_BIG_ENDIAN);
752 proto_tree_add_item(tree, hf_gdsdb_openblob_id, tvb, offset,
756 return tvb_length(tvb);
760 gdsdb_segment(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
764 if (tvb_length(tvb) < 16) {
768 /* hf_gdsdb_segment_blob */
769 /* hf_gdsdb_segment_length */
770 /* hf_gdsdb_segment_segment */
773 return tvb_length(tvb);
777 gdsdb_seek_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
781 if (tvb_length(tvb) < 16) {
785 /* hf_gdsdb_seekblob_blob */
786 /* hf_gdsdb_seekblob_mode */
789 return tvb_length(tvb);
793 gdsdb_reconnect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
797 if (tvb_length(tvb) < 12) {
801 /* hf_gdsdb_reconnect_database */
804 return tvb_length(tvb);
808 gdsdb_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
814 if (tvb_length(tvb) < 20) {
818 opcode = tvb_get_ntohl(tvb, 0);
822 proto_tree_add_item(tree, hf_gdsdb_info_object, tvb, offset,
825 proto_tree_add_item(tree, hf_gdsdb_info_incarnation, tvb,
826 offset, 4, ENC_BIG_ENDIAN);
828 if(opcode == op_service_info) {
829 proto_tree_add_item(tree, hf_gdsdb_info_items, tvb,
830 offset, 4, ENC_ASCII|ENC_BIG_ENDIAN);
831 length = tvb_get_ntohl(tvb, offset);
832 offset += length + 6;
834 proto_tree_add_item(tree, hf_gdsdb_info_buffer_length, tvb,
835 offset, 4, ENC_BIG_ENDIAN);
838 return tvb_length(tvb);
842 gdsdb_service_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
846 if (tvb_length(tvb) < 16) {
850 /* hf_gdsdb_info_object */
851 /* hf_gdsdb_info_incarnation */
852 /* hf_gdsdb_info_items */
853 /* hf_gdsdb_info_buffer_length */
856 return tvb_length(tvb);
860 gdsdb_release(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
864 if (tvb_length(tvb) < 8) {
868 /* hf_gdsdb_release_object */
871 return tvb_length(tvb);
876 gdsdb_prepare2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
880 if (tvb_length(tvb) < 12) {
884 /* hf_gdsdb_prepare2_transaction */
887 return tvb_length(tvb);
892 gdsdb_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
896 if (tvb_length(tvb) < 24) {
900 /* hf_gdsdb_event_database */
901 /* hf_gdsdb_event_items */
902 /* hf_gdsdb_event_ast */
903 /* hf_gdsdb_event_arg */
904 /* hf_gdsdb_event_rid */
906 return tvb_length(tvb);
910 gdsdb_cancel_events(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
914 if (tvb_length(tvb) < 12) {
918 /* hf_gdsdb_event_database */
921 return tvb_length(tvb);
925 gdsdb_ddl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
929 if (tvb_length(tvb) < 16) {
933 /* hf_gdsdb_ddl_database */
934 /* hf_gdsdb_ddl_transaction */
935 /* hf_gdsdb_ddl_blr */
938 return tvb_length(tvb);
942 gdsdb_slice(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
946 if (tvb_length(tvb) < 24) {
950 /* hf_gdsdb_slice_transaction */
951 /* hf_gdsdb_slice_id */
952 /* hf_gdsdb_slice_sdl */
953 /* hf_gdsdb_slice_parameters */
956 return tvb_length(tvb);
960 gdsdb_slice_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
964 if (tvb_length(tvb) < 8) {
968 /* hf_gdsdb_sliceresponse_length */
971 return tvb_length(tvb);
975 gdsdb_execute(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
979 if (tvb_length(tvb) < 12) {
983 /* hf_gdsdb_execute_statement */
984 /* hf_gdsdb_execute_transaction */
985 /* hf_gdsdb_execute_message_number */
986 /* hf_gdsdb_execute_messages */
989 return tvb_length(tvb);
993 gdsdb_exec_immediate2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
997 if (tvb_length(tvb) < 44) {
1001 /* hf_gdsdb_prepare2_blr */
1002 /* hf_gdsdb_prepare2_number */
1003 /* hf_gdsdb_prepare2_messages */
1004 /* hf_gdsdb_prepare2_outblr */
1005 /* hf_gdsdb_prepare2_outmsgnr */
1008 return tvb_length(tvb);
1012 gdsdb_prepare(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1017 if (tvb_length(tvb) < 32) {
1020 if (check_col(pinfo->cinfo, COL_INFO)){
1021 col_append_str(pinfo->cinfo, COL_INFO, ": ");
1022 col_append_str(pinfo->cinfo, COL_INFO,
1023 tvb_format_text(tvb, 20,
1024 tvb_get_ntohl(tvb, 16)));
1028 proto_tree_add_item(tree, hf_gdsdb_prepare_transaction, tvb,
1029 offset, 4, ENC_BIG_ENDIAN);
1031 proto_tree_add_item(tree, hf_gdsdb_prepare_statement, tvb,
1032 offset, 4, ENC_BIG_ENDIAN);
1034 proto_tree_add_item(tree, hf_gdsdb_prepare_dialect, tvb,
1035 offset, 4, ENC_BIG_ENDIAN);
1037 proto_tree_add_item(tree, hf_gdsdb_prepare_querystr, tvb,
1038 offset, 4, ENC_ASCII|ENC_BIG_ENDIAN);
1039 length = tvb_get_ntohl(tvb, offset);
1040 offset += length + 6;
1041 proto_tree_add_uint_format_value(tree,
1042 hf_gdsdb_prepare_items, tvb, offset, 4 + length,
1043 length, "%i data bytes", length);
1044 offset += tvb_get_ntohl(tvb, offset) + 6;
1045 proto_tree_add_item(tree, hf_gdsdb_prepare_bufferlength, tvb,
1046 offset, 2, ENC_BIG_ENDIAN);
1049 return tvb_length(tvb);
1053 gdsdb_fetch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1057 if (tvb_length(tvb) < 16) {
1061 /* hf_gdsdb_fetch_statement */
1062 /* hf_gdsdb_fetch_message_number */
1063 /* hf_gdsdb_fetch_messages */
1066 return tvb_length(tvb);
1070 gdsdb_fetch_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1074 if (tvb_length(tvb) < 12) {
1078 /* hf_gdsdb_fetchresponse_status */
1079 /* hf_gdsdb_fetchresponse_messages */
1082 return tvb_length(tvb);
1086 gdsdb_free_statement(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1090 if (tvb_length(tvb) < 12) {
1094 /* hf_gdsdb_free_statement */
1095 /* hf_gdsdb_free_option */
1098 return tvb_length(tvb);
1102 gdsdb_insert(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1106 if (tvb_length(tvb) < 16) {
1110 /* hf_gdsdb_insert_statement */
1111 /* hf_gdsdb_insert_message_number */
1112 /* hf_gdsdb_insert_messages */
1115 return tvb_length(tvb);
1119 gdsdb_cursor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1123 if (tvb_length(tvb) < 16) {
1127 /* hf_gdsdb_cursor_statement */
1128 /* hf_gdsdb_cursor_type */
1131 return tvb_length(tvb);
1135 gdsdb_sql_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1139 if (tvb_length(tvb) < 8) {
1143 /* hf_gdsdb_sqlresponse_messages */
1146 return tvb_length(tvb);
1149 static int (*gdsdb_handle_opcode[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) = {
1150 gdsdb_dummy, /* op_void */
1151 gdsdb_connect, /* op_connect */
1152 gdsdb_dummy, /* op_exit */
1153 gdsdb_accept, /* op_accept */
1154 gdsdb_dummy, /* op_reject */
1155 gdsdb_dummy, /* op_protocol */
1156 gdsdb_dummy, /* op_disconnect */
1157 gdsdb_dummy, /* op_credit */
1158 gdsdb_dummy, /* op_continuation */
1159 gdsdb_response, /* op_response */
1160 gdsdb_dummy, /* op_open_file */
1161 gdsdb_dummy, /* op_create_file */
1162 gdsdb_dummy, /* op_close_file */
1163 gdsdb_dummy, /* op_read_page */
1164 gdsdb_dummy, /* op_write_page */
1165 gdsdb_dummy, /* op_lock */
1166 gdsdb_dummy, /* op_convert_lock */
1167 gdsdb_dummy, /* op_release_lock */
1168 gdsdb_dummy, /* op_blocking */
1169 gdsdb_attach, /* op_attach */
1170 gdsdb_attach, /* op_create */
1171 gdsdb_release, /* op_detach */
1172 gdsdb_compile, /* op_compile */
1173 gdsdb_receive, /* op_start */
1174 gdsdb_send, /* op_start_and_send */
1175 gdsdb_send, /* op_send */
1176 gdsdb_receive, /* op_receive */
1177 gdsdb_release, /* op_unwind */
1178 gdsdb_release, /* op_release */
1179 gdsdb_reconnect, /* op_transaction */
1180 gdsdb_release, /* op_commit */
1181 gdsdb_release, /* op_rollback */
1182 gdsdb_release, /* op_prepare */
1183 gdsdb_reconnect, /* op_reconnect */
1184 gdsdb_open_blob2, /* op_create_blob */
1185 gdsdb_open_blob, /* op_open_blob */
1186 gdsdb_segment, /* op_get_segment */
1187 gdsdb_segment, /* op_put_segment */
1188 gdsdb_release, /* op_cancel_blob */
1189 gdsdb_release, /* op_close_blob */
1190 gdsdb_info, /* op_info_database */
1191 gdsdb_info, /* op_info_request */
1192 gdsdb_info, /* op_info_transaction */
1193 gdsdb_info, /* op_info_blob */
1194 gdsdb_segment, /* op_batch_segments */
1195 gdsdb_dummy, /* op_mgr_set_affinity */
1196 gdsdb_dummy, /* op_mgr_clear_affinity */
1197 gdsdb_dummy, /* op_mgr_report */
1198 gdsdb_event, /* op_que_events */
1199 gdsdb_cancel_events, /* op_cancel_events */
1200 gdsdb_release, /* op_commit_retaining */
1201 gdsdb_release, /* op_prepare */
1202 gdsdb_event, /* op_event */
1203 gdsdb_request, /* op_connect_request */
1204 gdsdb_request, /* op_aux_connect */
1205 gdsdb_ddl, /* op_ddl */
1206 gdsdb_open_blob2, /* op_open_blob2 */
1207 gdsdb_open_blob2, /* op_create_blob2 */
1208 gdsdb_slice, /* op_get_slice */
1209 gdsdb_slice, /* op_put_slice */
1210 gdsdb_slice_response, /* op_slice */
1211 gdsdb_seek_blob, /* op_seek_blob */
1212 gdsdb_release, /* op_allocate_statement */
1213 gdsdb_execute, /* op_execute */
1214 gdsdb_prepare, /* op_exec_immediate */
1215 gdsdb_fetch, /* op_fetch */
1216 gdsdb_fetch_response, /* op_fetch_response */
1217 gdsdb_free_statement, /* op_free_statement */
1218 gdsdb_prepare, /* op_prepare_statement */
1219 gdsdb_cursor, /* op_set_cursor */
1220 gdsdb_info, /* op_info_sql */
1221 gdsdb_dummy, /* op_dummy */
1222 gdsdb_response, /* op_response_piggyback */
1223 gdsdb_receive, /* op_start_and_receive */
1224 gdsdb_send, /* op_start_send_and_receive */
1225 gdsdb_exec_immediate2, /* op_exec_immediate2 */
1226 gdsdb_execute, /* op_execute2 */
1227 gdsdb_insert, /* op_insert */
1228 gdsdb_sql_response, /* op_sql_response */
1229 gdsdb_transact, /* op_transact */
1230 gdsdb_transact_response, /* op_transact_response */
1231 gdsdb_release, /* op_drop_database */
1232 gdsdb_attach, /* op_service_attach */
1233 gdsdb_release, /* op_service_detach */
1234 gdsdb_info, /* op_service_info */
1235 gdsdb_service_start, /* op_service_start */
1236 gdsdb_release /* op_rollback_retaining */
1240 dissect_gdsdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1243 proto_tree *gdsdb_tree;
1247 gdsdb_tree = NULL; /* So the opcode functions can check on if(tree) */
1250 if (tvb_length(tvb) < 4)
1253 opcode = tvb_get_ntohl(tvb, 0);
1254 if(opcode >= op_max)
1256 if(!gdsdb_handle_opcode[opcode](tvb, &nopi, NULL))
1259 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GDS DB");
1261 if (check_col(pinfo->cinfo, COL_INFO))
1262 col_add_str(pinfo->cinfo, COL_INFO,
1263 val_to_str(opcode, gdsdb_opcode, "Unknown opcode %u"));
1266 ti = proto_tree_add_item(tree, proto_gdsdb, tvb, 0, -1,
1268 gdsdb_tree = proto_item_add_subtree(ti, ett_gdsdb);
1269 proto_tree_add_item(gdsdb_tree, hf_gdsdb_opcode, tvb,
1270 0, 4, ENC_BIG_ENDIAN);
1273 /* opcode < op_max */
1274 return gdsdb_handle_opcode[opcode](tvb, pinfo, gdsdb_tree);
1278 proto_register_gdsdb(void)
1280 static hf_register_info hf[] = {
1282 { "Opcode", "gdsdb.opcode",
1283 FT_UINT32, BASE_DEC, VALS(gdsdb_opcode), 0x0,
1288 { &hf_gdsdb_connect_operation,
1289 { "Operation", "gdsdb.connect.operation",
1290 FT_UINT32, BASE_DEC, VALS(gdsdb_opcode), 0x0,
1293 { &hf_gdsdb_connect_version,
1294 { "Version", "gdsdb.connect.version",
1295 FT_UINT32, BASE_DEC, NULL, 0x0,
1298 { &hf_gdsdb_connect_client,
1299 { "Client Architecture", "gdsdb.connect.client",
1300 FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1303 { &hf_gdsdb_connect_filename,
1304 { "Filename", "gdsdb.connect.filename",
1305 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1308 { &hf_gdsdb_connect_count,
1309 { "Version option count", "gdsdb.connect.count",
1310 FT_UINT32, BASE_DEC, NULL, 0x0,
1313 { &hf_gdsdb_connect_userid,
1314 { "User ID", "gdsdb.connect.userid",
1315 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1318 { &hf_gdsdb_connect_pref,
1319 { "Preferred version", "gdsdb.connect.pref",
1320 FT_NONE, BASE_NONE, NULL, 0x0,
1323 { &hf_gdsdb_connect_pref_version,
1324 { "Version", "gdsdb.connect.pref.version",
1325 FT_UINT32, BASE_DEC, NULL, 0x0,
1328 { &hf_gdsdb_connect_pref_architecture,
1329 { "Architecture", "gdsdb.connect.pref.arch",
1330 FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1333 { &hf_gdsdb_connect_pref_mintype,
1334 { "Minimum type", "gdsdb.connect.pref.mintype",
1335 FT_UINT32, BASE_DEC, NULL, 0x0,
1338 { &hf_gdsdb_connect_pref_maxtype,
1339 { "Maximum type", "gdsdb.connect.pref.maxtype",
1340 FT_UINT32, BASE_DEC, NULL, 0x0,
1343 { &hf_gdsdb_connect_pref_weight,
1344 { "Preference weight", "gdsdb.connect.pref.weight",
1345 FT_UINT32, BASE_DEC, NULL, 0x0,
1349 { &hf_gdsdb_accept_version,
1350 { "Version", "gdsdb.accept.version",
1351 FT_UINT32, BASE_DEC, NULL, 0x0,
1354 { &hf_gdsdb_accept_architecture,
1355 { "Architecture", "gdsdb.accept.arch",
1356 FT_UINT32, BASE_DEC, VALS(gdsdb_architectures), 0x0,
1360 { &hf_gdsdb_request_type,
1361 { "Type", "gdsdb.connect.type",
1362 FT_UINT32, BASE_DEC, NULL, 0x0,
1365 { &hf_gdsdb_request_object,
1366 { "Object", "gdsdb.connect.object",
1367 FT_UINT32, BASE_DEC, NULL, 0x0,
1370 { &hf_gdsdb_request_partner,
1371 { "Partner", "gdsdb.connect.partner",
1372 FT_UINT64, BASE_DEC, NULL, 0x0,
1376 { &hf_gdsdb_attach_database,
1377 { "Database", "gdsdb.attach.database",
1378 FT_UINT32, BASE_DEC, NULL, 0x0,
1381 { &hf_gdsdb_attach_filename,
1382 { "Filename", "gdsdb.attach.filename",
1383 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1386 { &hf_gdsdb_attach_dpb,
1387 { "Database parameter block", "gdsdb.attach.dpblength",
1388 FT_UINT32, BASE_DEC, NULL, 0x0,
1392 { &hf_gdsdb_compile_database,
1393 { "Database", "gdsdb.compile.filename",
1394 FT_UINT32, BASE_DEC, NULL, 0x0,
1397 { &hf_gdsdb_compile_blr,
1398 { "BLR", "gdsdb.compile.blr",
1399 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1403 { &hf_gdsdb_receive_request,
1404 { "Request", "gdsdb.receive.request",
1405 FT_UINT32, BASE_DEC, NULL, 0x0,
1408 { &hf_gdsdb_receive_incarnation,
1409 { "Incarnation", "gdsdb.receive.incarnation",
1410 FT_UINT32, BASE_DEC, NULL, 0x0,
1413 { &hf_gdsdb_receive_transaction,
1414 { "Transaction", "gdsdb.receive.transaction",
1415 FT_UINT32, BASE_DEC, NULL, 0x0,
1418 { &hf_gdsdb_receive_msgnr,
1419 { "Message number", "gdsdb.receive.msgnr",
1420 FT_UINT32, BASE_DEC, NULL, 0x0,
1423 { &hf_gdsdb_receive_messages,
1424 { "Message Count", "gdsdb.receive.msgcount",
1425 FT_UINT32, BASE_DEC, NULL, 0x0,
1428 { &hf_gdsdb_receive_direction,
1429 { "Scroll direction", "gdsdb.receive.direction",
1430 FT_UINT32, BASE_DEC, NULL, 0x0,
1433 { &hf_gdsdb_receive_offset,
1434 { "Scroll offset", "gdsdb.receive.offset",
1435 FT_UINT32, BASE_DEC, NULL, 0x0,
1439 { &hf_gdsdb_send_request,
1440 { "Send request", "gdsdb.send.request",
1441 FT_UINT32, BASE_DEC, NULL, 0x0,
1444 { &hf_gdsdb_send_incarnation,
1445 { "Send request", "gdsdb.send.incarnation",
1446 FT_UINT32, BASE_DEC, NULL, 0x0,
1449 { &hf_gdsdb_send_transaction,
1450 { "Send request", "gdsdb.send.transaction",
1451 FT_UINT32, BASE_DEC, NULL, 0x0,
1454 { &hf_gdsdb_send_msgnr,
1455 { "Send request", "gdsdb.send.msgnr",
1456 FT_UINT32, BASE_DEC, NULL, 0x0,
1459 { &hf_gdsdb_send_messages,
1460 { "Send request", "gdsdb.send.messages",
1461 FT_UINT32, BASE_DEC, NULL, 0x0,
1464 /* gdsdb_response */
1465 { &hf_gdsdb_response_object,
1466 { "Response object", "gdsdb.response.object",
1467 FT_UINT32, BASE_HEX, NULL, 0x0,
1470 { &hf_gdsdb_response_blobid,
1471 { "Blob ID", "gdsdb.response.blobid",
1472 FT_UINT64, BASE_HEX, NULL, 0x0,
1475 { &hf_gdsdb_response_data,
1476 { "Data", "gdsdb.response.data",
1477 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1480 { &hf_gdsdb_response_status,
1481 { "Status vector", "gdsdb.response.status",
1482 FT_NONE, BASE_NONE, NULL, 0x0,
1485 /* gdsdb_transact */
1486 { &hf_gdsdb_transact_database,
1487 { "Database", "gdsdb.transact.database",
1488 FT_UINT32, BASE_DEC, NULL, 0x0,
1491 { &hf_gdsdb_transact_transaction,
1492 { "Database", "gdsdb.transact.transaction",
1493 FT_UINT32, BASE_DEC, NULL, 0x0,
1496 { &hf_gdsdb_transact_messages,
1497 { "Messages", "gdsdb.transact.messages",
1498 FT_UINT32, BASE_DEC, NULL, 0x0,
1501 /* gdsdb_transact_response */
1502 { &hf_gdsdb_transactresponse_messages,
1503 { "Messages", "gdsdb.transactresponse.messages",
1504 FT_UINT32, BASE_DEC, NULL, 0x0,
1507 /* gdsdb_open_blob2 */
1508 { &hf_gdsdb_openblob2_bpb,
1509 { "Blob parameter block", "gdsdb.openblob2.bpb",
1510 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1513 /* gdsdb_open_blob */
1514 { &hf_gdsdb_openblob_transaction,
1515 { "Transaction", "gdsdb.openblob2.transaction",
1516 FT_UINT32, BASE_DEC, NULL, 0x0,
1519 { &hf_gdsdb_openblob_id,
1520 { "ID", "gdsdb.openblob.id",
1521 FT_UINT64, BASE_HEX, NULL, 0x0,
1525 { &hf_gdsdb_segment_blob,
1526 { "Blob", "gdsdb.segment.blob",
1527 FT_UINT32, BASE_DEC, NULL, 0x0,
1530 { &hf_gdsdb_segment_length,
1531 { "Length", "gdsdb.segment.length",
1532 FT_UINT32, BASE_DEC, NULL, 0x0,
1535 { &hf_gdsdb_segment_segment,
1536 { "Segment", "gdsdb.segment.segment",
1537 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1540 /* gdsdb_seek_blob */
1541 { &hf_gdsdb_seekblob_blob,
1542 { "Blob", "gdsdb.seekblob.blob",
1543 FT_UINT32, BASE_DEC, NULL, 0x0,
1546 { &hf_gdsdb_seekblob_mode,
1547 { "Mode", "gdsdb.seekblob.mode",
1548 FT_UINT32, BASE_DEC, NULL, 0x0,
1551 /* gdsdb_reconnect */
1552 { &hf_gdsdb_reconnect_database,
1553 { "Database", "gdsdb.reconnect.database",
1554 FT_UINT32, BASE_DEC, NULL, 0x0,
1557 /* gdsdb_info & gdsdb_service_start */
1558 { &hf_gdsdb_info_object,
1559 { "Object", "gdsdb.info.object",
1560 FT_UINT32, BASE_DEC, NULL, 0x0,
1563 { &hf_gdsdb_info_incarnation,
1564 { "Incarnation", "gdsdb.info.object",
1565 FT_UINT32, BASE_DEC, NULL, 0x0,
1568 { &hf_gdsdb_info_items,
1569 { "Items", "gdsdb.info.items",
1570 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1573 { &hf_gdsdb_info_buffer_length,
1574 { "Buffer length", "gdsdb.info.bufferlength",
1575 FT_UINT32, BASE_DEC, NULL, 0x0,
1579 { &hf_gdsdb_release_object,
1580 { "Object", "gdsdb.release.object",
1581 FT_UINT32, BASE_DEC, NULL, 0x0,
1584 /* gdsdb_prepare2 */
1585 { &hf_gdsdb_prepare2_transaction,
1586 { "Transaction", "gdsdb.prepare2.transaction",
1587 FT_UINT32, BASE_DEC, NULL, 0x0,
1590 /* gdsdb_event & gdsdb_cancel_events */
1591 { &hf_gdsdb_event_database,
1592 { "Database", "gdsdb.event.database",
1593 FT_UINT32, BASE_DEC, NULL, 0x0,
1596 { &hf_gdsdb_event_items,
1597 { "Event description block", "gdsdb.event.items",
1598 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1601 { &hf_gdsdb_event_ast,
1602 { "ast routine", "gdsdb.event.ast",
1603 FT_UINT32, BASE_DEC, NULL, 0x0,
1606 { &hf_gdsdb_event_arg,
1607 { "Argument to ast routine", "gdsdb.event.arg",
1608 FT_UINT32, BASE_DEC, NULL, 0x0,
1611 { &hf_gdsdb_event_rid,
1612 { "ID", "gdsdb.event.id",
1613 FT_UINT32, BASE_DEC, NULL, 0x0,
1617 { &hf_gdsdb_ddl_database,
1618 { "Database", "gdsdb.ddl.database",
1619 FT_UINT32, BASE_DEC, NULL, 0x0,
1622 { &hf_gdsdb_ddl_transaction,
1623 { "Transaction", "gdsdb.ddl.transaction",
1624 FT_UINT32, BASE_DEC, NULL, 0x0,
1627 { &hf_gdsdb_ddl_blr,
1628 { "BLR", "gdsdb.ddl.blr",
1629 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1633 { &hf_gdsdb_slice_transaction,
1634 { "Transaction", "gdsdb.slice.transaction",
1635 FT_UINT32, BASE_DEC, NULL, 0x0,
1638 { &hf_gdsdb_slice_id,
1639 { "ID", "gdsdb.slice.id",
1640 FT_UINT64, BASE_HEX, NULL, 0x0,
1643 { &hf_gdsdb_slice_sdl,
1644 { "Slice description language", "gdsdb.slice.sdl",
1645 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1648 { &hf_gdsdb_slice_parameters,
1649 { "Parameters", "gdsdb.slice.parameters",
1650 FT_UINT32, BASE_DEC, NULL, 0x0,
1653 /* gdsdb_slice_response */
1654 { &hf_gdsdb_sliceresponse_length,
1655 { "Length", "gdsdb.sliceresponse.length",
1656 FT_UINT32, BASE_DEC, NULL, 0x0,
1660 { &hf_gdsdb_execute_statement,
1661 { "Statement", "gdsdb.execute.statement",
1662 FT_UINT32, BASE_DEC, NULL, 0x0,
1665 { &hf_gdsdb_execute_transaction,
1666 { "Transaction", "gdsdb.execute.transaction",
1667 FT_UINT32, BASE_DEC, NULL, 0x0,
1670 { &hf_gdsdb_execute_message_number,
1671 { "Message number", "gdsdb.execute.messagenumber",
1672 FT_UINT32, BASE_DEC, NULL, 0x0,
1675 { &hf_gdsdb_execute_messages,
1676 { "Number of messages", "gdsdb.execute.messages",
1677 FT_UINT32, BASE_DEC, NULL, 0x0,
1680 /* gdsdb_execute2 */
1681 { &hf_gdsdb_execute_outblr,
1682 { "Output BLR", "gdsdb.execute.outblr",
1683 FT_UINT32, BASE_DEC, NULL, 0x0,
1686 { &hf_gdsdb_execute_outmsgnr,
1687 { "Output Message number", "gdsdb.execute.outmsgnr",
1688 FT_UINT32, BASE_DEC, NULL, 0x0,
1691 /* gdsdb_exec_immediate2 */
1692 { &hf_gdsdb_prepare2_blr,
1693 { "BLR", "gdsdb.prepare.blr",
1694 FT_UINT32, BASE_DEC, NULL, 0x0,
1697 { &hf_gdsdb_prepare2_number,
1698 { "Message number", "gdsdb.prepare2.messagenumber",
1699 FT_UINT32, BASE_DEC, NULL, 0x0,
1702 { &hf_gdsdb_prepare2_messages,
1703 { "Number of messages", "gdsdb.prepare2.messages",
1704 FT_UINT32, BASE_DEC, NULL, 0x0,
1707 { &hf_gdsdb_prepare2_outblr,
1708 { "Output BLR", "gdsdb.prepare2.outblr",
1709 FT_UINT32, BASE_DEC, NULL, 0x0,
1712 { &hf_gdsdb_prepare2_outmsgnr,
1713 { "Output Message number", "gdsdb.prepare2.outmsgnr",
1714 FT_UINT32, BASE_DEC, NULL, 0x0,
1718 { &hf_gdsdb_prepare_transaction,
1719 { "Prepare, Transaction", "gdsdb.prepare.transaction",
1720 FT_UINT32, BASE_DEC, NULL, 0x0,
1723 { &hf_gdsdb_prepare_statement,
1724 { "Prepare, Statement", "gdsdb.prepare.statement",
1725 FT_UINT32, BASE_DEC, NULL, 0x0,
1728 { &hf_gdsdb_prepare_dialect,
1729 { "Prepare, Dialect", "gdsdb.prepare.dialect",
1730 FT_UINT32, BASE_DEC, NULL, 0x0,
1733 { &hf_gdsdb_prepare_querystr,
1734 { "Prepare, Query", "gdsdb.prepare.querystr",
1735 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
1738 { &hf_gdsdb_prepare_items,
1739 { "Prepare, Information items", "gdsdb.prepare.items",
1740 FT_UINT32, BASE_DEC, NULL, 0x0,
1743 { &hf_gdsdb_prepare_bufferlength,
1744 { "Prepare, Bufferlength", "gdsdb.prepare.bufferlen",
1745 FT_UINT32, BASE_DEC, NULL, 0x0,
1749 { &hf_gdsdb_fetch_statement,
1750 { "Statement", "gdsdb.fetch.statement",
1751 FT_UINT32, BASE_DEC, NULL, 0x0,
1754 { &hf_gdsdb_fetch_message_number,
1755 { "Message number", "gdsdb.fetch.messagenr",
1756 FT_UINT32, BASE_DEC, NULL, 0x0,
1759 { &hf_gdsdb_fetch_messages,
1760 { "Number of messages", "gdsdb.fetch.messages",
1761 FT_UINT32, BASE_DEC, NULL, 0x0,
1764 /* gdsdb_fetch_response */
1765 { &hf_gdsdb_fetchresponse_status,
1766 { "Status", "gdsdb.fetchresponse.status",
1767 FT_UINT32, BASE_DEC, NULL, 0x0,
1770 { &hf_gdsdb_fetchresponse_messages,
1771 { "Number of messages", "gdsdb.fetchresponse.messages",
1772 FT_UINT32, BASE_DEC, NULL, 0x0,
1775 /* gdsdb_free_statement */
1776 { &hf_gdsdb_free_statement,
1777 { "Statement", "gdsdb.fetchresponse.statement",
1778 FT_UINT32, BASE_DEC, NULL, 0x0,
1781 { &hf_gdsdb_free_option,
1782 { "Option", "gdsdb.fetchresponse.option",
1783 FT_UINT32, BASE_DEC, NULL, 0x0,
1787 { &hf_gdsdb_insert_statement,
1788 { "Statement", "gdsdb.insert.statement",
1789 FT_UINT32, BASE_DEC, NULL, 0x0,
1792 { &hf_gdsdb_insert_message_number,
1793 { "Message number", "gdsdb.insert.messagenr",
1794 FT_UINT32, BASE_DEC, NULL, 0x0,
1797 { &hf_gdsdb_insert_messages,
1798 { "Number of messages", "gdsdb.insert.messages",
1799 FT_UINT32, BASE_DEC, NULL, 0x0,
1803 { &hf_gdsdb_cursor_statement,
1804 { "Statement", "gdsdb.cursor.statement",
1805 FT_UINT32, BASE_DEC, NULL, 0x0,
1808 { &hf_gdsdb_cursor_type,
1809 { "Type", "gdsdb.cursor.type",
1810 FT_UINT32, BASE_DEC, NULL, 0x0,
1813 /* gdsdb_sql_response */
1814 { &hf_gdsdb_sqlresponse_messages,
1815 { "SQL Response, Message Count", "gdsdb.sqlresponse.msgcount",
1816 FT_UINT32, BASE_DEC, NULL, 0x0,
1821 static gint *ett[] = {
1824 &ett_gdsdb_connect_pref
1827 proto_gdsdb = proto_register_protocol(
1828 "Firebird SQL Database Remote Protocol",
1829 "FB/IB GDS DB", "gdsdb");
1831 proto_register_field_array(proto_gdsdb, hf, array_length(hf));
1832 proto_register_subtree_array(ett, array_length(ett));
1836 proto_reg_handoff_gdsdb(void)
1838 /* Main dissector */
1840 dissector_handle_t gdsdb_handle;
1842 gdsdb_handle = new_create_dissector_handle(dissect_gdsdb,
1844 dissector_add_uint("tcp.port", TCP_PORT, gdsdb_handle);