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;
91 static int hf_gdsdb_transact_messages
= -1;
93 /* gdsdb_transact_response */
94 static int hf_gdsdb_transactresponse_messages
= -1;
95 /* gdsdb_open_blob2 */
96 static int hf_gdsdb_openblob2_bpb
= -1;
98 static int hf_gdsdb_openblob_transaction
= -1;
99 static int hf_gdsdb_openblob_id
= -1;
102 static int hf_gdsdb_segment_blob
= -1;
103 static int hf_gdsdb_segment_length
= -1;
104 static int hf_gdsdb_segment_segment
= -1;
105 /* gdsdb_seek_blob */
106 static int hf_gdsdb_seekblob_blob
= -1;
107 static int hf_gdsdb_seekblob_mode
= -1;
108 /* gdsdb_reconnect */
109 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;
118 static int hf_gdsdb_release_object
= -1;
120 static int hf_gdsdb_prepare2_transaction
= -1;
121 /* gdsdb_event & gdsdb_cancel_events */
122 static int hf_gdsdb_event_database
= -1;
123 static int hf_gdsdb_event_items
= -1;
124 static int hf_gdsdb_event_ast
= -1;
125 static int hf_gdsdb_event_arg
= -1;
126 static int hf_gdsdb_event_rid
= -1;
128 static int hf_gdsdb_ddl_database
= -1;
129 static int hf_gdsdb_ddl_transaction
= -1;
130 static int hf_gdsdb_ddl_blr
= -1;
132 static int hf_gdsdb_slice_transaction
= -1;
133 static int hf_gdsdb_slice_id
= -1;
134 static int hf_gdsdb_slice_sdl
= -1;
135 static int hf_gdsdb_slice_parameters
= -1;
136 /* gdsdb_slice_response */
137 static int hf_gdsdb_sliceresponse_length
= -1;
139 static int hf_gdsdb_execute_statement
= -1;
140 static int hf_gdsdb_execute_transaction
= -1;
141 static int hf_gdsdb_execute_message_number
= -1;
142 static int hf_gdsdb_execute_messages
= -1;
144 static int hf_gdsdb_execute_outblr
= -1;
145 static int hf_gdsdb_execute_outmsgnr
= -1;
146 /* gdsdb_exec_immediate2 */
147 static int hf_gdsdb_prepare2_blr
= -1;
148 static int hf_gdsdb_prepare2_number
= -1;
149 static int hf_gdsdb_prepare2_messages
= -1;
150 static int hf_gdsdb_prepare2_outblr
= -1;
151 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;
162 static int hf_gdsdb_fetch_statement
= -1;
163 static int hf_gdsdb_fetch_message_number
= -1;
164 static int hf_gdsdb_fetch_messages
= -1;
165 /* gdsdb_fetch_response */
166 static int hf_gdsdb_fetchresponse_status
= -1;
167 static int hf_gdsdb_fetchresponse_messages
= -1;
168 /* gdsdb_free_statement */
169 static int hf_gdsdb_free_statement
= -1;
170 static int hf_gdsdb_free_option
= -1;
172 static int hf_gdsdb_insert_statement
= -1;
173 static int hf_gdsdb_insert_message_number
= -1;
174 static int hf_gdsdb_insert_messages
= -1;
176 static int hf_gdsdb_cursor_statement
= -1;
177 static int hf_gdsdb_cursor_type
= -1;
178 /* gdsdb_sql_response */
179 static int hf_gdsdb_sqlresponse_messages
= -1;
200 op_convert_lock
= 16,
201 op_release_lock
= 17,
208 op_start_and_send
= 24,
224 op_info_database
= 40,
225 op_info_request
= 41,
226 op_info_transaction
= 42,
228 op_batch_segments
= 44,
229 op_mgr_set_affinity
= 45,
230 op_mgr_clear_affinity
= 46,
233 op_cancel_events
= 49,
234 op_commit_retaining
= 50,
237 op_connect_request
= 53,
241 op_create_blob2
= 57,
246 op_allocate_statement
= 62,
248 op_exec_immediate
= 64,
250 op_fetch_response
= 66,
251 op_free_statement
= 67,
252 op_prepare_statement
= 68,
256 op_response_piggyback
= 72,
257 op_start_and_receive
= 73,
258 op_start_send_and_receive
= 74,
259 op_exec_immediate2
= 75,
262 op_sql_response
= 78,
264 op_transact_response
= 80,
265 op_drop_database
= 81,
266 op_service_attach
= 82,
267 op_service_detach
= 83,
268 op_service_info
= 84,
269 op_service_start
= 85,
270 op_rollback_retaining
= 86,
274 static const value_string gdsdb_opcode
[] = {
276 { op_connect
, "Connect" },
278 { op_accept
, "Accept" },
279 { op_reject
, "Reject" },
280 { op_protocol
, "Protocol" },
281 { op_disconnect
, "Disconnect" },
282 { op_credit
, "Credit" },
283 { op_continuation
, "Continuation" },
284 { op_response
, "Response" },
285 { op_open_file
, "Open file" },
286 { op_create_file
, "Create file" },
287 { op_close_file
, "Close file" },
288 { op_read_page
, "Read page" },
289 { op_write_page
, "Write page" },
291 { op_convert_lock
, "Convert lock" },
292 { op_release_lock
, "Release lock" },
293 { op_blocking
, "Blocking" },
294 { op_attach
, "Attach" },
295 { op_create
, "Create" },
296 { op_detach
, "Detach" },
297 { op_compile
, "Compile" },
298 { op_start
, "Start" },
299 { op_start_and_send
, "Start and send" },
301 { op_receive
, "Receive" },
302 { op_unwind
, "Unwind" },
303 { op_release
, "Release" },
304 { op_transaction
, "Transaction" },
305 { op_commit
, "Commit" },
306 { op_rollback
, "Rollback" },
307 { op_prepare
, "Prepare" },
308 { op_reconnect
, "Reconnect" },
309 { op_create_blob
, "Create blob" },
310 { op_open_blob
, "Open blob" },
311 { op_get_segment
, "Get segment" },
312 { op_put_segment
, "Put segment" },
313 { op_cancel_blob
, "Cancel blob" },
314 { op_close_blob
, "Close blob" },
315 { op_info_database
, "Info database" },
316 { op_info_request
, "Info request" },
317 { op_info_transaction
, "Info transaction" },
318 { op_info_blob
, "Info blob" },
319 { op_batch_segments
, "Batch segments" },
320 { op_mgr_set_affinity
, "Mgr set affinity" },
321 { op_mgr_clear_affinity
, "Mgr clear affinity" },
322 { op_mgr_report
, "Mgr report" },
323 { op_que_events
, "Que events" },
324 { op_cancel_events
, "Cancel events" },
325 { op_commit_retaining
, "Commit retaining" },
326 { op_prepare2
, "Prepare 2" },
327 { op_event
, "Event" },
328 { op_connect_request
, "Connect request" },
329 { op_aux_connect
, "Aux connect" },
331 { op_open_blob2
, "Open blob 2" },
332 { op_create_blob2
, "Create blob 2" },
333 { op_get_slice
, "Get slice" },
334 { op_put_slice
, "Put slice" },
335 { op_slice
, "Slice" },
336 { op_seek_blob
, "Seek blob" },
337 { op_allocate_statement
, "Allocate statement" },
338 { op_execute
, "Execute" },
339 { op_exec_immediate
, "Exec immediate" },
340 { op_fetch
, "Fetch" },
341 { op_fetch_response
, "Fetch response" },
342 { op_free_statement
, "Free statement" },
343 { op_prepare_statement
, "Prepare statement" },
344 { op_set_cursor
, "Set cursor" },
345 { op_info_sql
, "Info sql" },
346 { op_dummy
, "Dummy" },
347 { op_response_piggyback
, "Response piggyback" },
348 { op_start_and_receive
, "Start and receive" },
349 { op_start_send_and_receive
, "Start send and receive" },
350 { op_exec_immediate2
, "Exec immediate 2" },
351 { op_execute2
, "Execute 2" },
352 { op_insert
, "Insert" },
353 { op_sql_response
, "Sql response" },
354 { op_transact
, "Transact" },
355 { op_transact_response
, "Transact response" },
356 { op_drop_database
, "Drop database" },
357 { op_service_attach
, "Service attach" },
358 { op_service_detach
, "Service detach" },
359 { op_service_info
, "Service info" },
360 { op_service_start
, "Service start" },
361 { op_rollback_retaining
, "Rollback retaining" },
365 static const value_string gdsdb_architectures
[] = {
380 { 15, "mips Ultrix" },
385 { 20, "Apollo_dn10k" },
404 { 39, "Darwin PPC" },
409 gdsdb_dummy(tvbuff_t
*tvb _U_
, packet_info
*pinfo _U_
, proto_tree
*tree _U_
)
411 /* Don't tell them we match */
416 gdsdb_connect(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
423 proto_tree
*pref_tree
;
425 if (tvb_length(tvb
) < 16) {
428 col_append_str(pinfo
->cinfo
, COL_INFO
, ": ");
429 col_append_str(pinfo
->cinfo
, COL_INFO
,
430 tvb_format_text(tvb
, 20,
431 tvb_get_ntohl(tvb
, 16)));
434 proto_tree_add_item(tree
, hf_gdsdb_connect_operation
, tvb
,
435 offset
, 4, ENC_BIG_ENDIAN
);
437 proto_tree_add_item(tree
, hf_gdsdb_connect_version
, tvb
,
438 offset
, 4, ENC_BIG_ENDIAN
);
440 proto_tree_add_item(tree
, hf_gdsdb_connect_client
, tvb
,
441 offset
, 4, ENC_BIG_ENDIAN
);
443 proto_tree_add_item(tree
, hf_gdsdb_connect_filename
, tvb
,
444 offset
, 4, ENC_ASCII
|ENC_NA
);
445 length
= tvb_get_ntohl(tvb
, offset
);
446 offset
+= length
+ 6;
447 proto_tree_add_item(tree
, hf_gdsdb_connect_count
, tvb
,
448 offset
, 4, ENC_BIG_ENDIAN
);
449 count
= tvb_get_ntohl(tvb
, offset
);
451 proto_tree_add_item(tree
, hf_gdsdb_connect_userid
, tvb
,
452 offset
, 4, ENC_ASCII
|ENC_NA
);
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, ENC_NA
);
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, ENC_BIG_ENDIAN
);
464 proto_tree_add_item(pref_tree
,
465 hf_gdsdb_connect_pref_architecture
,
466 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
468 proto_tree_add_item(pref_tree
,
469 hf_gdsdb_connect_pref_mintype
,
470 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
472 proto_tree_add_item(pref_tree
,
473 hf_gdsdb_connect_pref_maxtype
,
474 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
476 proto_tree_add_item(pref_tree
,
477 hf_gdsdb_connect_pref_weight
,
478 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
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
,
497 offset
, 4, ENC_BIG_ENDIAN
);
499 proto_tree_add_item(tree
, hf_gdsdb_accept_architecture
, tvb
,
500 offset
, 4, ENC_BIG_ENDIAN
);
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
,
518 offset
, 4, ENC_BIG_ENDIAN
);
520 proto_tree_add_item(tree
, hf_gdsdb_request_object
, tvb
,
521 offset
, 4, ENC_BIG_ENDIAN
);
523 proto_tree_add_item(tree
, hf_gdsdb_request_partner
, tvb
,
524 offset
, 8, ENC_BIG_ENDIAN
);
527 return tvb_length(tvb
);
531 gdsdb_attach(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
536 if (tvb_length(tvb
) < 20) {
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
,
548 offset
, 4, ENC_BIG_ENDIAN
);
550 proto_tree_add_item(tree
, hf_gdsdb_attach_filename
, tvb
,
551 offset
, 4, ENC_ASCII
|ENC_NA
);
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
,
573 offset
, 4, ENC_BIG_ENDIAN
);
575 proto_tree_add_item(tree
, hf_gdsdb_compile_blr
, tvb
,
576 offset
, 4, ENC_ASCII
|ENC_NA
);
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
,
593 offset
, 4, ENC_BIG_ENDIAN
);
595 proto_tree_add_item(tree
, hf_gdsdb_receive_incarnation
, tvb
,
596 offset
, 4, ENC_BIG_ENDIAN
);
598 proto_tree_add_item(tree
, hf_gdsdb_receive_transaction
, tvb
,
599 offset
, 4, ENC_BIG_ENDIAN
);
601 proto_tree_add_item(tree
, hf_gdsdb_receive_msgnr
, tvb
,
602 offset
, 4, ENC_BIG_ENDIAN
);
604 proto_tree_add_item(tree
, hf_gdsdb_receive_messages
, tvb
,
605 offset
, 4, ENC_BIG_ENDIAN
);
607 while(tvb_bytes_exist(tvb
, offset
, 12)) {
608 proto_tree_add_item(tree
, hf_gdsdb_receive_direction
,
609 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
611 proto_tree_add_item(tree
, hf_gdsdb_receive_offset
,
612 tvb
, offset
, 8, ENC_BIG_ENDIAN
);
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
,
631 offset
, 4, ENC_BIG_ENDIAN
);
633 proto_tree_add_item(tree
, hf_gdsdb_send_incarnation
, tvb
,
634 offset
, 4, ENC_BIG_ENDIAN
);
636 proto_tree_add_item(tree
, hf_gdsdb_send_transaction
, tvb
,
637 offset
, 4, ENC_BIG_ENDIAN
);
639 proto_tree_add_item(tree
, hf_gdsdb_send_msgnr
, tvb
,
640 offset
, 4, ENC_BIG_ENDIAN
);
642 proto_tree_add_item(tree
, hf_gdsdb_send_messages
, tvb
,
643 offset
, 4, ENC_BIG_ENDIAN
);
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
,
661 offset
, 4, ENC_BIG_ENDIAN
);
663 proto_tree_add_item(tree
, hf_gdsdb_response_blobid
, tvb
,
664 offset
, 8, ENC_BIG_ENDIAN
);
666 proto_tree_add_item(tree
, hf_gdsdb_response_data
, tvb
,
667 offset
, 4, ENC_ASCII
|ENC_NA
);
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
, ENC_NA
);
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
,
689 offset
, 4, ENC_BIG_ENDIAN
);
691 proto_tree_add_item(tree
, hf_gdsdb_transact_transaction
, tvb
,
692 offset
, 4, ENC_BIG_ENDIAN
);
695 return tvb_length(tvb
);
699 gdsdb_transact_response(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
703 if (tvb_length(tvb
) < 8) {
708 proto_tree_add_item(tree
, hf_gdsdb_transactresponse_messages
,
709 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
712 return tvb_length(tvb
);
716 gdsdb_open_blob2(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
721 if (!tvb_bytes_exist(tvb
, 0, 20)) {
726 proto_tree_add_item(tree
, hf_gdsdb_openblob2_bpb
, tvb
, offset
,
727 4, ENC_ASCII
|ENC_NA
);
728 length
= tvb_get_ntohl(tvb
, offset
);
729 offset
+= length
+ 6;
730 proto_tree_add_item(tree
, hf_gdsdb_openblob_transaction
, tvb
,
731 offset
, 4, ENC_BIG_ENDIAN
);
733 proto_tree_add_item(tree
, hf_gdsdb_openblob_id
, tvb
, offset
,
737 return tvb_length(tvb
);
741 gdsdb_open_blob(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
745 if (tvb_length(tvb
) < 16) {
750 proto_tree_add_item(tree
, hf_gdsdb_openblob_transaction
, tvb
,
751 offset
, 4, ENC_BIG_ENDIAN
);
753 proto_tree_add_item(tree
, hf_gdsdb_openblob_id
, tvb
, offset
,
757 return tvb_length(tvb
);
761 gdsdb_segment(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
765 if (tvb_length(tvb
) < 16) {
769 /* hf_gdsdb_segment_blob */
770 /* hf_gdsdb_segment_length */
771 /* hf_gdsdb_segment_segment */
774 return tvb_length(tvb
);
778 gdsdb_seek_blob(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
782 if (tvb_length(tvb
) < 16) {
786 /* hf_gdsdb_seekblob_blob */
787 /* hf_gdsdb_seekblob_mode */
790 return tvb_length(tvb
);
794 gdsdb_reconnect(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
798 if (tvb_length(tvb
) < 12) {
802 /* hf_gdsdb_reconnect_database */
805 return tvb_length(tvb
);
809 gdsdb_info(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
815 if (tvb_length(tvb
) < 20) {
819 opcode
= tvb_get_ntohl(tvb
, 0);
823 proto_tree_add_item(tree
, hf_gdsdb_info_object
, tvb
, offset
,
826 proto_tree_add_item(tree
, hf_gdsdb_info_incarnation
, tvb
,
827 offset
, 4, ENC_BIG_ENDIAN
);
829 if(opcode
== op_service_info
) {
830 proto_tree_add_item(tree
, hf_gdsdb_info_items
, tvb
,
831 offset
, 4, ENC_ASCII
|ENC_NA
);
832 length
= tvb_get_ntohl(tvb
, offset
);
833 offset
+= length
+ 6;
835 proto_tree_add_item(tree
, hf_gdsdb_info_buffer_length
, tvb
,
836 offset
, 4, ENC_BIG_ENDIAN
);
839 return tvb_length(tvb
);
843 gdsdb_service_start(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
847 if (tvb_length(tvb
) < 16) {
851 /* hf_gdsdb_info_object */
852 /* hf_gdsdb_info_incarnation */
853 /* hf_gdsdb_info_items */
854 /* hf_gdsdb_info_buffer_length */
857 return tvb_length(tvb
);
861 gdsdb_release(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
865 if (tvb_length(tvb
) < 8) {
869 /* hf_gdsdb_release_object */
872 return tvb_length(tvb
);
877 gdsdb_prepare2(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
881 if (tvb_length(tvb
) < 12) {
885 /* hf_gdsdb_prepare2_transaction */
888 return tvb_length(tvb
);
893 gdsdb_event(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
897 if (tvb_length(tvb
) < 24) {
901 /* hf_gdsdb_event_database */
902 /* hf_gdsdb_event_items */
903 /* hf_gdsdb_event_ast */
904 /* hf_gdsdb_event_arg */
905 /* hf_gdsdb_event_rid */
907 return tvb_length(tvb
);
911 gdsdb_cancel_events(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
915 if (tvb_length(tvb
) < 12) {
919 /* hf_gdsdb_event_database */
922 return tvb_length(tvb
);
926 gdsdb_ddl(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
930 if (tvb_length(tvb
) < 16) {
934 /* hf_gdsdb_ddl_database */
935 /* hf_gdsdb_ddl_transaction */
936 /* hf_gdsdb_ddl_blr */
939 return tvb_length(tvb
);
943 gdsdb_slice(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
947 if (tvb_length(tvb
) < 24) {
951 /* hf_gdsdb_slice_transaction */
952 /* hf_gdsdb_slice_id */
953 /* hf_gdsdb_slice_sdl */
954 /* hf_gdsdb_slice_parameters */
957 return tvb_length(tvb
);
961 gdsdb_slice_response(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
965 if (tvb_length(tvb
) < 8) {
969 /* hf_gdsdb_sliceresponse_length */
972 return tvb_length(tvb
);
976 gdsdb_execute(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
980 if (tvb_length(tvb
) < 12) {
984 /* hf_gdsdb_execute_statement */
985 /* hf_gdsdb_execute_transaction */
986 /* hf_gdsdb_execute_message_number */
987 /* hf_gdsdb_execute_messages */
990 return tvb_length(tvb
);
994 gdsdb_exec_immediate2(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
998 if (tvb_length(tvb
) < 44) {
1002 /* hf_gdsdb_prepare2_blr */
1003 /* hf_gdsdb_prepare2_number */
1004 /* hf_gdsdb_prepare2_messages */
1005 /* hf_gdsdb_prepare2_outblr */
1006 /* hf_gdsdb_prepare2_outmsgnr */
1009 return tvb_length(tvb
);
1013 gdsdb_prepare(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1018 if (tvb_length(tvb
) < 32) {
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_NA
);
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
, void *data _U_
)
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 col_add_str(pinfo
->cinfo
, COL_INFO
,
1262 val_to_str(opcode
, gdsdb_opcode
, "Unknown opcode %u"));
1265 ti
= proto_tree_add_item(tree
, proto_gdsdb
, tvb
, 0, -1,
1267 gdsdb_tree
= proto_item_add_subtree(ti
, ett_gdsdb
);
1268 proto_tree_add_item(gdsdb_tree
, hf_gdsdb_opcode
, tvb
,
1269 0, 4, ENC_BIG_ENDIAN
);
1272 /* opcode < op_max */
1273 return gdsdb_handle_opcode
[opcode
](tvb
, pinfo
, gdsdb_tree
);
1277 proto_register_gdsdb(void)
1279 static hf_register_info hf
[] = {
1281 { "Opcode", "gdsdb.opcode",
1282 FT_UINT32
, BASE_DEC
, VALS(gdsdb_opcode
), 0x0,
1287 { &hf_gdsdb_connect_operation
,
1288 { "Operation", "gdsdb.connect.operation",
1289 FT_UINT32
, BASE_DEC
, VALS(gdsdb_opcode
), 0x0,
1292 { &hf_gdsdb_connect_version
,
1293 { "Version", "gdsdb.connect.version",
1294 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1297 { &hf_gdsdb_connect_client
,
1298 { "Client Architecture", "gdsdb.connect.client",
1299 FT_UINT32
, BASE_DEC
, VALS(gdsdb_architectures
), 0x0,
1302 { &hf_gdsdb_connect_filename
,
1303 { "Filename", "gdsdb.connect.filename",
1304 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1307 { &hf_gdsdb_connect_count
,
1308 { "Version option count", "gdsdb.connect.count",
1309 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1312 { &hf_gdsdb_connect_userid
,
1313 { "User ID", "gdsdb.connect.userid",
1314 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1317 { &hf_gdsdb_connect_pref
,
1318 { "Preferred version", "gdsdb.connect.pref",
1319 FT_NONE
, BASE_NONE
, NULL
, 0x0,
1322 { &hf_gdsdb_connect_pref_version
,
1323 { "Version", "gdsdb.connect.pref.version",
1324 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1327 { &hf_gdsdb_connect_pref_architecture
,
1328 { "Architecture", "gdsdb.connect.pref.arch",
1329 FT_UINT32
, BASE_DEC
, VALS(gdsdb_architectures
), 0x0,
1332 { &hf_gdsdb_connect_pref_mintype
,
1333 { "Minimum type", "gdsdb.connect.pref.mintype",
1334 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1337 { &hf_gdsdb_connect_pref_maxtype
,
1338 { "Maximum type", "gdsdb.connect.pref.maxtype",
1339 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1342 { &hf_gdsdb_connect_pref_weight
,
1343 { "Preference weight", "gdsdb.connect.pref.weight",
1344 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1348 { &hf_gdsdb_accept_version
,
1349 { "Version", "gdsdb.accept.version",
1350 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1353 { &hf_gdsdb_accept_architecture
,
1354 { "Architecture", "gdsdb.accept.arch",
1355 FT_UINT32
, BASE_DEC
, VALS(gdsdb_architectures
), 0x0,
1359 { &hf_gdsdb_request_type
,
1360 { "Type", "gdsdb.connect.type",
1361 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1364 { &hf_gdsdb_request_object
,
1365 { "Object", "gdsdb.connect.object",
1366 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1369 { &hf_gdsdb_request_partner
,
1370 { "Partner", "gdsdb.connect.partner",
1371 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
1375 { &hf_gdsdb_attach_database
,
1376 { "Database", "gdsdb.attach.database",
1377 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1380 { &hf_gdsdb_attach_filename
,
1381 { "Filename", "gdsdb.attach.filename",
1382 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1385 { &hf_gdsdb_attach_dpb
,
1386 { "Database parameter block", "gdsdb.attach.dpblength",
1387 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1391 { &hf_gdsdb_compile_database
,
1392 { "Database", "gdsdb.compile.filename",
1393 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1396 { &hf_gdsdb_compile_blr
,
1397 { "BLR", "gdsdb.compile.blr",
1398 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1402 { &hf_gdsdb_receive_request
,
1403 { "Request", "gdsdb.receive.request",
1404 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1407 { &hf_gdsdb_receive_incarnation
,
1408 { "Incarnation", "gdsdb.receive.incarnation",
1409 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1412 { &hf_gdsdb_receive_transaction
,
1413 { "Transaction", "gdsdb.receive.transaction",
1414 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1417 { &hf_gdsdb_receive_msgnr
,
1418 { "Message number", "gdsdb.receive.msgnr",
1419 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1422 { &hf_gdsdb_receive_messages
,
1423 { "Message Count", "gdsdb.receive.msgcount",
1424 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1427 { &hf_gdsdb_receive_direction
,
1428 { "Scroll direction", "gdsdb.receive.direction",
1429 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1432 { &hf_gdsdb_receive_offset
,
1433 { "Scroll offset", "gdsdb.receive.offset",
1434 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1438 { &hf_gdsdb_send_request
,
1439 { "Send request", "gdsdb.send.request",
1440 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1443 { &hf_gdsdb_send_incarnation
,
1444 { "Send request", "gdsdb.send.incarnation",
1445 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1448 { &hf_gdsdb_send_transaction
,
1449 { "Send request", "gdsdb.send.transaction",
1450 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1453 { &hf_gdsdb_send_msgnr
,
1454 { "Send request", "gdsdb.send.msgnr",
1455 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1458 { &hf_gdsdb_send_messages
,
1459 { "Send request", "gdsdb.send.messages",
1460 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1463 /* gdsdb_response */
1464 { &hf_gdsdb_response_object
,
1465 { "Response object", "gdsdb.response.object",
1466 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1469 { &hf_gdsdb_response_blobid
,
1470 { "Blob ID", "gdsdb.response.blobid",
1471 FT_UINT64
, BASE_HEX
, NULL
, 0x0,
1474 { &hf_gdsdb_response_data
,
1475 { "Data", "gdsdb.response.data",
1476 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1479 { &hf_gdsdb_response_status
,
1480 { "Status vector", "gdsdb.response.status",
1481 FT_NONE
, BASE_NONE
, NULL
, 0x0,
1484 /* gdsdb_transact */
1485 { &hf_gdsdb_transact_database
,
1486 { "Database", "gdsdb.transact.database",
1487 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1490 { &hf_gdsdb_transact_transaction
,
1491 { "Database", "gdsdb.transact.transaction",
1492 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1496 { &hf_gdsdb_transact_messages
,
1497 { "Messages", "gdsdb.transact.messages",
1498 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1502 /* gdsdb_transact_response */
1503 { &hf_gdsdb_transactresponse_messages
,
1504 { "Messages", "gdsdb.transactresponse.messages",
1505 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1508 /* gdsdb_open_blob2 */
1509 { &hf_gdsdb_openblob2_bpb
,
1510 { "Blob parameter block", "gdsdb.openblob2.bpb",
1511 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1514 /* gdsdb_open_blob */
1515 { &hf_gdsdb_openblob_transaction
,
1516 { "Transaction", "gdsdb.openblob2.transaction",
1517 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1520 { &hf_gdsdb_openblob_id
,
1521 { "ID", "gdsdb.openblob.id",
1522 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,
1560 /* gdsdb_info & gdsdb_service_start */
1561 { &hf_gdsdb_info_object
,
1562 { "Object", "gdsdb.info.object",
1563 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1566 { &hf_gdsdb_info_incarnation
,
1567 { "Incarnation", "gdsdb.info.incarnation",
1568 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1571 { &hf_gdsdb_info_items
,
1572 { "Items", "gdsdb.info.items",
1573 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1576 { &hf_gdsdb_info_buffer_length
,
1577 { "Buffer length", "gdsdb.info.bufferlength",
1578 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1583 { &hf_gdsdb_release_object
,
1584 { "Object", "gdsdb.release.object",
1585 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1588 /* gdsdb_prepare2 */
1589 { &hf_gdsdb_prepare2_transaction
,
1590 { "Transaction", "gdsdb.prepare2.transaction",
1591 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1594 /* gdsdb_event & gdsdb_cancel_events */
1595 { &hf_gdsdb_event_database
,
1596 { "Database", "gdsdb.event.database",
1597 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1600 { &hf_gdsdb_event_items
,
1601 { "Event description block", "gdsdb.event.items",
1602 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1605 { &hf_gdsdb_event_ast
,
1606 { "ast routine", "gdsdb.event.ast",
1607 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1610 { &hf_gdsdb_event_arg
,
1611 { "Argument to ast routine", "gdsdb.event.arg",
1612 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1615 { &hf_gdsdb_event_rid
,
1616 { "ID", "gdsdb.event.id",
1617 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1621 { &hf_gdsdb_ddl_database
,
1622 { "Database", "gdsdb.ddl.database",
1623 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1626 { &hf_gdsdb_ddl_transaction
,
1627 { "Transaction", "gdsdb.ddl.transaction",
1628 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1631 { &hf_gdsdb_ddl_blr
,
1632 { "BLR", "gdsdb.ddl.blr",
1633 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1637 { &hf_gdsdb_slice_transaction
,
1638 { "Transaction", "gdsdb.slice.transaction",
1639 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1642 { &hf_gdsdb_slice_id
,
1643 { "ID", "gdsdb.slice.id",
1644 FT_UINT64
, BASE_HEX
, NULL
, 0x0,
1647 { &hf_gdsdb_slice_sdl
,
1648 { "Slice description language", "gdsdb.slice.sdl",
1649 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1652 { &hf_gdsdb_slice_parameters
,
1653 { "Parameters", "gdsdb.slice.parameters",
1654 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1657 /* gdsdb_slice_response */
1658 { &hf_gdsdb_sliceresponse_length
,
1659 { "Length", "gdsdb.sliceresponse.length",
1660 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1664 { &hf_gdsdb_execute_statement
,
1665 { "Statement", "gdsdb.execute.statement",
1666 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1669 { &hf_gdsdb_execute_transaction
,
1670 { "Transaction", "gdsdb.execute.transaction",
1671 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1674 { &hf_gdsdb_execute_message_number
,
1675 { "Message number", "gdsdb.execute.messagenumber",
1676 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1679 { &hf_gdsdb_execute_messages
,
1680 { "Number of messages", "gdsdb.execute.messages",
1681 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1684 /* gdsdb_execute2 */
1685 { &hf_gdsdb_execute_outblr
,
1686 { "Output BLR", "gdsdb.execute.outblr",
1687 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1690 { &hf_gdsdb_execute_outmsgnr
,
1691 { "Output Message number", "gdsdb.execute.outmsgnr",
1692 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1695 /* gdsdb_exec_immediate2 */
1696 { &hf_gdsdb_prepare2_blr
,
1697 { "BLR", "gdsdb.prepare.blr",
1698 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1701 { &hf_gdsdb_prepare2_number
,
1702 { "Message number", "gdsdb.prepare2.messagenumber",
1703 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1706 { &hf_gdsdb_prepare2_messages
,
1707 { "Number of messages", "gdsdb.prepare2.messages",
1708 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1711 { &hf_gdsdb_prepare2_outblr
,
1712 { "Output BLR", "gdsdb.prepare2.outblr",
1713 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1716 { &hf_gdsdb_prepare2_outmsgnr
,
1717 { "Output Message number", "gdsdb.prepare2.outmsgnr",
1718 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1723 { &hf_gdsdb_prepare_transaction
,
1724 { "Prepare, Transaction", "gdsdb.prepare.transaction",
1725 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1728 { &hf_gdsdb_prepare_statement
,
1729 { "Prepare, Statement", "gdsdb.prepare.statement",
1730 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1733 { &hf_gdsdb_prepare_dialect
,
1734 { "Prepare, Dialect", "gdsdb.prepare.dialect",
1735 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1738 { &hf_gdsdb_prepare_querystr
,
1739 { "Prepare, Query", "gdsdb.prepare.querystr",
1740 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
1743 { &hf_gdsdb_prepare_items
,
1744 { "Prepare, Information items", "gdsdb.prepare.items",
1745 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1748 { &hf_gdsdb_prepare_bufferlength
,
1749 { "Prepare, Bufferlength", "gdsdb.prepare.bufferlen",
1750 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1755 { &hf_gdsdb_fetch_statement
,
1756 { "Statement", "gdsdb.fetch.statement",
1757 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1760 { &hf_gdsdb_fetch_message_number
,
1761 { "Message number", "gdsdb.fetch.messagenr",
1762 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1765 { &hf_gdsdb_fetch_messages
,
1766 { "Number of messages", "gdsdb.fetch.messages",
1767 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1770 /* gdsdb_fetch_response */
1771 { &hf_gdsdb_fetchresponse_status
,
1772 { "Status", "gdsdb.fetchresponse.status",
1773 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1776 { &hf_gdsdb_fetchresponse_messages
,
1777 { "Number of messages", "gdsdb.fetchresponse.messages",
1778 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1781 /* gdsdb_free_statement */
1782 { &hf_gdsdb_free_statement
,
1783 { "Statement", "gdsdb.fetchresponse.statement",
1784 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1787 { &hf_gdsdb_free_option
,
1788 { "Option", "gdsdb.fetchresponse.option",
1789 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1793 { &hf_gdsdb_insert_statement
,
1794 { "Statement", "gdsdb.insert.statement",
1795 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1798 { &hf_gdsdb_insert_message_number
,
1799 { "Message number", "gdsdb.insert.messagenr",
1800 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1803 { &hf_gdsdb_insert_messages
,
1804 { "Number of messages", "gdsdb.insert.messages",
1805 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1809 { &hf_gdsdb_cursor_statement
,
1810 { "Statement", "gdsdb.cursor.statement",
1811 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1814 { &hf_gdsdb_cursor_type
,
1815 { "Type", "gdsdb.cursor.type",
1816 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1819 /* gdsdb_sql_response */
1820 { &hf_gdsdb_sqlresponse_messages
,
1821 { "SQL Response, Message Count", "gdsdb.sqlresponse.msgcount",
1822 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1828 static gint
*ett
[] = {
1830 /* &ett_gdsdb_opcode, */
1831 &ett_gdsdb_connect_pref
1834 proto_gdsdb
= proto_register_protocol(
1835 "Firebird SQL Database Remote Protocol",
1836 "FB/IB GDS DB", "gdsdb");
1838 proto_register_field_array(proto_gdsdb
, hf
, array_length(hf
));
1839 proto_register_subtree_array(ett
, array_length(ett
));
1843 proto_reg_handoff_gdsdb(void)
1845 /* Main dissector */
1847 dissector_handle_t gdsdb_handle
;
1849 gdsdb_handle
= new_create_dissector_handle(dissect_gdsdb
,
1851 dissector_add_uint("tcp.port", TCP_PORT
, gdsdb_handle
);