Bug Summary

File:builds/wireshark/wireshark/epan/dissectors/packet-tns.c
Warning:line 727, column 3
Value stored to 'len' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name packet-tns.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -fno-delete-null-pointer-checks -mframe-pointer=all -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -ffloat16-excess-precision=fast -fbfloat16-excess-precision=fast -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/builds/wireshark/wireshark/build -fcoverage-compilation-dir=/builds/wireshark/wireshark/build -resource-dir /usr/lib/llvm-22/lib/clang/22 -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /builds/wireshark/wireshark/epan/dissectors -isystem /builds/wireshark/wireshark/build/epan/dissectors -isystem /usr/include/mit-krb5 -isystem /usr/include/libxml2 -isystem /builds/wireshark/wireshark/epan -D CARES_NO_DEPRECATED -D G_DISABLE_DEPRECATED -D G_DISABLE_SINGLE_INCLUDES -D WS_BUILD_DLL -D WS_DEBUG -D WS_DEBUG_UTF_8 -I /builds/wireshark/wireshark/build -I /builds/wireshark/wireshark -I /builds/wireshark/wireshark/include -D _GLIBCXX_ASSERTIONS -internal-isystem /usr/lib/llvm-22/lib/clang/22/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/16/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -Wno-format-nonliteral -std=gnu17 -ferror-limit 19 -fvisibility=hidden -fwrapv -fwrapv-pointer -fstrict-flex-arrays=3 -stack-protector 2 -fstack-clash-protection -fcf-protection=full -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fexceptions -fcolor-diagnostics -analyzer-output=html -faddrsig -fdwarf2-cfi-asm -o /builds/wireshark/wireshark/sbout/2026-09-12-100348-3660-1 -x c /builds/wireshark/wireshark/epan/dissectors/packet-tns.c
1/* packet-tns.c
2 * Routines for Oracle TNS packet dissection
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * Copied from packet-tftp.c
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
13#include "config.h"
14
15#include <epan/packet.h>
16#include "packet-tcp.h"
17
18#include <epan/prefs.h>
19#include <epan/expert.h>
20#include <epan/conversation.h>
21#include <epan/proto_data.h>
22#include <epan/unit_strings.h>
23
24#include <wsutil/array.h>
25
26void proto_register_tns(void);
27
28#define TNS_HDR_LEN8 8
29
30/* Packet Types */
31#define TNS_TYPE_CONNECT1 1
32#define TNS_TYPE_ACCEPT2 2
33#define TNS_TYPE_ACK3 3
34#define TNS_TYPE_REFUSE4 4
35#define TNS_TYPE_REDIRECT5 5
36#define TNS_TYPE_DATA6 6
37#define TNS_TYPE_NULL7 7
38#define TNS_TYPE_ABORT9 9
39#define TNS_TYPE_RESEND11 11
40#define TNS_TYPE_MARKER12 12
41#define TNS_TYPE_ATTENTION13 13
42#define TNS_TYPE_CONTROL14 14
43#define TNS_TYPE_DD15 15
44#define TNS_TYPE_MAX19 19
45
46/* Data Packet Functions */
47#define SQLNET_SET_PROTOCOL1 1
48#define SQLNET_SET_DATATYPES2 2
49#define SQLNET_USER_OCI_FUNC3 3
50#define SQLNET_RETURN_STATUS4 4
51#define SQLNET_ACCESS_USR_ADDR5 5
52#define SQLNET_ROW_TRANSF_HDR6 6
53#define SQLNET_ROW_TRANSF_DATA7 7
54#define SQLNET_RETURN_OPI_PARAM8 8
55#define SQLNET_FUNCCOMPLETE9 9
56#define SQLNET_NERROR_RET_DEF10 10
57#define SQLNET_IOVEC_4FAST_UPI11 11
58#define SQLNET_LONG_4FAST_UPI12 12
59#define SQLNET_INVOKE_USER_CB13 13
60#define SQLNET_LOB_FILE_DF14 14
61#define SQLNET_WARNING15 15
62#define SQLNET_DESCRIBE_INFO16 16
63#define SQLNET_PIGGYBACK_FUNC17 17
64#define SQLNET_SIG_4UCS18 18
65#define SQLNET_FLUSH_BIND_DATA19 19
66#define SQLNET_SNS0xdeadbeef 0xdeadbeef
67#define SQLNET_XTRN_PROCSERV_R132 32
68#define SQLNET_XTRN_PROCSERV_R268 68
69
70/* Return OPI Parameter's Type */
71#define OPI_VERSION21 1
72#define OPI_OSESSKEY2 2
73#define OPI_OAUTH3 3
74
75/* OCI function ids (TTI_FUN sub-functions). */
76#define TTI_FETCH5 5
77#define TTI_ALL894 94
78#define TTI_LOBOPS96 96
79
80/* desegmentation of TNS over TCP */
81static bool_Bool tns_desegment = true1;
82
83static dissector_handle_t tns_handle;
84
85static int proto_tns;
86static int hf_tns_request;
87static int hf_tns_response;
88static int hf_tns_length;
89static int hf_tns_packet_checksum;
90static int hf_tns_header_checksum;
91static int hf_tns_packet_type;
92static int hf_tns_reserved_byte;
93static int hf_tns_version;
94static int hf_tns_compat_version;
95
96static int hf_tns_service_options;
97static int hf_tns_sopt_flag_bconn;
98static int hf_tns_sopt_flag_pc;
99static int hf_tns_sopt_flag_hc;
100static int hf_tns_sopt_flag_fd;
101static int hf_tns_sopt_flag_hd;
102static int hf_tns_sopt_flag_dc1;
103static int hf_tns_sopt_flag_dc2;
104static int hf_tns_sopt_flag_dio;
105static int hf_tns_sopt_flag_ap;
106static int hf_tns_sopt_flag_ra;
107static int hf_tns_sopt_flag_sa;
108
109static int hf_tns_sdu_size;
110static int hf_tns_max_tdu_size;
111
112static int hf_tns_nt_proto_characteristics;
113static int hf_tns_ntp_flag_hangon;
114static int hf_tns_ntp_flag_crel;
115static int hf_tns_ntp_flag_tduio;
116static int hf_tns_ntp_flag_srun;
117static int hf_tns_ntp_flag_dtest;
118static int hf_tns_ntp_flag_cbio;
119static int hf_tns_ntp_flag_asio;
120static int hf_tns_ntp_flag_pio;
121static int hf_tns_ntp_flag_grant;
122static int hf_tns_ntp_flag_handoff;
123static int hf_tns_ntp_flag_sigio;
124static int hf_tns_ntp_flag_sigpipe;
125static int hf_tns_ntp_flag_sigurg;
126static int hf_tns_ntp_flag_urgentio;
127static int hf_tns_ntp_flag_fdio;
128static int hf_tns_ntp_flag_testop;
129
130static int hf_tns_line_turnaround;
131static int hf_tns_value_of_one;
132static int hf_tns_connect_data_length;
133static int hf_tns_connect_data_offset;
134static int hf_tns_connect_data_max;
135
136static int hf_tns_connect_flags0;
137static int hf_tns_connect_flags1;
138static int hf_tns_conn_flag_nareq;
139static int hf_tns_conn_flag_nalink;
140static int hf_tns_conn_flag_enablena;
141static int hf_tns_conn_flag_ichg;
142static int hf_tns_conn_flag_wantna;
143
144static int hf_tns_connect_data;
145static int hf_tns_trace_cf1;
146static int hf_tns_trace_cf2;
147static int hf_tns_trace_cid;
148
149static int hf_tns_accept_data_length;
150static int hf_tns_accept_data_offset;
151static int hf_tns_accept_data;
152
153static int hf_tns_refuse_reason_user;
154static int hf_tns_refuse_reason_system;
155static int hf_tns_refuse_data_length;
156static int hf_tns_refuse_data;
157
158static int hf_tns_abort_reason_user;
159static int hf_tns_abort_reason_system;
160static int hf_tns_abort_data;
161
162static int hf_tns_marker_type;
163static int hf_tns_marker_data_byte;
164static int hf_tns_marker_function;
165/* static int hf_tns_marker_data; */
166
167static int hf_tns_redirect_data_length;
168static int hf_tns_redirect_data;
169
170static int hf_tns_control_cmd;
171static int hf_tns_control_data;
172
173static int hf_tns_data_flag;
174static int hf_tns_data_flag_send;
175static int hf_tns_data_flag_rc;
176static int hf_tns_data_flag_c;
177static int hf_tns_data_flag_reserved;
178static int hf_tns_data_flag_more;
179static int hf_tns_data_flag_eof;
180static int hf_tns_data_flag_dic;
181static int hf_tns_data_flag_rts;
182static int hf_tns_data_flag_sntt;
183
184static int hf_tns_data_id;
185static int hf_tns_data_length;
186static int hf_tns_data_oci_id;
187static int hf_tns_data_tseq;
188static int hf_tns_data_piggyback_id;
189static int hf_tns_data_unused;
190
191static int hf_tns_cursor;
192
193static int hf_tns_data_opi_version2_banner_len;
194static int hf_tns_data_opi_version2_banner;
195static int hf_tns_data_opi_version2_vsnum;
196
197static int hf_tns_data_opi_num_of_params;
198static int hf_tns_data_opi_param_length;
199static int hf_tns_data_opi_param_name;
200static int hf_tns_data_opi_param_value;
201
202static int hf_tns_data_setp_acc_version;
203static int hf_tns_data_setp_cli_plat;
204static int hf_tns_data_setp_version;
205static int hf_tns_data_setp_banner;
206
207static int hf_tns_data_sns_cli_vers;
208static int hf_tns_data_sns_srv_vers;
209static int hf_tns_data_sns_srvcnt;
210
211static int hf_tns_data_setdt_charset_in;
212static int hf_tns_data_setdt_charset_out;
213static int hf_tns_data_setdt_flag;
214static int hf_tns_data_setdt_caphdr;
215static int hf_tns_data_setdt_caphdr_version;
216static int hf_tns_data_setdt_caphdr_flags;
217static int hf_tns_data_setdt_tblhdr;
218static int hf_tns_data_setdt_idmap;
219static int hf_tns_data_setdt_overrides;
220static int hf_tns_data_setdt_override_client;
221static int hf_tns_data_setdt_override_repr;
222static int hf_tns_data_setdt_override_format;
223
224static int hf_tns_data_oer_call_status;
225static int hf_tns_data_oer_rowcount;
226static int hf_tns_data_oer_err_code;
227static int hf_tns_data_oer_cursor_id;
228static int hf_tns_data_oer_n_batch_errcodes;
229static int hf_tns_data_oer_n_batch_offsets;
230static int hf_tns_data_oer_n_batch_messages;
231static int hf_tns_data_oer_message;
232
233static int hf_tns_data_iov_num_binds;
234static int hf_tns_data_iov_bind_dir;
235
236static int hf_tns_data_dcb_num_columns;
237static int hf_tns_data_col_type;
238static int hf_tns_data_col_precision;
239static int hf_tns_data_col_scale;
240static int hf_tns_data_col_max_length;
241static int hf_tns_data_col_charset;
242static int hf_tns_data_col_csform;
243static int hf_tns_data_col_max_size;
244static int hf_tns_data_col_nulls_ok;
245static int hf_tns_data_col_name;
246
247static int hf_tns_data_rxh_num_requests;
248static int hf_tns_data_rxh_iter_num;
249static int hf_tns_data_rxh_num_iters;
250
251static int hf_tns_data_all8_options;
252static int hf_tns_data_all8_opt_parse;
253static int hf_tns_data_all8_opt_bind;
254static int hf_tns_data_all8_opt_define;
255static int hf_tns_data_all8_opt_execute;
256static int hf_tns_data_all8_opt_commit;
257static int hf_tns_data_all8_opt_plsql;
258static int hf_tns_data_all8_opt_fetch;
259static int hf_tns_data_all8_fetch_rows;
260static int hf_tns_data_all8_bind_count;
261static int hf_tns_data_all8_sql;
262static int hf_tns_data_bind_value;
263static int hf_tns_data_fetch_rows;
264static int hf_tns_data_lob_op;
265static int hf_tns_data_lob_offset;
266static int hf_tns_data_col_value;
267
268static int hf_tns_data_descriptor_row_count;
269static int hf_tns_data_descriptor_row_size;
270
271static int ett_tns;
272static int ett_tns_connect;
273static int ett_tns_accept;
274static int ett_tns_refuse;
275static int ett_tns_abort;
276static int ett_tns_redirect;
277static int ett_tns_marker;
278static int ett_tns_attention;
279static int ett_tns_control;
280static int ett_tns_data;
281static int ett_tns_data_flag;
282static int ett_tns_acc_versions;
283static int ett_tns_opi_params;
284static int ett_tns_opi_par;
285static int ett_tns_sopt_flag;
286static int ett_tns_ntp_flag;
287static int ett_tns_conn_flag;
288static int ett_tns_rows;
289static int ett_tns_setdt_caphdr;
290static int ett_tns_setdt_overrides;
291static int ett_tns_setdt_override;
292static int ett_tns_oer;
293static int ett_tns_iov;
294static int ett_tns_dcb_col;
295static int ett_tns_all8_options;
296static int ett_tns_binds;
297static int ett_tns_bind;
298static int ett_tns_bind_row;
299static int ett_tns_rxd_row;
300static int ett_sql;
301
302static expert_field ei_tns_connect_data_next_packet;
303static expert_field ei_tns_data_descriptor_size_mismatch;
304static expert_field ei_tns_data_piggyback_cursors;
305static expert_field ei_tns_data_count_too_large;
306
307#define TCP_PORT_TNS1521 1521 /* Not IANA registered */
308
309static int * const tns_connect_flags[] = {
310 &hf_tns_conn_flag_nareq,
311 &hf_tns_conn_flag_nalink,
312 &hf_tns_conn_flag_enablena,
313 &hf_tns_conn_flag_ichg,
314 &hf_tns_conn_flag_wantna,
315 NULL((void*)0)
316};
317
318static int * const tns_service_options[] = {
319 &hf_tns_sopt_flag_bconn,
320 &hf_tns_sopt_flag_pc,
321 &hf_tns_sopt_flag_hc,
322 &hf_tns_sopt_flag_fd,
323 &hf_tns_sopt_flag_hd,
324 &hf_tns_sopt_flag_dc1,
325 &hf_tns_sopt_flag_dc2,
326 &hf_tns_sopt_flag_dio,
327 &hf_tns_sopt_flag_ap,
328 &hf_tns_sopt_flag_ra,
329 &hf_tns_sopt_flag_sa,
330 NULL((void*)0)
331};
332
333/* TTI_ALL8 (SQL execute) options bitmask. */
334static int * const tns_all8_options[] = {
335 &hf_tns_data_all8_opt_parse,
336 &hf_tns_data_all8_opt_bind,
337 &hf_tns_data_all8_opt_define,
338 &hf_tns_data_all8_opt_execute,
339 &hf_tns_data_all8_opt_commit,
340 &hf_tns_data_all8_opt_plsql,
341 &hf_tns_data_all8_opt_fetch,
342 NULL((void*)0)
343};
344
345static const value_string tns_type_vals[] = {
346 {TNS_TYPE_CONNECT1, "Connect" },
347 {TNS_TYPE_ACCEPT2, "Accept" },
348 {TNS_TYPE_ACK3, "Acknowledge" },
349 {TNS_TYPE_REFUSE4, "Refuse" },
350 {TNS_TYPE_REDIRECT5, "Redirect" },
351 {TNS_TYPE_DATA6, "Data" },
352 {TNS_TYPE_NULL7, "Null" },
353 {TNS_TYPE_ABORT9, "Abort" },
354 {TNS_TYPE_RESEND11, "Resend"},
355 {TNS_TYPE_MARKER12, "Marker"},
356 {TNS_TYPE_ATTENTION13, "Attention"},
357 {TNS_TYPE_CONTROL14, "Control"},
358 {TNS_TYPE_DD15, "Data Descriptor"},
359 {0, NULL((void*)0)}
360};
361
362static const value_string tns_data_funcs[] = {
363 {SQLNET_SET_PROTOCOL1, "Set Protocol"},
364 {SQLNET_SET_DATATYPES2, "Set Datatypes"},
365 {SQLNET_USER_OCI_FUNC3, "User OCI Functions"},
366 {SQLNET_RETURN_STATUS4, "Return Status"},
367 {SQLNET_ACCESS_USR_ADDR5, "Access User Address Space"},
368 {SQLNET_ROW_TRANSF_HDR6, "Row Transfer Header"},
369 {SQLNET_ROW_TRANSF_DATA7, "Row Transfer Data"},
370 {SQLNET_RETURN_OPI_PARAM8, "Return OPI Parameter"},
371 {SQLNET_FUNCCOMPLETE9, "Function Complete"},
372 {SQLNET_NERROR_RET_DEF10, "N Error return definitions follow"},
373 {SQLNET_IOVEC_4FAST_UPI11, "Sending I/O Vec only for fast UPI"},
374 {SQLNET_LONG_4FAST_UPI12, "Sending long for fast UPI"},
375 {SQLNET_INVOKE_USER_CB13, "Invoke user callback"},
376 {SQLNET_LOB_FILE_DF14, "LOB/FILE data follows"},
377 {SQLNET_WARNING15, "Warning messages - may be a set of them"},
378 {SQLNET_DESCRIBE_INFO16, "Describe Information"},
379 {SQLNET_PIGGYBACK_FUNC17, "Piggy back function follow"},
380 {SQLNET_SIG_4UCS18, "Signals special action for untrusted callout support"},
381 {SQLNET_FLUSH_BIND_DATA19, "Flush Out Bind data in DML/w RETURN when error"},
382 {SQLNET_XTRN_PROCSERV_R132, "External Procedures and Services Registrations"},
383 {SQLNET_XTRN_PROCSERV_R268, "External Procedures and Services Registrations"},
384 {SQLNET_SNS0xdeadbeef, "Secure Network Services"},
385 {0, NULL((void*)0)}
386};
387
388/* Oracle TNS native data-type ids. Used by the Set Datatypes
389 * negotiation to label override entries with human names. */
390static const value_string tns_data_types[] = {
391 {1, "VARCHAR"},
392 {2, "NUMBER"},
393 {3, "INTEGER"},
394 {4, "FLOAT"},
395 {5, "STRING"},
396 {6, "VARNUM"},
397 {7, "DECIMAL"},
398 {8, "LONG"},
399 {9, "VCS"},
400 {11, "RID"},
401 {12, "DATE"},
402 {15, "VBI"},
403 {23, "RAW"},
404 {24, "LONG RAW"},
405 {96, "CHAR"},
406 {100, "BINARY_FLOAT"},
407 {101, "BINARY_DOUBLE"},
408 {102, "REFCURSOR"},
409 {104, "ROWID"},
410 {109, "ADT"},
411 {111, "REF"},
412 {112, "CLOB"},
413 {113, "BLOB"},
414 {114, "BFILE"},
415 {116, "RSET"},
416 {180, "TIMESTAMP"},
417 {181, "TIMESTAMP WITH TIME ZONE"},
418 {182, "INTERVAL YEAR TO MONTH"},
419 {183, "INTERVAL DAY TO SECOND"},
420 {208, "UROWID"},
421 {231, "TIMESTAMP WITH LOCAL TIME ZONE"},
422 {0, NULL((void*)0)}
423};
424
425/* Oracle NLS character-set ids - the well-known subset, enough to name
426 * the charsets seen in a Set Datatypes negotiation. */
427static const value_string tns_charsets[] = {
428 {31, "WE8ISO8859P1"},
429 {32, "EE8ISO8859P2"},
430 {35, "CL8ISO8859P5"},
431 {170, "EE8MSWIN1250"},
432 {171, "CL8MSWIN1251"},
433 {178, "WE8MSWIN1252"},
434 {830, "JA16EUC"},
435 {852, "ZHS16GBK"},
436 {865, "ZHT16BIG5"},
437 {867, "ZHT16MSWIN950"},
438 {871, "US7ASCII"},
439 {873, "AL32UTF8"},
440 {2000, "AL16UTF16"},
441 {0, NULL((void*)0)}
442};
443
444/* TTI_LOBOPS operation opcodes. */
445static const value_string tns_lob_ops[] = {
446 {0x00001, "GET_LENGTH"},
447 {0x00002, "READ"},
448 {0x00020, "TRIM"},
449 {0x00040, "WRITE"},
450 {0x00100, "FILE_OPEN"},
451 {0x00110, "CREATE_TEMP"},
452 {0x00111, "FREE_TEMP"},
453 {0x00200, "FILE_CLOSE"},
454 {0x00400, "FILE_ISOPEN"},
455 {0x00800, "FILE_EXISTS"},
456 {0x04000, "GET_CHUNK_SIZE"},
457 {0x08000, "OPEN"},
458 {0x10000, "CLOSE"},
459 {0x11000, "IS_OPEN"},
460 {0x80000, "ARRAY"},
461 {0, NULL((void*)0)}
462};
463
464/* Column character-set form (csfrm) in an OAC descriptor: whether char data
465 * is in the database charset or the national (AL16UTF16) charset. */
466static const value_string tns_csform_vals[] = {
467 {1, "Database charset"},
468 {2, "National (AL16UTF16)"},
469 {0, NULL((void*)0)}
470};
471
472/* Bind directions reported per bind in a TTI_IOV vector (TNS_BIND_DIR_*),
473 * cross-referenced with python-oracledb's constants. */
474static const value_string tns_iov_bind_dirs[] = {
475 {16, "OUT"},
476 {32, "IN"},
477 {48, "IN OUT"},
478 {0, NULL((void*)0)}
479};
480
481static const value_string tns_data_oci_subfuncs[] = {
482 {1, "Logon to Oracle"},
483 {2, "Open Cursor"},
484 {3, "Parse a Row"},
485 {4, "Execute a Row"},
486 {5, "Fetch a Row"},
487 {8, "Close Cursor"},
488 {9, "Logoff of Oracle"},
489 {10, "Describe a select list column"},
490 {11, "Define where the column goes"},
491 {12, "Auto commit on"},
492 {13, "Auto commit off"},
493 {14, "Commit"},
494 {15, "Rollback"},
495 {16, "Set fatal error options"},
496 {17, "Resume current operation"},
497 {18, "Get Oracle version-date string"},
498 {19, "Until we get rid of OASQL"},
499 {20, "Cancel the current operation"},
500 {21, "Get error message"},
501 {22, "Exit Oracle command"},
502 {23, "Special function"},
503 {24, "Abort"},
504 {25, "Dequeue by RowID"},
505 {26, "Fetch a long column value"},
506 {27, "Create Access Module"},
507 {28, "Save Access Module Statement"},
508 {29, "Save Access Module"},
509 {30, "Parse Access Module Statement"},
510 {31, "How many items?"},
511 {32, "Initialize Oracle"},
512 {33, "Change User ID"},
513 {34, "Bind by reference positional"},
514 {35, "Get n'th Bind Variable"},
515 {36, "Get n'th Into Variable"},
516 {37, "Bind by reference"},
517 {38, "Bind by reference numeric"},
518 {39, "Parse and Execute"},
519 {40, "Parse for syntax (only)"},
520 {41, "Parse for syntax and SQL Dictionary lookup"},
521 {42, "Continue serving after EOF"},
522 {43, "Array describe"},
523 {44, "Init sys pars command table"},
524 {45, "Finalize sys pars command table"},
525 {46, "Put sys par in command table"},
526 {47, "Get sys pars from command table"},
527 {48, "Start Oracle (V6)"},
528 {49, "Shutdown Oracle (V6)"},
529 {50, "Run Independent Process (V6)"},
530 {51, "Test RAM (V6)"},
531 {52, "Archive operation (V6)"},
532 {53, "Media Recovery - start (V6)"},
533 {54, "Media Recovery - record tablespace to recover (V6)"},
534 {55, "Media Recovery - get starting log seq # (V6)"},
535 {56, "Media Recovery - recover using offline log (V6)"},
536 {57, "Media Recovery - cancel media recovery (V6)"},
537 {58, "Logon to Oracle (V6)"},
538 {59, "Get Oracle version-date string in new format"},
539 {60, "Initialize Oracle"},
540 {61, "Reserved for MAC; close all cursors"},
541 {62, "Bundled execution call"},
542 {65, "For direct loader: functions"},
543 {66, "For direct loader: buffer transfer"},
544 {67, "Distrib. trans. mgr. RPC"},
545 {68, "Describe indexes for distributed query"},
546 {69, "Session operations"},
547 {70, "Execute using synchronized system commit numbers"},
548 {71, "Fast UPI calls to OPIAL7"},
549 {72, "Long Fetch (V7)"},
550 {73, "Call OPIEXE from OPIALL: no two-task access"},
551 {74, "Parse Call (V7) to deal with various flavours"},
552 {76, "RPC call from PL/SQL"},
553 {77, "Do a KGL operation"},
554 {78, "Execute and Fetch"},
555 {79, "X/Open XA operation"},
556 {80, "New KGL operation call"},
557 {81, "2nd Half of Logon"},
558 {82, "1st Half of Logon"},
559 {83, "Do Streaming Operation"},
560 {84, "Open Session (71 interface)"},
561 {85, "X/Open XA operations (71 interface)"},
562 {86, "Debugging operations"},
563 {87, "Special debugging operations"},
564 {88, "XA Start"},
565 {89, "XA Switch and Commit"},
566 {90, "Direct copy from db buffers to client address"},
567 {91, "OKOD Call (In Oracle <= 7 this used to be Connect"},
568 {93, "RPI Callback with ctxdef"},
569 {94, "Bundled execution call (V7)"},
570 {95, "Do Streaming Operation without begintxn"},
571 {96, "LOB and FILE related calls"},
572 {97, "File Create call"},
573 {98, "Describe query (V8) call"},
574 {99, "Connect (non-blocking attach host)"},
575 {100, "Open a recursive cursor"},
576 {101, "Bundled KPR Execution"},
577 {102, "Bundled PL/SQL execution"},
578 {103, "Transaction start, attach, detach"},
579 {104, "Transaction commit, rollback, recover"},
580 {105, "Cursor close all"},
581 {106, "Failover into piggyback"},
582 {107, "Session switching piggyback (V8)"},
583 {108, "Do Dummy Defines"},
584 {109, "Init sys pars (V8)"},
585 {110, "Finalize sys pars (V8)"},
586 {111, "Put sys par in par space (V8)"},
587 {112, "Terminate sys pars (V8)"},
588 {114, "Init Untrusted Callbacks"},
589 {115, "Generic authentication call"},
590 {116, "FailOver Get Instance call"},
591 {117, "Oracle Transaction service Commit remote sites"},
592 {118, "Get the session key"},
593 {119, "Describe any (V8)"},
594 {120, "Cancel All"},
595 {121, "AQ Enqueue"},
596 {122, "AQ Dequeue"},
597 {123, "Object transfer"},
598 {124, "RFS Call"},
599 {125, "Kernel programmatic notification"},
600 {126, "Listen"},
601 {127, "Oracle Transaction service Commit remote sites (V >= 8.1.3)"},
602 {128, "Dir Path Prepare"},
603 {129, "Dir Path Load Stream"},
604 {130, "Dir Path Misc. Ops"},
605 {131, "Memory Stats"},
606 {132, "AQ Properties Status"},
607 {134, "Remote Fetch Archive Log FAL"},
608 {135, "Client ID propagation"},
609 {136, "DR Server CNX Process"},
610 {138, "SPFILE parameter put"},
611 {139, "KPFC exchange"},
612 {140, "Object Transfer (V8.2)"},
613 {141, "Push Transaction"},
614 {142, "Pop Transaction"},
615 {143, "KFN Operation"},
616 {144, "Dir Path Unload Stream"},
617 {145, "AQ batch enqueue dequeue"},
618 {146, "File Transfer"},
619 {147, "Ping"},
620 {148, "TSM"},
621 {150, "Begin TSM"},
622 {151, "End TSM"},
623 {152, "Set schema"},
624 {153, "Fetch from suspended result set"},
625 {154, "Key/Value pair"},
626 {155, "XS Create session Operation"},
627 {156, "XS Session Roundtrip Operation"},
628 {157, "XS Piggyback Operation"},
629 {158, "KSRPC Execution"},
630 {159, "Streams combined capture apply"},
631 {160, "AQ replay information"},
632 {161, "SSCR"},
633 {162, "Session Get"},
634 {163, "Session RLS"},
635 {165, "Workload replay data"},
636 {166, "Replay statistic data"},
637 {167, "Query Cache Stats"},
638 {168, "Query Cache IDs"},
639 {169, "RPC Test Stream"},
640 {170, "Replay PL/SQL RPC"},
641 {171, "XStream Out"},
642 {172, "Golden Gate RPC"},
643 {0, NULL((void*)0)}
644};
645static value_string_ext tns_data_oci_subfuncs_ext = VALUE_STRING_EXT_INIT(tns_data_oci_subfuncs){ _try_val_to_str_ext_init, 0, (sizeof (tns_data_oci_subfuncs
) / sizeof ((tns_data_oci_subfuncs)[0]))-1, tns_data_oci_subfuncs
, "tns_data_oci_subfuncs", ((void*)0) }
;
646
647/* The final byte of a TNS_MARKER body selects break vs reset:
648 * 01 00 01 = break, 01 00 02 = reset. */
649static const value_string tns_marker_functions[] = {
650 {1, "Break (interrupt call)"},
651 {2, "Reset (clear line)"},
652 {0, NULL((void*)0)}
653};
654
655static const value_string tns_marker_types[] = {
656 {0, "Data Marker - 0 Data Bytes"},
657 {1, "Data Marker - 1 Data Bytes"},
658 {2, "Attention Marker"},
659 {0, NULL((void*)0)}
660};
661
662static const value_string tns_control_cmds[] = {
663 {1, "Oracle Trace Command"},
664 {0, NULL((void*)0)}
665};
666
667/* Column types from the most recent describe (TTI_DCB), threaded to a later
668 * TTI_RXD response so its row values can be split per column. */
669typedef struct _tns_describe_t {
670 uint32_t num_cols;
671 uint8_t *types;
672} tns_describe_t;
673
674typedef struct _tns_conv_info_t {
675 uint32_t pending_connect_data;
676 tns_describe_t *last_describe;
677} tns_conv_info_t;
678
679/* p_add_proto_data key for the describe a TTI_RXD response packet uses. */
680#define TNS_PROTO_DATA_DESCRIBE1 1
681
682void proto_reg_handoff_tns(void);
683static int dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U___attribute__((unused)));
684
685static tns_conv_info_t*
686tns_get_conv_info(packet_info *pinfo)
687{
688 conversation_t *conversation = find_or_create_conversation(pinfo);
689
690 tns_conv_info_t *tns_info = (tns_conv_info_t *)conversation_get_proto_data(conversation, proto_tns);
691 if (!tns_info) {
692 tns_info = wmem_new0(wmem_file_scope(), tns_conv_info_t)((tns_conv_info_t*)wmem_alloc0((wmem_file_scope()), sizeof(tns_conv_info_t
)))
;
693 conversation_add_proto_data(conversation, proto_tns, tns_info);
694 }
695 return tns_info;
696}
697
698static unsigned get_data_func_id(tvbuff_t *tvb, int offset)
699{
700 /* Determine Data Function id */
701 uint8_t first_byte;
702
703 first_byte =
704 tvb_reported_length_remaining(tvb, offset) > 0 ? tvb_get_uint8(tvb, offset) : 0;
705
706 if ( tvb_bytes_exist(tvb, offset, 4) && first_byte == 0xDE &&
707 tvb_get_uint24(tvb, offset+1, ENC_BIG_ENDIAN0x00000000) == 0xADBEEF )
708 {
709 return SQLNET_SNS0xdeadbeef;
710 }
711 else
712 {
713 return (unsigned)first_byte;
714 }
715}
716
717static int get_strtype_custom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
718{
719 int ret = 1; // 1st byte contains 254 or length if smaller than 64
720 int len = 0;
721
722 wmem_strbuf_t *strbuf = wmem_strbuf_new(pinfo->pool, "");
723
724 len = tvb_get_uint8(tvb, offset);
725 if (len == 254) {
726 int actual_len = 0;
727 len = 0;
Value stored to 'len' is never read
728 do { // walk over the chunks
729 len = tvb_get_uint8(tvb, offset + ret);
730 ret++; // 1st byte with the chunk size
731 wmem_strbuf_append(strbuf, (const char *)tvb_get_string_enc(pinfo->pool, tvb, offset + ret, len, ENC_ASCII0x00000000|ENC_NA0x00000000));
732 ret += len; // length of the string's chunk
733 actual_len += len;
734 } while (len == 64);
735 ret++; // has to be null-terminated
736 len = actual_len;
737 }
738 else {
739 ret += len;
740 wmem_strbuf_append(strbuf, (const char *)tvb_get_string_enc(pinfo->pool, tvb, offset + 1, len, ENC_ASCII0x00000000|ENC_NA0x00000000));
741 }
742
743 proto_tree_add_uint(tree, hf_tns_data_opi_param_length, tvb, offset, 1, len);
744 proto_tree_add_string(tree, hf_tns_data_opi_param_value, tvb, offset+1, ret-1, wmem_strbuf_get_str(strbuf));
745
746 return ret;
747}
748
749/* Decode an Oracle variable-length integer (ub4 / sb4):
750 * a length byte, then that many big-endian magnitude bytes. The low 7 bits
751 * of the length byte are the magnitude width (0..4); the high bit flags a
752 * negative value in sign-magnitude form (not two's complement) — so -1 is
753 * 0x81 0x01 and NUMBER scale -127 is 0x81 0x7f.
754 * Returns the number of bytes consumed. */
755static int get_sb4_custom(tvbuff_t *tvb, int offset, int *result)
756{
757 uint8_t first_byte = tvb_get_uint8(tvb, offset); // Contains length of a value
758 bool_Bool negative = (first_byte & 0x80) != 0;
759 uint8_t width = first_byte & 0x7f;
760 int magnitude = 0;
761
762 switch(width)
763 {
764 case 0:
765 magnitude = 0;
766 break;
767 case 1:
768 magnitude = tvb_get_uint8(tvb, offset+1);
769 break;
770 case 2:
771 magnitude = tvb_get_ntohs(tvb, offset+1);
772 break;
773 case 3:
774 magnitude = tvb_get_ntoh24(tvb, offset+1);
775 break;
776 case 4:
777 magnitude = tvb_get_ntohl(tvb, offset+1);
778 break;
779 default:
780 /* Width 5..0x7f is not a valid 1..4-byte integer. In practice
781 * only a raw ub2 counter read through this helper reaches here;
782 * the historic client behaviour is to consume two bytes and
783 * return the negated second byte, which keeps the stream
784 * aligned. The value is discarded by such callers. */
785 if ( tvb_reported_length_remaining(tvb, offset) < 2 )
786 {
787 /* Not even that second byte is present. The width came
788 * off the wire, so this is malformed input rather than
789 * a bug in the dissector - step over the width alone. */
790 *result = 0;
791 return 1;
792 }
793 *result = -(int)tvb_get_uint8(tvb, offset+1);
794 return 2;
795 }
796 *result = negative ? -magnitude : magnitude;
797 return width + 1;
798}
799
800/* Decode a DALC (Data-Length-And-Content) blob. The leading byte is a
801 * length only in the middle of its range:
802 *
803 * 0x00 empty
804 * 0x01..0xFD that many data bytes follow
805 * 0xFE chunked: (len, bytes) pairs until a 0-length chunk
806 * 0xFF null - a marker only, no data follows
807 *
808 * The null marker consumes just itself. Reading it as a length would
809 * claim 255 bytes that are not there and misalign every field after
810 * it, so it has to be spelled out rather than left to the default.
811 *
812 * The chunk lengths in the 0xFE form are single bytes here, which is
813 * the 11g shape this dissector decodes throughout; 12.2 and later
814 * prefix each chunk with a variable-length ub4 instead. Telling the
815 * two apart needs the field version negotiated during the handshake,
816 * which is not threaded through yet.
817 *
818 * Returns the number of bytes consumed from the tvb and, when content
819 * is non-empty, a UTF-8 string allocated from pinfo->pool. */
820static int get_dalc_custom(tvbuff_t *tvb, packet_info *pinfo, int offset, const char **out_str)
821{
822 uint8_t first = tvb_get_uint8(tvb, offset);
823 if ( first == 0 || first == 255 )
824 {
825 if ( out_str )
826 *out_str = NULL((void*)0);
827 return 1;
828 }
829 if ( first != 254 )
830 {
831 if ( out_str )
832 *out_str = (const char *)tvb_get_string_enc(pinfo->pool, tvb, offset + 1, first, ENC_UTF_80x00000002|ENC_NA0x00000000);
833 return 1 + first;
834 }
835
836 /* Chunked form: walk (len, bytes)+ until a zero-length chunk. */
837 wmem_strbuf_t *strbuf = wmem_strbuf_new(pinfo->pool, "");
838 int o = offset + 1;
839 while ( tvb_reported_length_remaining(tvb, o) > 0 )
840 {
841 uint8_t chunk_len = tvb_get_uint8(tvb, o);
842 o += 1;
843 if ( chunk_len == 0 )
844 break;
845 wmem_strbuf_append(strbuf, (const char *)tvb_get_string_enc(pinfo->pool, tvb, o, chunk_len, ENC_UTF_80x00000002|ENC_NA0x00000000));
846 o += chunk_len;
847 }
848 if ( out_str )
849 *out_str = wmem_strbuf_get_str(strbuf);
850 return o - offset;
851}
852
853/* Decode a bytes_with_length / str_with_length field: a ub4 count, and
854 * a DALC carrying the value only when that count is non-zero. The count
855 * is not simply a byte to step over - an empty field is the count
856 * alone, so reading a DALC anyway consumes whatever follows it.
857 * Returns bytes consumed; *out_str (when non-NULL) gets the string, or
858 * NULL when the field is empty. */
859static int get_field_with_length(tvbuff_t *tvb, packet_info *pinfo, int offset, const char **out_str)
860{
861 int count = 0;
862 int used = get_sb4_custom(tvb, offset, &count);
863 if ( out_str )
864 *out_str = NULL((void*)0);
865 if ( count > 0 )
866 used += get_dalc_custom(tvb, pinfo, offset + used, out_str);
867 return used;
868}
869
870static void vsnum_to_vstext_basecustom(char *result, uint32_t vsnum)
871{
872 /*
873 * Translate hex value to human readable version value, described at
874 * http://docs.oracle.com/cd/B28359_01/server.111/b28310/dba004.htm
875 */
876 snprintf(result, ITEM_LABEL_LENGTH240, "%d.%d.%d.%d.%d",
877 vsnum >> 24,
878 (vsnum >> 20) & 0xf,
879 (vsnum >> 12) & 0xf,
880 (vsnum >> 8) & 0xf,
881 vsnum & 0xff);
882}
883
884/* Decode an OAC (Oracle Access Column) descriptor — the type/format core
885 * shared by describe columns and bind descriptors. Fields
886 * use the Oracle variable-length form (get_sb4_custom).
887 * Returns the new offset. */
888static int dissect_tns_oac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
889{
890 int v = 0, start;
891
892 /* type (ub1) */
893 proto_tree_add_item(tree, hf_tns_data_col_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
894 offset += 1;
895 /* flag (ub1, skip) */
896 offset += 1;
897 /* precision (sb1) */
898 proto_tree_add_item(tree, hf_tns_data_col_precision, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
899 offset += 1;
900 /* scale (ub4, may be negative — NUMBER default is -127) */
901 start = offset;
902 offset += get_sb4_custom(tvb, offset, &v);
903 proto_tree_add_int(tree, hf_tns_data_col_scale, tvb, start, offset - start, v);
904 /* max data length / buffer size (ub4) */
905 start = offset;
906 offset += get_sb4_custom(tvb, offset, &v);
907 proto_tree_add_uint(tree, hf_tns_data_col_max_length, tvb, start, offset - start, v);
908 /* max array elements (ub4, skip) */
909 offset += get_sb4_custom(tvb, offset, &v);
910 /* cont flags (ub4, skip) */
911 offset += get_sb4_custom(tvb, offset, &v);
912 /* type OID (bytes_with_length, skip) */
913 offset += get_field_with_length(tvb, pinfo, offset, NULL((void*)0));
914 /* version (ub4, skip) */
915 offset += get_sb4_custom(tvb, offset, &v);
916 /* charset id (ub4) */
917 start = offset;
918 offset += get_sb4_custom(tvb, offset, &v);
919 proto_tree_add_uint(tree, hf_tns_data_col_charset, tvb, start, offset - start, v);
920 /* charset form (ub1) */
921 proto_tree_add_item(tree, hf_tns_data_col_csform, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
922 offset += 1;
923 /* max size (ub4) */
924 start = offset;
925 offset += get_sb4_custom(tvb, offset, &v);
926 proto_tree_add_uint(tree, hf_tns_data_col_max_size, tvb, start, offset - start, v);
927
928 return offset;
929}
930
931/* Decode one per-column metadata block of a TTI_DCB describe (11g
932 * shape): an OAC descriptor plus the nullability and naming fields.
933 * Returns the new offset. */
934static int dissect_tns_dcb_column(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int idx)
935{
936 proto_tree *col_tree;
937 proto_item *col_item;
938 int col_start = offset, v = 0;
939 uint8_t col_type = tvb_get_uint8(tvb, offset);
940 const char *name = NULL((void*)0);
941
942 col_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
943 ett_tns_dcb_col, &col_item, "Column %d", idx);
944
945 offset = dissect_tns_oac(tvb, pinfo, col_tree, offset);
946
947 /* nulls allowed (ub1) */
948 proto_tree_add_item(col_tree, hf_tns_data_col_nulls_ok, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
949 offset += 1;
950 /* v7 name length (ub1, skip) */
951 offset += 1;
952 /* column name (str_with_length) */
953 int name_start = offset;
954 offset += get_field_with_length(tvb, pinfo, offset, &name);
955 if ( name )
956 proto_tree_add_string(col_tree, hf_tns_data_col_name, tvb, name_start, offset - name_start, name);
957 /* schema name, type name (str_with_length, skip) */
958 offset += get_field_with_length(tvb, pinfo, offset, NULL((void*)0));
959 offset += get_field_with_length(tvb, pinfo, offset, NULL((void*)0));
960 /* column position (ub4, skip) */
961 offset += get_sb4_custom(tvb, offset, &v);
962 /* uds flags (ub4, skip) — 11g addition */
963 offset += get_sb4_custom(tvb, offset, &v);
964
965 if ( name )
966 proto_item_append_text(col_item, ": %s (%s)", name,
967 val_to_str_const(col_type, tns_data_types, "unknown"));
968 proto_item_set_len(col_item, offset - col_start);
969 return offset;
970}
971
972/* Decode one TTI_RXD column value by its describe data type, and add it as a
973 * "Column N (TYPE)" item showing the raw value bytes. Ordinary values are a
974 * DALC blob; ROWID / UROWID / LONG / LOB carry their own framings.
975 * Object / JSON / VECTOR values have richer image
976 * framings not handled here, so on those the caller stops (sets *bail) and
977 * leaves the remainder to the data dissector. Returns the new offset. */
978static int dissect_tns_rxd_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, uint8_t dtype, int idx, int *bail)
979{
980 int v_start = offset, disp_start = offset, v = 0;
981 int is_null = 0;
982 uint8_t first;
983
984 switch ( dtype )
985 {
986 case 109: /* ADT / object */
987 case 119: /* JSON (OSON) */
988 case 127: /* VECTOR */
989 *bail = 1;
990 return offset;
991
992 case 11: /* ROWID: indicator, then obj/file/unused/block/slot (ub4) */
993 first = tvb_get_uint8(tvb, offset);
994 offset += 1;
995 if ( first == 0 || first == 0xff )
996 is_null = 1;
997 else
998 for ( int k = 0; k < 5; k++ )
999 offset += get_sb4_custom(tvb, offset, &v);
1000 break;
1001
1002 case 208: /* UROWID: ub4 num_bytes, a length echo byte, then the bytes */
1003 offset += get_sb4_custom(tvb, offset, &v);
1004 if ( v > 0 )
1005 offset += 1 + v;
1006 else
1007 is_null = 1;
1008 break;
1009
1010 case 8: /* LONG */
1011 case 24: /* LONG RAW: value then two trailing ub4 length indicators */
1012 first = tvb_get_uint8(tvb, offset);
1013 if ( first == 0 )
1014 {
1015 offset += 1;
1016 is_null = 1;
1017 }
1018 else if ( first == 0xfe ) /* chunked: ub1 len chunks until 0 (11g) */
1019 {
1020 offset += 1;
1021 while ( tvb_reported_length_remaining(tvb, offset) > 0 )
1022 {
1023 uint8_t chunk_len = tvb_get_uint8(tvb, offset);
1024 offset += 1;
1025 if ( chunk_len == 0 )
1026 break;
1027 offset += chunk_len;
1028 }
1029 }
1030 else
1031 offset += 1 + first;
1032 offset += get_sb4_custom(tvb, offset, &v);
1033 offset += get_sb4_custom(tvb, offset, &v);
1034 break;
1035
1036 case 112: /* CLOB */
1037 case 113: /* BLOB */
1038 case 114: /* BFILE: 0x00 NULL, else ub4 num_bytes + DALC locator block */
1039 first = tvb_get_uint8(tvb, offset);
1040 if ( first == 0 )
1041 {
1042 offset += 1;
1043 is_null = 1;
1044 }
1045 else
1046 {
1047 offset += get_sb4_custom(tvb, offset, &v);
1048 offset += get_dalc_custom(tvb, pinfo, offset, NULL((void*)0));
1049 }
1050 break;
1051
1052 default: /* ordinary: a single DALC value */
1053 first = tvb_get_uint8(tvb, offset);
1054 offset += get_dalc_custom(tvb, pinfo, offset, NULL((void*)0));
1055 if ( first == 0 )
1056 is_null = 1;
1057 else
1058 disp_start = v_start + 1; /* show the value bytes, not the length */
1059 break;
1060 }
1061
1062 if ( is_null )
1063 proto_tree_add_bytes_format(tree, hf_tns_data_col_value, tvb,
1064 v_start, offset - v_start, NULL((void*)0), "Column %d (%s): NULL", idx,
1065 val_to_str_const(dtype, tns_data_types, "unknown"));
1066 else
1067 proto_tree_add_bytes_format(tree, hf_tns_data_col_value, tvb,
1068 disp_start, offset - disp_start, NULL((void*)0), "Column %d (%s)", idx,
1069 val_to_str_const(dtype, tns_data_types, "unknown"));
1070 return offset;
1071}
1072
1073static void dissect_tns_data_descriptor(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tns_tree, uint32_t length)
1074{
1075 /* This is used by Oracle 12c for at least sending LOB/FILE data. */
1076 proto_tree *dd_tree, *row_tree;
1077 proto_item *ti;
1078 uint32_t data_len, row_count, row_size, total_row_size = 0;
1079 int orig_offset = offset;
1080
1081 /* We only get here after tcp_dissect_pdus(), length is guaranteed. */
1082 DISSECTOR_ASSERT_CMPINT(length, >=, TNS_HDR_LEN)((void) ((length >= 8) ? (void)0 : (proto_report_dissector_bug
("%s:%u: failed assertion " "length" " " ">=" " " "8" " ("
"%" "l" "d" " " ">=" " " "%" "l" "d" ")", "epan/dissectors/packet-tns.c"
, 1082, (int64_t)length, (int64_t)8))))
;
1083
1084 dd_tree = proto_tree_add_subtree(tns_tree, tvb, offset, -1, ett_tns_data, NULL((void*)0), "Data Descriptor");
1085
1086 /* No idea what this is. Usually 0x0003. */
1087 offset += 4;
1088 proto_tree_add_item_ret_uint(dd_tree, hf_tns_data_length, tvb,
1089 offset, 4, ENC_BIG_ENDIAN0x00000000, &data_len);
1090 offset += 4;
1091
1092 /* This next parameter looks like: number of big endian shorts that follow,
1093 * the sum of the shorts equals the file length above - each short maxes
1094 * out at 0x1f7c = 8060, presumably related to the page size / max table
1095 * row size in Microsoft SQL Server? Something about how many rows it
1096 * would take to store this in-table?
1097 */
1098 proto_tree_add_item_ret_uint(dd_tree, hf_tns_data_descriptor_row_count, tvb,
1099 offset, 4, ENC_BIG_ENDIAN0x00000000, &row_count);
1100 offset += 4;
1101 row_tree = proto_tree_add_subtree(dd_tree, tvb, offset, row_count * 2,
1102 ett_tns_rows, &ti, "Rows");
1103 for (uint32_t i = 0; i < row_count; i++) {
1104 proto_tree_add_item_ret_uint(row_tree, hf_tns_data_descriptor_row_size, tvb,
1105 offset, 2, ENC_BIG_ENDIAN0x00000000, &row_size);
1106 total_row_size += row_size;
1107 offset += 2;
1108 }
1109 proto_item_append_text(ti, " (%u bytes)", total_row_size);
1110 if (total_row_size != data_len) {
1111 expert_add_info(pinfo, ti, &ei_tns_data_descriptor_size_mismatch);
1112 }
1113
1114 offset = orig_offset + (length - TNS_HDR_LEN8);
1115
1116 call_data_dissector(tvb_new_subset_length(tvb, offset, data_len), pinfo,
1117 dd_tree);
1118}
1119
1120static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tns_tree)
1121{
1122 proto_tree *data_tree;
1123 unsigned data_func_id;
1124 bool_Bool is_request;
1125 static int * const flags[] = {
1126 &hf_tns_data_flag_send,
1127 &hf_tns_data_flag_rc,
1128 &hf_tns_data_flag_c,
1129 &hf_tns_data_flag_reserved,
1130 &hf_tns_data_flag_more,
1131 &hf_tns_data_flag_eof,
1132 &hf_tns_data_flag_dic,
1133 &hf_tns_data_flag_rts,
1134 &hf_tns_data_flag_sntt,
1135 NULL((void*)0)
1136 };
1137
1138 is_request = pinfo->match_uint == pinfo->destport;
1139 data_tree = proto_tree_add_subtree(tns_tree, tvb, offset, -1, ett_tns_data, NULL((void*)0), "Data");
1140
1141 proto_tree_add_bitmask(data_tree, tvb, offset, hf_tns_data_flag, ett_tns_data_flag, flags, ENC_BIG_ENDIAN0x00000000);
1142 offset += 2;
1143 data_func_id = get_data_func_id(tvb, offset);
1144
1145 /* Do this only if the Data message have a body. Otherwise, there are only Data flags. */
1146 int remaining = tvb_reported_length_remaining(tvb, offset);
1147 if ( remaining > 0 )
1148 {
1149 if (is_request) {
1150 if (!PINFO_FD_VISITED(pinfo)((pinfo)->fd->visited)) {
1151 tns_conv_info_t *tns_info = tns_get_conv_info(pinfo);
1152 if ((uint32_t)remaining == tns_info->pending_connect_data) {
1153 col_append_str(pinfo->cinfo, COL_INFO, ", Connect Data");
1154 proto_tree_add_item(data_tree, hf_tns_connect_data, tvb,
1155 offset, -1, ENC_ASCII0x00000000);
1156 p_add_proto_data(wmem_file_scope(), pinfo, proto_tns, 0,
1157 GUINT_TO_POINTER(tns_info->pending_connect_data)((gpointer) (gulong) (tns_info->pending_connect_data)));
1158 tns_info->pending_connect_data = 0;
1159 return;
1160 }
1161 } else {
1162 if (p_get_proto_data(wmem_file_scope(), pinfo, proto_tns, 0) != NULL((void*)0)) {
1163 col_append_str(pinfo->cinfo, COL_INFO, ", Connect Data");
1164 proto_tree_add_item(data_tree, hf_tns_connect_data, tvb,
1165 offset, -1, ENC_ASCII0x00000000);
1166 return;
1167 }
1168 }
1169 }
1170 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(data_func_id, tns_data_funcs, "unknown"));
1171
1172 if ( (data_func_id != SQLNET_SNS0xdeadbeef) && (try_val_to_str(data_func_id, tns_data_funcs) != NULL((void*)0)) )
1173 {
1174 proto_tree_add_item(data_tree, hf_tns_data_id, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1175 offset += 1;
1176 }
1177 }
1178
1179 /* Handle data functions that have more than just ID */
1180 switch (data_func_id)
1181 {
1182 case SQLNET_SET_PROTOCOL1:
1183 {
1184 proto_tree *versions_tree;
1185 proto_item *ti;
1186 char sep;
1187 if ( is_request )
1188 {
1189 versions_tree = proto_tree_add_subtree(data_tree, tvb, offset, -1, ett_tns_acc_versions, &ti, "Accepted Versions");
1190 sep = ':';
1191 for (;;) {
1192 /*
1193 * Add each accepted version as a
1194 * separate item.
1195 */
1196 uint8_t vers;
1197
1198 vers = tvb_get_uint8(tvb, offset);
1199 if (vers == 0) {
1200 /*
1201 * A version of 0 terminates
1202 * the list.
1203 */
1204 break;
1205 }
1206 proto_item_append_text(ti, "%c %u", sep, vers);
1207 sep = ',';
1208 proto_tree_add_uint(versions_tree, hf_tns_data_setp_acc_version, tvb, offset, 1, vers);
1209 offset += 1;
1210 }
1211 offset += 1; /* skip the 0 terminator */
1212 proto_item_set_end(ti, tvb, offset);
1213 proto_tree_add_item(data_tree, hf_tns_data_setp_cli_plat, tvb, offset, -1, ENC_ASCII0x00000000);
1214
1215 return; /* skip call_data_dissector */
1216 }
1217 else
1218 {
1219 unsigned len;
1220 versions_tree = proto_tree_add_subtree(data_tree, tvb, offset, -1, ett_tns_acc_versions, &ti, "Versions");
1221 sep = ':';
1222 for (;;) {
1223 /*
1224 * Add each version as a separate item.
1225 */
1226 uint8_t vers;
1227
1228 vers = tvb_get_uint8(tvb, offset);
1229 if (vers == 0) {
1230 /*
1231 * A version of 0 terminates
1232 * the list.
1233 */
1234 break;
1235 }
1236 proto_item_append_text(ti, "%c %u", sep, vers);
1237 sep = ',';
1238 proto_tree_add_uint(versions_tree, hf_tns_data_setp_version, tvb, offset, 1, vers);
1239 offset += 1;
1240 }
1241 offset += 1; /* skip the 0 terminator */
1242 proto_item_set_end(ti, tvb, offset);
1243 proto_tree_add_item_ret_length(data_tree, hf_tns_data_setp_banner, tvb, offset, -1, ENC_ASCII0x00000000|ENC_NA0x00000000, &len);
1244 offset += len;
1245 }
1246 break;
1247 }
1248
1249 case SQLNET_SET_DATATYPES2:
1250 {
1251 /* TTI_DTY: Data Type Negotiation, sent right after TTI_PRO
1252 * during the TTC handshake. The body is a fixed-shape blob
1253 * the client uses to tell the server which native Oracle
1254 * data types it understands and what wire representation it
1255 * wants for each. Layout cross-referenced with
1256 * python-oracledb.
1257 *
1258 * charset_in 2 bytes LE NLS_LANGUAGE charset id
1259 * charset_out 2 bytes LE NLS_NCHAR charset id
1260 * flag 1 byte capability flag (1 = std)
1261 * capability header 39 bytes version triple + flag bytes
1262 * table header 8 bytes group/sub counts
1263 * identity map 980 bytes 245 x (type, type, 1, 0)
1264 * type overrides var entries, terminated by 0
1265 */
1266 proto_tree *caphdr_tree, *ov_tree;
1267 proto_item *caphdr_item, *ov_item;
1268
1269 if ( !is_request )
1270 break;
1271
1272 proto_tree_add_item(data_tree, hf_tns_data_setdt_charset_in, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1273 offset += 2;
1274 proto_tree_add_item(data_tree, hf_tns_data_setdt_charset_out, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1275 offset += 2;
1276 proto_tree_add_item(data_tree, hf_tns_data_setdt_flag, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1277 offset += 1;
1278
1279 caphdr_item = proto_tree_add_item(data_tree, hf_tns_data_setdt_caphdr, tvb, offset, 39, ENC_NA0x00000000);
1280 caphdr_tree = proto_item_add_subtree(caphdr_item, ett_tns_setdt_caphdr);
1281 proto_tree_add_item(caphdr_tree, hf_tns_data_setdt_caphdr_version, tvb, offset, 3, ENC_BIG_ENDIAN0x00000000);
1282 proto_tree_add_item(caphdr_tree, hf_tns_data_setdt_caphdr_flags, tvb, offset + 3, 36, ENC_NA0x00000000);
1283 offset += 39;
1284
1285 proto_tree_add_item(data_tree, hf_tns_data_setdt_tblhdr, tvb, offset, 8, ENC_NA0x00000000);
1286 offset += 8;
1287 proto_tree_add_item(data_tree, hf_tns_data_setdt_idmap, tvb, offset, 980, ENC_NA0x00000000);
1288 offset += 980;
1289
1290 /* Walk type-override entries until the 0 terminator. Each
1291 * entry is (client_type, server_repr[, format]); a 0 in the
1292 * server_repr slot marks a short "client knows the id but
1293 * has no override" entry. */
1294 ov_item = proto_tree_add_item(data_tree, hf_tns_data_setdt_overrides, tvb, offset, -1, ENC_NA0x00000000);
1295 ov_tree = proto_item_add_subtree(ov_item, ett_tns_setdt_overrides);
1296 int ov_start = offset;
1297 while ( tvb_reported_length_remaining(tvb, offset) > 0 )
1298 {
1299 uint8_t client_type = tvb_get_uint8(tvb, offset);
1300 if ( client_type == 0 )
1301 {
1302 proto_tree_add_item(ov_tree, hf_tns_data_setdt_override_client, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1303 offset += 1;
1304 break;
1305 }
1306 uint8_t repr = tvb_get_uint8(tvb, offset + 1);
1307 int entry_len = (repr == 0) ? 2 : 4;
1308 proto_tree *e_tree = proto_tree_add_subtree_format(ov_tree, tvb, offset, entry_len,
1309 ett_tns_setdt_override, NULL((void*)0), "Type %u (%s)",
1310 client_type, val_to_str_const(client_type, tns_data_types, "unknown"));
1311 proto_tree_add_item(e_tree, hf_tns_data_setdt_override_client, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1312 if ( entry_len == 4 )
1313 {
1314 proto_tree_add_item(e_tree, hf_tns_data_setdt_override_repr, tvb, offset + 1, 1, ENC_BIG_ENDIAN0x00000000);
1315 proto_tree_add_item(e_tree, hf_tns_data_setdt_override_format, tvb, offset + 2, 1, ENC_BIG_ENDIAN0x00000000);
1316 }
1317 offset += entry_len;
1318 }
1319 proto_item_set_len(ov_item, offset - ov_start);
1320 break;
1321 }
1322
1323 case SQLNET_RETURN_STATUS4:
1324 {
1325 /* TTI_OER: server-side end-of-call status block. Emitted at
1326 * the end of every response — success or failure. Layout
1327 * cross-referenced with python-oracledb's
1328 * _process_error_info, in the Oracle 11g shape (no extended
1329 * ub4 error number / ub8 rowcount that 12c+ adds).
1330 *
1331 * All multi-byte integers are stored in the ub4 variable-
1332 * length form (see get_sb4_custom): first byte holds the
1333 * value's width (0..4), followed by that many big-endian
1334 * data bytes. */
1335 proto_tree *oer_tree;
1336 proto_item *oer_item;
1337 int oer_start = offset;
1338 int v;
1339
1340 oer_tree = proto_tree_add_subtree(data_tree, tvb, offset, -1, ett_tns_oer, &oer_item, "Oracle Error Return");
1341
1342 /* call_status */
1343 offset += get_sb4_custom(tvb, offset, &v);
1344 proto_tree_add_int(oer_tree, hf_tns_data_oer_call_status, tvb, oer_start, offset - oer_start, v);
1345 /* end-to-end seq# (skipped) */
1346 offset += get_sb4_custom(tvb, offset, &v);
1347 /* rowcount (DML affected rows on 11g) */
1348 int rc_start = offset;
1349 offset += get_sb4_custom(tvb, offset, &v);
1350 proto_tree_add_int(oer_tree, hf_tns_data_oer_rowcount, tvb, rc_start, offset - rc_start, v);
1351 /* err_code (ORA-NNNNN, 0 on success) */
1352 int ec_start = offset;
1353 int err_code = 0;
1354 offset += get_sb4_custom(tvb, offset, &err_code);
1355 proto_tree_add_int(oer_tree, hf_tns_data_oer_err_code, tvb, ec_start, offset - ec_start, err_code);
1356 /* array elem error #1, #2 (skipped) */
1357 offset += get_sb4_custom(tvb, offset, &v);
1358 offset += get_sb4_custom(tvb, offset, &v);
1359 /* cursor_id */
1360 int ci_start = offset;
1361 offset += get_sb4_custom(tvb, offset, &v);
1362 proto_tree_add_int(oer_tree, hf_tns_data_oer_cursor_id, tvb, ci_start, offset - ci_start, v);
1363 /* error position (skipped) */
1364 offset += get_sb4_custom(tvb, offset, &v);
1365 /* 6 single-byte fields: sql_type, fatal, flags, user_cursor_opts, upi_param, warn_flags */
1366 offset += 6;
1367 /* rowid: ub4 rba, ub2 part_id, 1 byte reserved, ub4 block, ub2 slot */
1368 offset += get_sb4_custom(tvb, offset, &v);
1369 offset += get_sb4_custom(tvb, offset, &v);
1370 offset += 1;
1371 offset += get_sb4_custom(tvb, offset, &v);
1372 offset += get_sb4_custom(tvb, offset, &v);
1373 /* os error (skipped) */
1374 offset += get_sb4_custom(tvb, offset, &v);
1375 /* statement #, call # (1 byte each) */
1376 offset += 2;
1377 /* padding ub2 + successful iterations ub4 */
1378 offset += get_sb4_custom(tvb, offset, &v);
1379 offset += get_sb4_custom(tvb, offset, &v);
1380 /* oerrdd (logical rowid), a bytes_with_length — skipped */
1381 offset += get_field_with_length(tvb, pinfo, offset, NULL((void*)0));
1382
1383 /* Batch error arrays (array DML). The code and offset arrays
1384 * are each a ub4 count followed by one DALC packing that many
1385 * ub4 values back to back; the message array is a ub4 count,
1386 * an indicator byte, and then that many str_with_length
1387 * entries each with a 2-byte trailer. All three counts are
1388 * zero for an ordinary statement. */
1389 int n_codes = 0, n_offs = 0, n_msgs = 0;
1390 int nb_start = offset;
1391 offset += get_sb4_custom(tvb, offset, &n_codes);
1392 proto_tree_add_int(oer_tree, hf_tns_data_oer_n_batch_errcodes, tvb, nb_start, offset - nb_start, n_codes);
1393 if ( n_codes > 0 )
1394 offset += get_dalc_custom(tvb, pinfo, offset, NULL((void*)0));
1395 nb_start = offset;
1396 offset += get_sb4_custom(tvb, offset, &n_offs);
1397 proto_tree_add_int(oer_tree, hf_tns_data_oer_n_batch_offsets, tvb, nb_start, offset - nb_start, n_offs);
1398 if ( n_offs > 0 )
1399 offset += get_dalc_custom(tvb, pinfo, offset, NULL((void*)0));
1400 nb_start = offset;
1401 offset += get_sb4_custom(tvb, offset, &n_msgs);
1402 proto_tree_add_int(oer_tree, hf_tns_data_oer_n_batch_messages, tvb, nb_start, offset - nb_start, n_msgs);
1403 if ( n_msgs > 0 )
1404 {
1405 offset += 1;
1406 for ( int i = 0; i < n_msgs; i++ )
1407 {
1408 offset += get_field_with_length(tvb, pinfo, offset, NULL((void*)0));
1409 offset += 2;
1410 }
1411 }
1412
1413 /* Trailing message DALC — present (and meaningful) only when
1414 * err_code is non-zero. */
1415 if ( err_code != 0 && tvb_reported_length_remaining(tvb, offset) > 0 )
1416 {
1417 const char *msg = NULL((void*)0);
1418 int msg_start = offset;
1419 offset += get_dalc_custom(tvb, pinfo, offset, &msg);
1420 if ( msg )
1421 {
1422 proto_tree_add_string(oer_tree, hf_tns_data_oer_message, tvb, msg_start, offset - msg_start, msg);
1423 col_append_fstr(pinfo->cinfo, COL_INFO, " [%s]", msg);
1424 }
1425 }
1426 proto_item_set_len(oer_item, offset - oer_start);
1427 break;
1428 }
1429
1430 case SQLNET_IOVEC_4FAST_UPI11:
1431 {
1432 /* TTI_IOV: the server's I/O vector for an executed anonymous
1433 * PL/SQL block that carried bind variables. It lists each
1434 * bind's direction (IN / OUT / IN OUT); when any bind is
1435 * OUT / IN OUT the returned values follow as a TTI_RXD row.
1436 * Layout cross-referenced with python-oracledb's
1437 * _process_io_vector, and
1438 * verified against XE 11g.
1439 *
1440 * All the leading counters are stored in the ub4 variable-
1441 * length form (see get_sb4_custom). The per-bind directions
1442 * are one raw byte each. The trailing RXD values need each
1443 * bind's declared type to decode, so we stop after the
1444 * direction vector and leave the rest to the data dissector. */
1445 int num_requests = 0, num_iters = 0, v = 0, bv_len = 0, rid_len = 0;
1446
1447 if ( !is_request )
1448 {
1449 /* flag (ub1, skip) */
1450 offset += 1;
1451 offset += get_sb4_custom(tvb, offset, &num_requests);
1452 offset += get_sb4_custom(tvb, offset, &num_iters);
1453 int num_binds = num_iters * 256 + num_requests;
1454 proto_tree_add_uint(data_tree, hf_tns_data_iov_num_binds, tvb, offset, 0, num_binds);
1455 /* num iters this time (skip) */
1456 offset += get_sb4_custom(tvb, offset, &v);
1457 /* uac buffer length (skip) */
1458 offset += get_sb4_custom(tvb, offset, &v);
1459 /* fast-fetch bit-vector: length + bytes (skip) */
1460 offset += get_sb4_custom(tvb, offset, &bv_len);
1461 if ( bv_len > 0 )
1462 offset += bv_len;
1463 /* rowid: length + bytes (skip) */
1464 offset += get_sb4_custom(tvb, offset, &rid_len);
1465 if ( rid_len > 0 )
1466 offset += rid_len;
1467
1468 /* Per-bind direction bytes, in bind order. Bound by both
1469 * the reported count and the bytes actually present so a
1470 * malformed vector cannot run away. */
1471 proto_tree *iov_tree;
1472 proto_item *iov_item;
1473 int iov_start = offset;
1474 iov_tree = proto_tree_add_subtree(data_tree, tvb, offset, -1, ett_tns_iov, &iov_item, "Bind Directions");
1475 for ( int i = 0; i < num_binds && tvb_reported_length_remaining(tvb, offset) > 0; i++ )
1476 {
1477 proto_tree_add_item(iov_tree, hf_tns_data_iov_bind_dir, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1478 offset += 1;
1479 }
1480 proto_item_set_len(iov_item, offset - iov_start);
1481 }
1482 break;
1483 }
1484
1485 case SQLNET_DESCRIBE_INFO16:
1486 {
1487 /* TTI_DCB: describe (column metadata) for a SELECT result set.
1488 * Layout is the Oracle 11g shape. All
1489 * counts use the ub4 variable-length form. Only the leading
1490 * describe token is decoded here; any RXH/RXD/OER that follow
1491 * in the same packet are left to the data dissector. */
1492 int v = 0, num_cols = 0;
1493
1494 if ( is_request )
1495 break;
1496
1497 /* describe-info preamble (chunked bytes: cursor uuid + date) */
1498 offset += get_dalc_custom(tvb, pinfo, offset, NULL((void*)0));
1499 /* max row size (ub4, skip) */
1500 offset += get_sb4_custom(tvb, offset, &v);
1501 /* number of columns */
1502 int nc_start = offset;
1503 offset += get_sb4_custom(tvb, offset, &num_cols);
1504 proto_tree_add_uint(data_tree, hf_tns_data_dcb_num_columns, tvb, nc_start, offset - nc_start, num_cols);
1505 /* The count comes off the wire and sizes the allocation
1506 * below, so a count larger than the data left cannot be
1507 * real - report it and decode no columns. */
1508 if ( num_cols < 0 ||
1509 (unsigned)num_cols > tvb_reported_length_remaining(tvb, offset) )
1510 {
1511 proto_tree_add_expert(data_tree, pinfo, &ei_tns_data_count_too_large,
1512 tvb, nc_start, offset - nc_start);
1513 num_cols = 0;
1514 }
1515 if ( num_cols > 0 )
1516 offset += 1; /* reserved byte */
1517
1518 /* Remember each column's type so a later TTI_RXD response can
1519 * split its row values. Recorded once, on the first pass. */
1520 uint8_t *col_types = NULL((void*)0);
1521 if ( !PINFO_FD_VISITED(pinfo)((pinfo)->fd->visited) && num_cols > 0 )
1522 col_types = (uint8_t *)wmem_alloc_array(wmem_file_scope(), uint8_t, num_cols)((uint8_t*)wmem_alloc((wmem_file_scope()), (((((num_cols)) <=
0) || ((size_t)sizeof(uint8_t) > (9223372036854775807L / (
size_t)((num_cols))))) ? 0 : (sizeof(uint8_t) * ((num_cols)))
)))
;
1523 for ( int i = 0; i < num_cols && tvb_reported_length_remaining(tvb, offset) > 0; i++ )
1524 {
1525 if ( col_types )
1526 col_types[i] = tvb_get_uint8(tvb, offset);
1527 offset = dissect_tns_dcb_column(tvb, pinfo, data_tree, offset, i + 1);
1528 }
1529 if ( col_types )
1530 {
1531 tns_conv_info_t *tns_info = tns_get_conv_info(pinfo);
1532 tns_describe_t *desc = wmem_new0(wmem_file_scope(), tns_describe_t)((tns_describe_t*)wmem_alloc0((wmem_file_scope()), sizeof(tns_describe_t
)))
;
1533 desc->num_cols = num_cols;
1534 desc->types = col_types;
1535 tns_info->last_describe = desc;
1536 }
1537
1538 /* Trailer: current date (bytes_with_length), four ub4 flags,
1539 * and the query-cache key (bytes_with_length) — all skipped. */
1540 offset += get_field_with_length(tvb, pinfo, offset, NULL((void*)0));
1541 for ( int i = 0; i < 4; i++ )
1542 offset += get_sb4_custom(tvb, offset, &v);
1543 offset += get_field_with_length(tvb, pinfo, offset, NULL((void*)0));
1544 break;
1545 }
1546
1547 case SQLNET_ROW_TRANSF_HDR6:
1548 {
1549 /* TTI_RXH: row transfer header, precedes the row data in a
1550 * SELECT response. All numeric fields use the ub4 variable-
1551 * length form. Layout cross-referenced with
1552 * python-oracledb's _process_row_header. */
1553 int v = 0, bv_len = 0, start;
1554
1555 if ( is_request )
1556 break;
1557
1558 /* flag (ub1, skip) */
1559 offset += 1;
1560 /* number of requests */
1561 start = offset;
1562 offset += get_sb4_custom(tvb, offset, &v);
1563 proto_tree_add_uint(data_tree, hf_tns_data_rxh_num_requests, tvb, start, offset - start, v);
1564 /* iteration number */
1565 start = offset;
1566 offset += get_sb4_custom(tvb, offset, &v);
1567 proto_tree_add_uint(data_tree, hf_tns_data_rxh_iter_num, tvb, start, offset - start, v);
1568 /* number of iterations */
1569 start = offset;
1570 offset += get_sb4_custom(tvb, offset, &v);
1571 proto_tree_add_uint(data_tree, hf_tns_data_rxh_num_iters, tvb, start, offset - start, v);
1572 /* buffer length (ub4, skip) */
1573 offset += get_sb4_custom(tvb, offset, &v);
1574 /* bit vector: length + [repeated length byte + vector bytes] */
1575 offset += get_sb4_custom(tvb, offset, &bv_len);
1576 if ( bv_len > 0 )
1577 {
1578 offset += 1; /* repeated length byte */
1579 offset += bv_len; /* bit vector */
1580 }
1581 /* rxhrid (bytes_with_length, skip) */
1582 offset += get_field_with_length(tvb, pinfo, offset, NULL((void*)0));
1583 break;
1584 }
1585
1586 case SQLNET_ROW_TRANSF_DATA7:
1587 {
1588 /* TTI_RXD: row data for a SELECT result set — typically a
1589 * TTI_FETCH continuation, where the describe (TTI_DCB) arrived
1590 * in an earlier packet. Split each row into columns using the
1591 * types remembered from that describe (threaded through
1592 * conversation state); ordinary values are shown raw.
1593 *
1594 * The leading RXD token was already consumed above, so offset
1595 * sits on the first row's first value. Differential (bit-vector)
1596 * row encoding is not handled — a row that reuses a prior value
1597 * would desync, so we only decode when no BVC context applies. */
1598 tns_describe_t *desc = NULL((void*)0);
1599
1600 if ( is_request )
1601 break;
1602
1603 if ( !PINFO_FD_VISITED(pinfo)((pinfo)->fd->visited) )
1604 {
1605 tns_conv_info_t *tns_info = tns_get_conv_info(pinfo);
1606 desc = tns_info->last_describe;
1607 if ( desc )
1608 p_add_proto_data(wmem_file_scope(), pinfo, proto_tns,
1609 TNS_PROTO_DATA_DESCRIBE1, desc);
1610 }
1611 else
1612 {
1613 desc = (tns_describe_t *)p_get_proto_data(wmem_file_scope(), pinfo,
1614 proto_tns, TNS_PROTO_DATA_DESCRIBE1);
1615 }
1616
1617 if ( desc && desc->num_cols > 0 )
1618 {
1619 int rownum = 0, first_row = 1, bail = 0;
1620 while ( tvb_reported_length_remaining(tvb, offset) > 0 && !bail )
1621 {
1622 proto_tree *row_tree;
1623 proto_item *row_item;
1624 int r_start;
1625
1626 if ( !first_row )
1627 {
1628 if ( tvb_get_uint8(tvb, offset) != SQLNET_ROW_TRANSF_DATA7 )
1629 break;
1630 offset += 1; /* RXD token for subsequent rows */
1631 }
1632 first_row = 0;
1633
1634 r_start = offset;
1635 row_tree = proto_tree_add_subtree_format(data_tree, tvb, offset, -1,
1636 ett_tns_rxd_row, &row_item, "Row %d", ++rownum);
1637 for ( uint32_t c = 0; c < desc->num_cols
1638 && tvb_reported_length_remaining(tvb, offset) > 0 && !bail; c++ )
1639 offset = dissect_tns_rxd_value(tvb, pinfo, row_tree, offset,
1640 desc->types[c], c + 1, &bail);
1641 proto_item_set_len(row_item, offset - r_start);
1642 }
1643 }
1644 break;
1645 }
1646
1647 case SQLNET_USER_OCI_FUNC3:
1648 {
1649 guint32 oci_id = 0;
1650 proto_tree_add_item_ret_uint(data_tree, hf_tns_data_oci_id, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &oci_id);
1651 offset += 1;
1652 proto_tree_add_item(data_tree, hf_tns_data_tseq, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1653 offset += 1;
1654 if((oci_id == 115) || (oci_id == 118)){
1655 proto_tree_add_item(data_tree, hf_tns_data_unused, tvb, offset, 1, ENC_NA0x00000000);
1656 offset += 1;
1657 int user_len = 0;
1658 offset += get_sb4_custom(tvb, offset, &user_len);
1659 }
1660 else if ( oci_id == TTI_FETCH5 )
1661 {
1662 /* TTI_FETCH: fetch more rows from an open cursor.
1663 * [TTI_FUN, TTI_FETCH, seq] then cursor id and the row
1664 * count, both ub4. */
1665 int v = 0, start;
1666
1667 start = offset;
1668 offset += get_sb4_custom(tvb, offset, &v);
1669 proto_tree_add_uint(data_tree, hf_tns_cursor, tvb, start, offset - start, v);
1670 start = offset;
1671 offset += get_sb4_custom(tvb, offset, &v);
1672 proto_tree_add_uint(data_tree, hf_tns_data_fetch_rows, tvb, start, offset - start, v);
1673 }
1674 else if ( oci_id == TTI_ALL894 )
1675 {
1676 /* TTI_ALL8: the generic SQL execute — SELECT, DML and
1677 * PL/SQL all ride this call. Layout is the Oracle 11g
1678 * shape. All multi-byte integers use the ub4
1679 * variable-length form.
1680 *
1681 * The bind descriptors (OAC) and bind values (RXD) that can
1682 * trail the al8 array need per-bind type context to decode
1683 * safely, so we stop after the al8 array and leave them to
1684 * the data dissector. */
1685 int v = 0, options = 0, cursor = 0, query_len = 0, all8_len = 0;
1686 int fetch = 0, bind_count = 0, start;
1687 uint8_t query_flag;
1688
1689 /* options (ub4) + flag breakdown */
1690 start = offset;
1691 offset += get_sb4_custom(tvb, offset, &options);
1692 proto_tree_add_bitmask_value(data_tree, tvb, start, hf_tns_data_all8_options,
1693 ett_tns_all8_options, tns_all8_options, (uint64_t)(uint32_t)options);
1694 /* cursor id (ub4) */
1695 start = offset;
1696 offset += get_sb4_custom(tvb, offset, &cursor);
1697 proto_tree_add_uint(data_tree, hf_tns_cursor, tvb, start, offset - start, cursor);
1698 /* query present flag (ub1) */
1699 query_flag = tvb_get_uint8(tvb, offset);
1700 offset += 1;
1701 /* query length (ub4) */
1702 offset += get_sb4_custom(tvb, offset, &query_len);
1703 /* all8 present flag (ub1) */
1704 offset += 1;
1705 /* all8 length (ub4) */
1706 offset += get_sb4_custom(tvb, offset, &all8_len);
1707 /* two reserved bytes */
1708 offset += 2;
1709 /* long max value (ub4, skip) */
1710 offset += get_sb4_custom(tvb, offset, &v);
1711 /* fetch rows (ub4) */
1712 start = offset;
1713 offset += get_sb4_custom(tvb, offset, &fetch);
1714 proto_tree_add_uint(data_tree, hf_tns_data_all8_fetch_rows, tvb, start, offset - start, fetch);
1715 /* max value (ub4, skip) */
1716 offset += get_sb4_custom(tvb, offset, &v);
1717 /* bind indicator (ub1) */
1718 offset += 1;
1719 /* bind count (ub4) */
1720 start = offset;
1721 offset += get_sb4_custom(tvb, offset, &bind_count);
1722 proto_tree_add_uint(data_tree, hf_tns_data_all8_bind_count, tvb, start, offset - start, bind_count);
1723 /* The count comes off the wire and sizes an allocation
1724 * further down, so a count larger than the data left
1725 * cannot be real - report it and decode no binds. */
1726 if ( bind_count < 0 ||
1727 (unsigned)bind_count > tvb_reported_length_remaining(tvb, offset) )
1728 {
1729 proto_tree_add_expert(data_tree, pinfo, &ei_tns_data_count_too_large,
1730 tvb, start, offset - start);
1731 bind_count = 0;
1732 }
1733 /* five reserved bytes */
1734 offset += 5;
1735 /* define-columns present flag (ub1) */
1736 offset += 1;
1737 /* define-columns count (ub4, skip) */
1738 offset += get_sb4_custom(tvb, offset, &v);
1739 /* [0,0,1] marker (3 bytes) + server version slot (5 bytes) */
1740 offset += 8;
1741 /* SQL text — a flat run of query_len bytes on 11g */
1742 if ( query_flag && query_len > 0 )
1743 {
1744 const uint8_t *sql;
1745 proto_tree_add_item_ret_string(data_tree, hf_tns_data_all8_sql, tvb,
1746 offset, query_len, ENC_UTF_80x00000002|ENC_NA0x00000000, pinfo->pool, &sql);
1747 col_append_fstr(pinfo->cinfo, COL_INFO, " [%s]", sql);
1748 offset += query_len;
1749 }
1750 /* al8i4 option array: all8_len ub4 elements (skip) */
1751 for ( int i = 0; i < all8_len && tvb_reported_length_remaining(tvb, offset) > 0; i++ )
1752 offset += get_sb4_custom(tvb, offset, &v);
1753
1754 /* Bind section: on a fresh parse with binds, one bare OAC
1755 * descriptor per bind column, then one TTI_RXD row of values
1756 * per iteration. A cached re-execute (no query text) omits
1757 * the OACs — detecting that needs connection state, so we
1758 * only decode binds when the query was present. */
1759 if ( bind_count > 0 && query_flag )
1760 {
1761 proto_tree *binds_tree, *bind_tree, *row_tree;
1762 proto_item *binds_item, *bind_item, *row_item;
1763 int binds_start = offset, has_lob = 0, rownum = 0;
1764 uint8_t *btypes;
1765
1766 btypes = (uint8_t *)wmem_alloc_array(pinfo->pool, uint8_t, bind_count)((uint8_t*)wmem_alloc((pinfo->pool), (((((bind_count)) <=
0) || ((size_t)sizeof(uint8_t) > (9223372036854775807L / (
size_t)((bind_count))))) ? 0 : (sizeof(uint8_t) * ((bind_count
))))))
;
1767 binds_tree = proto_tree_add_subtree(data_tree, tvb, offset, -1,
1768 ett_tns_binds, &binds_item, "Binds");
1769
1770 for ( int i = 0; i < bind_count && tvb_reported_length_remaining(tvb, offset) > 0; i++ )
1771 {
1772 int b_start = offset;
1773 uint8_t btype = tvb_get_uint8(tvb, offset);
1774 btypes[i] = btype;
1775 /* CLOB (112) / BLOB (113) binds use a temp-LOB
1776 * locator value form we do not unpack. */
1777 if ( btype == 112 || btype == 113 )
1778 has_lob = 1;
1779 bind_tree = proto_tree_add_subtree_format(binds_tree, tvb, offset, -1,
1780 ett_tns_bind, &bind_item, "Bind %d: %s", i + 1,
1781 val_to_str_const(btype, tns_data_types, "unknown"));
1782 offset = dissect_tns_oac(tvb, pinfo, bind_tree, offset);
1783 /* A CLOB/BLOB bind OAC carries a trailing oaccolid byte. */
1784 if ( btype == 112 || btype == 113 )
1785 offset += 1;
1786 proto_item_set_len(bind_item, offset - b_start);
1787 }
1788
1789 /* Value rows: a TTI_RXD token then one DALC value per bind
1790 * column (an ordinary execute sends one row, executemany
1791 * sends N). Values are type-encoded and shown raw. */
1792 while ( !has_lob && tvb_reported_length_remaining(tvb, offset) > 0
1793 && tvb_get_uint8(tvb, offset) == SQLNET_ROW_TRANSF_DATA7 )
1794 {
1795 int r_start = offset;
1796 offset += 1; /* TTI_RXD token */
1797 row_tree = proto_tree_add_subtree_format(binds_tree, tvb, offset, -1,
1798 ett_tns_bind_row, &row_item, "Row %d", ++rownum);
1799 for ( int i = 0; i < bind_count && tvb_reported_length_remaining(tvb, offset) > 0; i++ )
1800 {
1801 uint8_t first = tvb_get_uint8(tvb, offset);
1802 int val_start = offset;
1803 offset += get_dalc_custom(tvb, pinfo, offset, NULL((void*)0));
1804 if ( first == 0 )
1805 proto_tree_add_bytes_format_value(row_tree, hf_tns_data_bind_value,
1806 tvb, val_start, offset - val_start, NULL((void*)0), "NULL");
1807 else if ( first == 254 )
1808 proto_tree_add_item(row_tree, hf_tns_data_bind_value,
1809 tvb, val_start, offset - val_start, ENC_NA0x00000000);
1810 else
1811 proto_tree_add_item(row_tree, hf_tns_data_bind_value,
1812 tvb, val_start + 1, first, ENC_NA0x00000000);
1813 }
1814 proto_item_set_len(row_item, offset - r_start);
1815 }
1816 proto_item_set_len(binds_item, offset - binds_start);
1817 }
1818 }
1819 else if ( oci_id == TTI_LOBOPS96 )
1820 {
1821 /* TTI_LOBOPS: the LOB operation family (read, write, get
1822 * length, create/free temp, open/close, BFILE ops). One
1823 * common request layout selects behaviour by the operation
1824 * opcode. All multi-byte integers use
1825 * the ub4 variable-length form.
1826 *
1827 * We decode the common header through the source offset and
1828 * show the opcode; the locator framing and trailing amount /
1829 * write payload vary by opcode and locator variant, so they
1830 * are left to the data dissector. */
1831 int v = 0, op = 0, start;
1832
1833 /* CREATE_TEMP carries a fixed field block (01 01 28 ...) with
1834 * no source locator instead of the common header. */
1835 if ( tvb_bytes_exist(tvb, offset, 3)
1836 && tvb_get_uint24(tvb, offset, ENC_BIG_ENDIAN0x00000000) == 0x010128 )
1837 {
1838 proto_tree_add_uint(data_tree, hf_tns_data_lob_op, tvb, offset, 3, 0x00110);
1839 }
1840 else
1841 {
1842 offset += 1; /* source pointer flag */
1843 offset += get_sb4_custom(tvb, offset, &v); /* source locator length */
1844 offset += 1; /* dest pointer flag */
1845 offset += get_sb4_custom(tvb, offset, &v); /* dest length */
1846 offset += get_sb4_custom(tvb, offset, &v); /* short source offset */
1847 offset += get_sb4_custom(tvb, offset, &v); /* short dest offset */
1848 offset += 3; /* charset / amount / null-lob flags */
1849 /* operation opcode */
1850 start = offset;
1851 offset += get_sb4_custom(tvb, offset, &op);
1852 proto_tree_add_uint(data_tree, hf_tns_data_lob_op, tvb, start, offset - start, op);
1853 col_append_fstr(pinfo->cinfo, COL_INFO, " [%s]",
1854 val_to_str_const(op, tns_lob_ops, "unknown"));
1855 /* scn-array pointer flag + length */
1856 offset += 2;
1857 /* source offset (ub8, 1-based into the LOB) */
1858 start = offset;
1859 offset += get_sb4_custom(tvb, offset, &v);
1860 proto_tree_add_uint(data_tree, hf_tns_data_lob_offset, tvb, start, offset - start, v);
1861 }
1862 }
1863 break;
1864 }
1865 case SQLNET_RETURN_OPI_PARAM8:
1866 {
1867 uint8_t skip = 0, opi = 0;
1868
1869 if ( tvb_bytes_exist(tvb, offset, 11) )
1870 {
1871 /*
1872 * OPI_VERSION2 response has a following pattern:
1873 *
1874 * _ banner _ vsnum
1875 * / /
1876 * ..(.?)(Orac[le.+])(.?)(....).+$
1877 * |
1878 * \ banner length (if equal to 0 then next byte indicates the length).
1879 *
1880 * These differences (to skip 1 or 2 bytes) due to differences in the drivers.
1881 */
1882 /* Orac[le.+] */
1883 if ( tvb_get_ntohl(tvb, offset+2) == 0x4f726163 )
1884 {
1885 opi = OPI_VERSION21;
1886 skip = 1;
1887 }
1888
1889 else if ( tvb_get_ntohl(tvb, offset+3) == 0x4f726163 )
1890 {
1891 opi = OPI_VERSION21;
1892 skip = 2;
1893 }
1894
1895 /*
1896 * OPI_OSESSKEY response has a following pattern:
1897 *
1898 * _ pattern (v1|v2)
1899 * / _ params
1900 * / /
1901 * (....)(........)(.+).+$
1902 * ||
1903 * \ if these two bytes are equal to 0x0c00 then first byte is <Param Counts> (v1),
1904 * else next byte indicate it (v2).
1905 */
1906 /* ....AUTH (v1) */
1907 else if ( tvb_get_ntoh64(tvb, offset+3) == 0x0000000c41555448 )
1908 {
1909 opi = OPI_OSESSKEY2;
1910 skip = 1;
1911 }
1912 /* ..AUTH_V (v2) */
1913 else if ( tvb_get_ntoh64(tvb, offset+3) == 0x0c0c415554485f53 )
1914 {
1915 opi = OPI_OSESSKEY2;
1916 skip = 2;
1917 }
1918
1919 /*
1920 * OPI_OAUTH response has a following pattern:
1921 *
1922 * _ pattern (v1|v2)
1923 * / _ params
1924 * / /
1925 * (....)(........)(.+).+$
1926 * ||
1927 * \ if these two bytes are equal to 0x1300 then first byte is <Param Counts> (v1),
1928 * else next byte indicate it (v2).
1929 */
1930
1931 /* ....AUTH (v1) */
1932 else if ( tvb_get_ntoh64(tvb, offset+3) == 0x0000001341555448 )
1933 {
1934 opi = OPI_OAUTH3;
1935 skip = 1;
1936 }
1937 /* ..AUTH_V (v2) */
1938 else if ( tvb_get_ntoh64(tvb, offset+3) == 0x1313415554485f56 )
1939 {
1940 opi = OPI_OAUTH3;
1941 skip = 2;
1942 }
1943 }
1944
1945 if ( opi == OPI_VERSION21 )
1946 {
1947 proto_tree_add_item(data_tree, hf_tns_data_unused, tvb, offset, skip, ENC_NA0x00000000);
1948 offset += skip;
1949
1950 uint8_t len = tvb_get_uint8(tvb, offset);
1951
1952 proto_tree_add_item(data_tree, hf_tns_data_opi_version2_banner_len, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1953 offset += 1;
1954
1955 proto_tree_add_item(data_tree, hf_tns_data_opi_version2_banner, tvb, offset, len, ENC_ASCII0x00000000);
1956 offset += len + (skip == 1 ? 1 : 0);
1957
1958 proto_tree_add_item(data_tree, hf_tns_data_opi_version2_vsnum, tvb, offset, 4, (skip == 1) ? ENC_BIG_ENDIAN0x00000000 : ENC_LITTLE_ENDIAN0x80000000);
1959 offset += 4;
1960 }
1961 else if ( opi == OPI_OSESSKEY2 || opi == OPI_OAUTH3 )
1962 {
1963 proto_tree *params_tree;
1964 proto_item *params_ti;
1965 unsigned par, params;
1966
1967 if ( skip == 1 )
1968 {
1969 proto_tree_add_item_ret_uint(data_tree, hf_tns_data_opi_num_of_params, tvb, offset, 1, ENC_NA0x00000000, &params);
1970 offset += 1;
1971
1972 proto_tree_add_item(data_tree, hf_tns_data_unused, tvb, offset, 5, ENC_NA0x00000000);
1973 offset += 5;
1974 }
1975 else
1976 {
1977 proto_tree_add_item(data_tree, hf_tns_data_unused, tvb, offset, 1, ENC_NA0x00000000);
1978 offset += 1;
1979
1980 proto_tree_add_item_ret_uint(data_tree, hf_tns_data_opi_num_of_params, tvb, offset, 1, ENC_NA0x00000000, &params);
1981 offset += 1;
1982
1983 proto_tree_add_item(data_tree, hf_tns_data_unused, tvb, offset, 2, ENC_NA0x00000000);
1984 offset += 2;
1985 }
1986
1987 params_tree = proto_tree_add_subtree(data_tree, tvb, offset, -1, ett_tns_opi_params, &params_ti, "Parameters");
1988
1989 for ( par = 1; par <= params; par++ )
1990 {
1991 proto_tree *par_tree;
1992 proto_item *par_ti;
1993 unsigned len, offset_prev;
1994
1995 par_tree = proto_tree_add_subtree(params_tree, tvb, offset, -1, ett_tns_opi_par, &par_ti, "Parameter");
1996 proto_item_append_text(par_ti, " %u", par);
1997
1998 /* Name length */
1999 proto_tree_add_item_ret_uint(par_tree, hf_tns_data_opi_param_length, tvb, offset, 1, ENC_NA0x00000000, &len);
2000 offset += 1;
2001
2002 /* Name */
2003 if ( !(len == 0 || len == 2) ) /* Not empty (2 - SQLDeveloper specific sign). */
2004 {
2005 proto_tree_add_item(par_tree, hf_tns_data_opi_param_name, tvb, offset, len, ENC_ASCII0x00000000);
2006 offset += len;
2007 }
2008
2009 /* Value can be NULL. So, save offset to calculate unused data. */
2010 offset_prev = offset;
2011 offset += skip == 1 ? 4 : 2;
2012
2013 /* Value length */
2014 if ( opi == OPI_OSESSKEY2 )
2015 {
2016 len = get_strtype_custom(tvb, pinfo, par_tree, offset);
2017 }
2018 else /* OPI_OAUTH */
2019 {
2020 len = tvb_get_uint8(tvb, offset_prev) == 0 ? 0 : get_strtype_custom(tvb, pinfo, par_tree, offset);
2021 }
2022
2023 /*
2024 * Value
2025 * OPI_OSESSKEY: AUTH_VFR_DATA with length 0, 9, 0x39 comes without data.
2026 * OPI_OAUTH: AUTH_VFR_DATA with length 0, 0x39 comes without data.
2027 */
2028 if ( ((opi == OPI_OSESSKEY2) && !(len == 0 || len == 9 || len == 0x39))
2029 || ((opi == OPI_OAUTH3) && !(len == 0 || len == 0x39)) )
2030 {
2031 proto_tree_add_item(par_tree, hf_tns_data_unused, tvb, offset_prev, offset - offset_prev, ENC_NA0x00000000);
2032 offset += len;
2033
2034 offset_prev = offset; /* Save offset to calculate rest of unused data */
2035 }
2036 else
2037 {
2038 offset += 1;
2039 }
2040
2041 if ( opi == OPI_OSESSKEY2 )
2042 {
2043 /* SQL Developer specific fix */
2044 offset += tvb_get_uint8(tvb, offset) == 2 ? 5 : 3;
2045 }
2046 else /* OPI_OAUTH */
2047 {
2048 offset += len == 0 ? 1 : 3;
2049 }
2050
2051 if ( skip == 1 )
2052 {
2053 offset += 1 + ((len == 0 || len == 0x39) ? 3 : 4);
2054
2055 if ( opi == OPI_OAUTH3 )
2056 {
2057 offset += len == 0 ? 2 : 0;
2058 }
2059 }
2060
2061 proto_tree_add_item(par_tree, hf_tns_data_unused, tvb, offset_prev, offset - offset_prev, ENC_NA0x00000000);
2062 proto_item_set_end(par_ti, tvb, offset);
2063 }
2064 proto_item_set_end(params_ti, tvb, offset);
2065 }
2066 break;
2067 }
2068
2069 case SQLNET_PIGGYBACK_FUNC17:
2070 {
2071 int cursors_len = 0;
2072 int cursors_start;
2073 proto_tree_add_item(data_tree, hf_tns_data_piggyback_id, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2074 offset += 1;
2075 proto_tree_add_item(data_tree, hf_tns_data_tseq, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2076 offset += 1;
2077 cursors_start = offset;
2078 offset += get_sb4_custom(tvb, offset, &cursors_len);
2079 /* The count comes off the wire and every cursor takes at
2080 * least one byte, so a count larger than the data left
2081 * cannot be real. Say so and stop, rather than looping on
2082 * a number somebody else chose. */
2083 if ( cursors_len < 0 ||
2084 (unsigned)cursors_len > tvb_reported_length_remaining(tvb, offset) )
2085 {
2086 proto_tree_add_expert(data_tree, pinfo, &ei_tns_data_piggyback_cursors,
2087 tvb, cursors_start, offset - cursors_start);
2088 break;
2089 }
2090 for(int i = 0; i < cursors_len; i++) {
2091 int cursor = 0;
2092 int new_offset = get_sb4_custom(tvb, offset, &cursor);
2093 proto_tree_add_uint(data_tree, hf_tns_cursor, tvb, offset, new_offset - offset, cursor);
2094 offset = new_offset;
2095 }
2096 break;
2097 }
2098 case SQLNET_SNS0xdeadbeef:
2099 {
2100 proto_tree_add_item(data_tree, hf_tns_data_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2101 offset += 4;
2102 proto_tree_add_item(data_tree, hf_tns_data_length, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2103 offset += 2;
2104
2105 if ( is_request )
2106 {
2107 proto_tree_add_item(data_tree, hf_tns_data_sns_cli_vers, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2108 }
2109 else
2110 {
2111 proto_tree_add_item(data_tree, hf_tns_data_sns_srv_vers, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2112 }
2113 offset += 4;
2114
2115 proto_tree_add_item(data_tree, hf_tns_data_sns_srvcnt, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2116
2117 /* move back, to include data_id into data_dissector */
2118 offset -= 10;
2119 break;
2120 }
2121 }
2122
2123 call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, data_tree);
2124}
2125
2126static void dissect_tns_connect(tvbuff_t *tvb, int offset, packet_info *pinfo _U___attribute__((unused)), proto_tree *tns_tree)
2127{
2128 proto_tree *connect_tree;
2129 uint32_t cd_offset, cd_len;
2130 int tns_offset = offset-8;
2131 static int * const flags[] = {
2132 &hf_tns_ntp_flag_hangon,
2133 &hf_tns_ntp_flag_crel,
2134 &hf_tns_ntp_flag_tduio,
2135 &hf_tns_ntp_flag_srun,
2136 &hf_tns_ntp_flag_dtest,
2137 &hf_tns_ntp_flag_cbio,
2138 &hf_tns_ntp_flag_asio,
2139 &hf_tns_ntp_flag_pio,
2140 &hf_tns_ntp_flag_grant,
2141 &hf_tns_ntp_flag_handoff,
2142 &hf_tns_ntp_flag_sigio,
2143 &hf_tns_ntp_flag_sigpipe,
2144 &hf_tns_ntp_flag_sigurg,
2145 &hf_tns_ntp_flag_urgentio,
2146 &hf_tns_ntp_flag_fdio,
2147 &hf_tns_ntp_flag_testop,
2148 NULL((void*)0)
2149 };
2150
2151 connect_tree = proto_tree_add_subtree(tns_tree, tvb, offset, -1,
2152 ett_tns_connect, NULL((void*)0), "Connect");
2153
2154 proto_tree_add_item(connect_tree, hf_tns_version, tvb,
2155 offset, 2, ENC_BIG_ENDIAN0x00000000);
2156 offset += 2;
2157
2158 proto_tree_add_item(connect_tree, hf_tns_compat_version, tvb,
2159 offset, 2, ENC_BIG_ENDIAN0x00000000);
2160 offset += 2;
2161
2162 proto_tree_add_bitmask(connect_tree, tvb, offset, hf_tns_service_options, ett_tns_sopt_flag, tns_service_options, ENC_BIG_ENDIAN0x00000000);
2163 offset += 2;
2164
2165 proto_tree_add_item(connect_tree, hf_tns_sdu_size, tvb,
2166 offset, 2, ENC_BIG_ENDIAN0x00000000);
2167 offset += 2;
2168
2169 proto_tree_add_item(connect_tree, hf_tns_max_tdu_size, tvb,
2170 offset, 2, ENC_BIG_ENDIAN0x00000000);
2171 offset += 2;
2172
2173 proto_tree_add_bitmask(connect_tree, tvb, offset, hf_tns_nt_proto_characteristics, ett_tns_ntp_flag, flags, ENC_BIG_ENDIAN0x00000000);
2174 offset += 2;
2175
2176 proto_tree_add_item(connect_tree, hf_tns_line_turnaround, tvb,
2177 offset, 2, ENC_BIG_ENDIAN0x00000000);
2178 offset += 2;
2179
2180 proto_tree_add_item(connect_tree, hf_tns_value_of_one, tvb,
2181 offset, 2, ENC_NA0x00000000);
2182 offset += 2;
2183
2184 proto_tree_add_item_ret_uint(connect_tree, hf_tns_connect_data_length, tvb,
2185 offset, 2, ENC_BIG_ENDIAN0x00000000, &cd_len);
2186 offset += 2;
2187
2188 proto_tree_add_item_ret_uint(connect_tree, hf_tns_connect_data_offset, tvb,
2189 offset, 2, ENC_BIG_ENDIAN0x00000000, &cd_offset);
2190 offset += 2;
2191
2192 proto_tree_add_item(connect_tree, hf_tns_connect_data_max, tvb,
2193 offset, 4, ENC_BIG_ENDIAN0x00000000);
2194 offset += 4;
2195
2196 proto_tree_add_bitmask(connect_tree, tvb, offset, hf_tns_connect_flags0, ett_tns_conn_flag, tns_connect_flags, ENC_BIG_ENDIAN0x00000000);
2197 offset += 1;
2198
2199 proto_tree_add_bitmask(connect_tree, tvb, offset, hf_tns_connect_flags1, ett_tns_conn_flag, tns_connect_flags, ENC_BIG_ENDIAN0x00000000);
2200 offset += 1;
2201
2202 /*
2203 * XXX - sometimes it appears that this stuff isn't present
2204 * in the packet.
2205 */
2206 if ((uint32_t)(offset + 16) <= tns_offset+cd_offset)
2207 {
2208 proto_tree_add_item(connect_tree, hf_tns_trace_cf1, tvb,
2209 offset, 4, ENC_BIG_ENDIAN0x00000000);
2210 offset += 4;
2211
2212 proto_tree_add_item(connect_tree, hf_tns_trace_cf2, tvb,
2213 offset, 4, ENC_BIG_ENDIAN0x00000000);
2214 offset += 4;
2215
2216 proto_tree_add_item(connect_tree, hf_tns_trace_cid, tvb,
2217 offset, 8, ENC_BIG_ENDIAN0x00000000);
2218 /* offset += 8;*/
2219 }
2220
2221 if ( cd_len > 0)
2222 {
2223 /* Long Connect Data (> 221 bytes?) is not in the Connect PDU
2224 * but sent in an immediately following Data PDU.
2225 */
2226 if (tvb_reported_length_remaining(tvb, tns_offset + cd_offset)) {
2227 proto_tree_add_item(connect_tree, hf_tns_connect_data, tvb,
2228 tns_offset+cd_offset, -1, ENC_ASCII0x00000000);
2229 } else {
2230 proto_tree_add_expert(connect_tree, pinfo, &ei_tns_connect_data_next_packet, tvb, 0, 0);
2231 if (!PINFO_FD_VISITED(pinfo)((pinfo)->fd->visited)) {
2232 tns_conv_info_t *tns_info = tns_get_conv_info(pinfo);
2233 tns_info->pending_connect_data = cd_len;
2234 }
2235 }
2236 }
2237}
2238
2239static void dissect_tns_accept(tvbuff_t *tvb, int offset, packet_info *pinfo _U___attribute__((unused)), proto_tree *tns_tree)
2240{
2241 proto_tree *accept_tree;
2242 uint32_t accept_offset, accept_len;
2243 int tns_offset = offset-8;
2244
2245 accept_tree = proto_tree_add_subtree(tns_tree, tvb, offset, -1,
2246 ett_tns_accept, NULL((void*)0), "Accept");
2247
2248 proto_tree_add_item(accept_tree, hf_tns_version, tvb,
2249 offset, 2, ENC_BIG_ENDIAN0x00000000);
2250 offset += 2;
2251
2252 proto_tree_add_bitmask(accept_tree, tvb, offset, hf_tns_service_options, ett_tns_sopt_flag, tns_service_options, ENC_BIG_ENDIAN0x00000000);
2253 offset += 2;
2254
2255 proto_tree_add_item(accept_tree, hf_tns_sdu_size, tvb,
2256 offset, 2, ENC_BIG_ENDIAN0x00000000);
2257 offset += 2;
2258
2259 proto_tree_add_item(accept_tree, hf_tns_max_tdu_size, tvb,
2260 offset, 2, ENC_BIG_ENDIAN0x00000000);
2261 offset += 2;
2262
2263 proto_tree_add_item(accept_tree, hf_tns_value_of_one, tvb,
2264 offset, 2, ENC_NA0x00000000);
2265 offset += 2;
2266
2267 proto_tree_add_item_ret_uint(accept_tree, hf_tns_accept_data_length, tvb,
2268 offset, 2, ENC_BIG_ENDIAN0x00000000, &accept_len);
2269 offset += 2;
2270
2271 proto_tree_add_item_ret_uint(accept_tree, hf_tns_accept_data_offset, tvb,
2272 offset, 2, ENC_BIG_ENDIAN0x00000000, &accept_offset);
2273 offset += 2;
2274
2275 proto_tree_add_bitmask(accept_tree, tvb, offset, hf_tns_connect_flags0, ett_tns_conn_flag, tns_connect_flags, ENC_BIG_ENDIAN0x00000000);
2276 offset += 1;
2277
2278 proto_tree_add_bitmask(accept_tree, tvb, offset, hf_tns_connect_flags1, ett_tns_conn_flag, tns_connect_flags, ENC_BIG_ENDIAN0x00000000);
2279 /* offset += 1; */
2280
2281 if ( accept_len > 0)
2282 {
2283 proto_tree_add_item(accept_tree, hf_tns_accept_data, tvb,
2284 tns_offset+accept_offset, -1, ENC_ASCII0x00000000);
2285 }
2286 return;
2287}
2288
2289
2290static void dissect_tns_refuse(tvbuff_t *tvb, int offset, packet_info *pinfo _U___attribute__((unused)), proto_tree *tns_tree)
2291{
2292 /* TODO
2293 * According to some reverse engineers, the refuse packet is also sent when the login fails.
2294 * Byte 54 shows if this is due to invalid ID (0x02) or password (0x03).
2295 * At now we do not have pcaps with such messages to check this statement.
2296 */
2297 proto_tree *refuse_tree;
2298
2299 refuse_tree = proto_tree_add_subtree(tns_tree, tvb, offset, -1,
2300 ett_tns_refuse, NULL((void*)0), "Refuse");
2301
2302 proto_tree_add_item(refuse_tree, hf_tns_refuse_reason_user, tvb,
2303 offset, 1, ENC_BIG_ENDIAN0x00000000);
2304 offset += 1;
2305
2306 proto_tree_add_item(refuse_tree, hf_tns_refuse_reason_system, tvb,
2307 offset, 1, ENC_BIG_ENDIAN0x00000000);
2308 offset += 1;
2309
2310 proto_tree_add_item(refuse_tree, hf_tns_refuse_data_length, tvb,
2311 offset, 2, ENC_BIG_ENDIAN0x00000000);
2312 offset += 2;
2313
2314 proto_tree_add_item(refuse_tree, hf_tns_refuse_data, tvb,
2315 offset, -1, ENC_ASCII0x00000000);
2316}
2317
2318
2319static void dissect_tns_abort(tvbuff_t *tvb, int offset, packet_info *pinfo _U___attribute__((unused)), proto_tree *tns_tree)
2320{
2321 proto_tree *abort_tree;
2322
2323 abort_tree = proto_tree_add_subtree(tns_tree, tvb, offset, -1,
2324 ett_tns_abort, NULL((void*)0), "Abort");
2325
2326 proto_tree_add_item(abort_tree, hf_tns_abort_reason_user, tvb,
2327 offset, 1, ENC_BIG_ENDIAN0x00000000);
2328 offset += 1;
2329
2330 proto_tree_add_item(abort_tree, hf_tns_abort_reason_system, tvb,
2331 offset, 1, ENC_BIG_ENDIAN0x00000000);
2332 offset += 1;
2333
2334 proto_tree_add_item(abort_tree, hf_tns_abort_data, tvb,
2335 offset, -1, ENC_ASCII0x00000000);
2336}
2337
2338
2339static void dissect_tns_marker(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tns_tree, int is_attention)
2340{
2341 proto_tree *marker_tree;
2342
2343 marker_tree = proto_tree_add_subtree(tns_tree, tvb, offset, -1,
2344 ett_tns_marker, NULL((void*)0), is_attention ? "Attention" : "Marker");
2345
2346 proto_tree_add_item(marker_tree, hf_tns_marker_type, tvb,
2347 offset, 1, ENC_BIG_ENDIAN0x00000000);
2348 offset += 1;
2349
2350 proto_tree_add_item(marker_tree, hf_tns_marker_data_byte, tvb,
2351 offset, 1, ENC_BIG_ENDIAN0x00000000);
2352 offset += 1;
2353
2354 /* The last byte selects break vs reset for a data marker. */
2355 if ( tvb_reported_length_remaining(tvb, offset) > 0 )
2356 {
2357 uint32_t func = tvb_get_uint8(tvb, offset);
2358 proto_tree_add_item(marker_tree, hf_tns_marker_function, tvb,
2359 offset, 1, ENC_BIG_ENDIAN0x00000000);
2360 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
2361 val_to_str_const(func, tns_marker_functions, "Unknown"));
2362 }
2363}
2364
2365static void dissect_tns_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo _U___attribute__((unused)), proto_tree *tns_tree)
2366{
2367 proto_tree *redirect_tree;
2368
2369 redirect_tree = proto_tree_add_subtree(tns_tree, tvb, offset, -1,
2370 ett_tns_redirect, NULL((void*)0), "Redirect");
2371
2372 proto_tree_add_item(redirect_tree, hf_tns_redirect_data_length, tvb,
2373 offset, 2, ENC_BIG_ENDIAN0x00000000);
2374 offset += 2;
2375
2376 proto_tree_add_item(redirect_tree, hf_tns_redirect_data, tvb,
2377 offset, -1, ENC_ASCII0x00000000);
2378}
2379
2380static void dissect_tns_control(tvbuff_t *tvb, int offset, packet_info *pinfo _U___attribute__((unused)), proto_tree *tns_tree)
2381{
2382 proto_tree *control_tree;
2383
2384 control_tree = proto_tree_add_subtree(tns_tree, tvb, offset, -1,
2385 ett_tns_control, NULL((void*)0), "Control");
2386
2387 proto_tree_add_item(control_tree, hf_tns_control_cmd, tvb,
2388 offset, 2, ENC_BIG_ENDIAN0x00000000);
2389 offset += 2;
2390
2391 proto_tree_add_item(control_tree, hf_tns_control_data, tvb,
2392 offset, -1, ENC_NA0x00000000);
2393}
2394
2395static unsigned
2396get_tns_pdu_len(packet_info *pinfo _U___attribute__((unused)), tvbuff_t *tvb, int offset, void *data _U___attribute__((unused)))
2397{
2398 /*
2399 * Get the 16-bit length of the TNS message, including header
2400 */
2401 unsigned length = tvb_get_ntohs(tvb, offset);
2402 offset += 4;
2403 uint8_t type = tvb_get_uint8(tvb, offset);
2404 /* Type 0xf (data descriptor, LOB/FILE data) has data which follows
2405 * immediately (no new PDU header) but is not counted in the PDU
2406 * length field either.
2407 */
2408 if (type == TNS_TYPE_DD15) {
2409 offset += 8;
2410 if (!tvb_bytes_exist(tvb, offset, 4)) {
2411 /* return 0 makes tcp_dissect_pdus() report
2412 * DESEGMENT_ONE_MORE_SEGMENT to the TCP dissector.
2413 */
2414 return 0;
2415 }
2416 unsigned dd_len = tvb_get_ntohl(tvb, offset);
2417 return length + dd_len;
2418 }
2419 return length;
2420}
2421
2422static unsigned
2423get_tns_pdu_len_nochksum(packet_info *pinfo _U___attribute__((unused)), tvbuff_t *tvb, int offset, void *data _U___attribute__((unused)))
2424{
2425 /*
2426 * Get the 32-bit length of the TNS message, including header
2427 */
2428 unsigned length = tvb_get_ntohl(tvb, offset);
2429 offset += 4;
2430 uint8_t type = tvb_get_uint8(tvb, offset);
2431 /* Type 0xf (data descriptor, LOB/FILE data) has data which follows
2432 * immediately (no new PDU header) but is not counted in the PDU
2433 * length field either.
2434 */
2435 if (type == TNS_TYPE_DD15) {
2436 offset += 8;
2437 if (!tvb_bytes_exist(tvb, offset, 4)) {
2438 /* return 0 makes tcp_dissect_pdus() report
2439 * DESEGMENT_ONE_MORE_SEGMENT to the TCP dissector.
2440 */
2441 return 0;
2442 }
2443 unsigned dd_len = tvb_get_ntohl(tvb, offset);
2444 return length + dd_len;
2445 }
2446
2447 return length;
2448}
2449
2450static int
2451dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2452{
2453 uint32_t length;
2454 uint16_t chksum;
2455 uint8_t type;
2456
2457 /*
2458 * First, do a sanity check to make sure what we have
2459 * starts with a TNS PDU.
2460 */
2461 if (tvb_bytes_exist(tvb, 4, 1)) {
2462 /*
2463 * Well, we have the packet type; let's make sure
2464 * it's a known type.
2465 */
2466 type = tvb_get_uint8(tvb, 4);
2467 if (type < TNS_TYPE_CONNECT1 || type > TNS_TYPE_MAX19)
2468 return 0; /* it's not a known type */
2469 }
2470
2471 /*
2472 * In some messages (observed in Oracle12c) packet length has 4 bytes
2473 * instead of 2.
2474 *
2475 * If packet length has 2 bytes, length and checksum equals two unsigned
2476 * 16-bit numbers. Packet checksum is generally unused (equal zero),
2477 * but 10g client may set 2nd byte to 4.
2478 *
2479 * Else, Oracle 12c combine these two 16-bit numbers into one 32-bit.
2480 * This number represents the packet length. Checksum is omitted.
2481 */
2482 chksum = tvb_get_ntohs(tvb, 2);
2483
2484 length = (chksum == 0 || chksum == 4) ? 2 : 4;
2485
2486 tcp_dissect_pdus(tvb, pinfo, tree, tns_desegment, TNS_HDR_LEN8,
2487 (length == 2 ? get_tns_pdu_len : get_tns_pdu_len_nochksum),
2488 dissect_tns_pdu, data);
2489
2490 return tvb_captured_length(tvb);
2491}
2492
2493static int
2494dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U___attribute__((unused)))
2495{
2496 proto_tree *tns_tree, *ti;
2497 proto_item *hidden_item;
2498 unsigned offset = 0;
2499 uint32_t length;
2500 uint16_t chksum;
2501 uint8_t type;
2502
2503 col_set_str(pinfo->cinfo, COL_PROTOCOL, "TNS");
2504
2505 col_set_str(pinfo->cinfo, COL_INFO,
2506 (pinfo->match_uint == pinfo->destport) ? "Request" : "Response");
2507
2508 ti = proto_tree_add_item(tree, proto_tns, tvb, 0, -1, ENC_NA0x00000000);
2509 tns_tree = proto_item_add_subtree(ti, ett_tns);
2510
2511 if (pinfo->match_uint == pinfo->destport)
2512 {
2513 hidden_item = proto_tree_add_boolean(tns_tree, hf_tns_request,
2514 tvb, offset, 0, true1);
2515 }
2516 else
2517 {
2518 hidden_item = proto_tree_add_boolean(tns_tree, hf_tns_response,
2519 tvb, offset, 0, true1);
2520 }
2521 proto_item_set_hidden(hidden_item);
2522
2523 chksum = tvb_get_ntohs(tvb, offset+2);
2524 if (chksum == 0 || chksum == 4)
2525 {
2526 proto_tree_add_item_ret_uint(tns_tree, hf_tns_length, tvb, offset,
2527 2, ENC_BIG_ENDIAN0x00000000, &length);
2528 offset += 2;
2529 proto_tree_add_checksum(tns_tree, tvb, offset, hf_tns_packet_checksum,
2530 -1, NULL((void*)0), pinfo, 0, ENC_BIG_ENDIAN0x00000000, PROTO_CHECKSUM_NO_FLAGS0x00);
2531 offset += 2;
2532 }
2533 else
2534 {
2535 /* Oracle 12c uses checksum bytes as part of the packet length. */
2536 proto_tree_add_item_ret_uint(tns_tree, hf_tns_length, tvb, offset,
2537 4, ENC_BIG_ENDIAN0x00000000, &length);
2538 offset += 4;
2539 }
2540
2541 type = tvb_get_uint8(tvb, offset);
2542 proto_tree_add_uint(tns_tree, hf_tns_packet_type, tvb,
2543 offset, 1, type);
2544 offset += 1;
2545
2546 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s (%u)",
2547 val_to_str_const(type, tns_type_vals, "Unknown"), type);
2548
2549 proto_tree_add_item(tns_tree, hf_tns_reserved_byte, tvb,
2550 offset, 1, ENC_NA0x00000000);
2551 offset += 1;
2552
2553 proto_tree_add_checksum(tns_tree, tvb, offset, hf_tns_header_checksum, -1, NULL((void*)0), pinfo, 0, ENC_BIG_ENDIAN0x00000000, PROTO_CHECKSUM_NO_FLAGS0x00);
2554 offset += 2;
2555
2556 switch (type)
2557 {
2558 case TNS_TYPE_CONNECT1:
2559 dissect_tns_connect(tvb,offset,pinfo,tns_tree);
2560 break;
2561 case TNS_TYPE_ACCEPT2:
2562 dissect_tns_accept(tvb,offset,pinfo,tns_tree);
2563 break;
2564 case TNS_TYPE_REFUSE4:
2565 dissect_tns_refuse(tvb,offset,pinfo,tns_tree);
2566 break;
2567 case TNS_TYPE_REDIRECT5:
2568 dissect_tns_redirect(tvb,offset,pinfo,tns_tree);
2569 break;
2570 case TNS_TYPE_ABORT9:
2571 dissect_tns_abort(tvb,offset,pinfo,tns_tree);
2572 break;
2573 case TNS_TYPE_MARKER12:
2574 dissect_tns_marker(tvb,offset,pinfo,tns_tree, 0);
2575 break;
2576 case TNS_TYPE_ATTENTION13:
2577 dissect_tns_marker(tvb,offset,pinfo,tns_tree, 1);
2578 break;
2579 case TNS_TYPE_CONTROL14:
2580 dissect_tns_control(tvb,offset,pinfo,tns_tree);
2581 break;
2582 case TNS_TYPE_DATA6:
2583 dissect_tns_data(tvb,offset,pinfo,tns_tree);
2584 break;
2585 case TNS_TYPE_DD15:
2586 dissect_tns_data_descriptor(tvb,offset,pinfo,tns_tree, length);
2587 break;
2588 default:
2589 call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo,
2590 tns_tree);
2591 break;
2592 }
2593
2594 return tvb_captured_length(tvb);
2595}
2596
2597void proto_register_tns(void)
2598{
2599 static hf_register_info hf[] = {
2600 { &hf_tns_response, {
2601 "Response", "tns.response", FT_BOOLEAN, BASE_NONE,
2602 NULL((void*)0), 0x0, "true if TNS response", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2603 { &hf_tns_request, {
2604 "Request", "tns.request", FT_BOOLEAN, BASE_NONE,
2605 NULL((void*)0), 0x0, "true if TNS request", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2606 { &hf_tns_length, {
2607 "Packet Length", "tns.length", FT_UINT32, BASE_DEC,
2608 NULL((void*)0), 0x0, "Length of TNS packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2609 { &hf_tns_packet_checksum, {
2610 "Packet Checksum", "tns.packet_checksum", FT_UINT16, BASE_HEX,
2611 NULL((void*)0), 0x0, "Checksum of Packet Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2612 { &hf_tns_header_checksum, {
2613 "Header Checksum", "tns.header_checksum", FT_UINT16, BASE_HEX,
2614 NULL((void*)0), 0x0, "Checksum of Header Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2615
2616 { &hf_tns_version, {
2617 "Version", "tns.version", FT_UINT16, BASE_DEC,
2618 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2619 { &hf_tns_compat_version, {
2620 "Version (Compatible)", "tns.compat_version", FT_UINT16, BASE_DEC,
2621 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2622
2623 { &hf_tns_service_options, {
2624 "Service Options", "tns.service_options", FT_UINT16, BASE_HEX,
2625 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2626
2627 { &hf_tns_sopt_flag_bconn, {
2628 "Broken Connect Notify", "tns.so_flag.bconn", FT_BOOLEAN, 16,
2629 NULL((void*)0), 0x2000, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2630 { &hf_tns_sopt_flag_pc, {
2631 "Packet Checksum", "tns.so_flag.pc", FT_BOOLEAN, 16,
2632 NULL((void*)0), 0x1000, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2633 { &hf_tns_sopt_flag_hc, {
2634 "Header Checksum", "tns.so_flag.hc", FT_BOOLEAN, 16,
2635 NULL((void*)0), 0x0800, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2636 { &hf_tns_sopt_flag_fd, {
2637 "Full Duplex", "tns.so_flag.fd", FT_BOOLEAN, 16,
2638 NULL((void*)0), 0x0400, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2639 { &hf_tns_sopt_flag_hd, {
2640 "Half Duplex", "tns.so_flag.hd", FT_BOOLEAN, 16,
2641 NULL((void*)0), 0x0200, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2642 { &hf_tns_sopt_flag_dc1, {
2643 "Don't Care", "tns.so_flag.dc1", FT_BOOLEAN, 16,
2644 NULL((void*)0), 0x0100, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2645 { &hf_tns_sopt_flag_dc2, {
2646 "Don't Care", "tns.so_flag.dc2", FT_BOOLEAN, 16,
2647 NULL((void*)0), 0x0080, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2648 { &hf_tns_sopt_flag_dio, {
2649 "Direct IO to Transport", "tns.so_flag.dio", FT_BOOLEAN, 16,
2650 NULL((void*)0), 0x0010, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2651 { &hf_tns_sopt_flag_ap, {
2652 "Attention Processing", "tns.so_flag.ap", FT_BOOLEAN, 16,
2653 NULL((void*)0), 0x0008, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2654 { &hf_tns_sopt_flag_ra, {
2655 "Can Receive Attention", "tns.so_flag.ra", FT_BOOLEAN, 16,
2656 NULL((void*)0), 0x0004, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2657 { &hf_tns_sopt_flag_sa, {
2658 "Can Send Attention", "tns.so_flag.sa", FT_BOOLEAN, 16,
2659 NULL((void*)0), 0x0002, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2660
2661
2662 { &hf_tns_sdu_size, {
2663 "Session Data Unit Size", "tns.sdu_size", FT_UINT16, BASE_DEC,
2664 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2665 { &hf_tns_max_tdu_size, {
2666 "Maximum Transmission Data Unit Size", "tns.max_tdu_size", FT_UINT16, BASE_DEC,
2667 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2668
2669 { &hf_tns_nt_proto_characteristics, {
2670 "NT Protocol Characteristics", "tns.nt_proto_characteristics", FT_UINT16, BASE_HEX,
2671 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2672 { &hf_tns_ntp_flag_hangon, {
2673 "Hangon to listener connect", "tns.ntp_flag.hangon", FT_BOOLEAN, 16,
2674 NULL((void*)0), 0x8000, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2675 { &hf_tns_ntp_flag_crel, {
2676 "Confirmed release", "tns.ntp_flag.crel", FT_BOOLEAN, 16,
2677 NULL((void*)0), 0x4000, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2678 { &hf_tns_ntp_flag_tduio, {
2679 "TDU based IO", "tns.ntp_flag.tduio", FT_BOOLEAN, 16,
2680 NULL((void*)0), 0x2000, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2681 { &hf_tns_ntp_flag_srun, {
2682 "Spawner running", "tns.ntp_flag.srun", FT_BOOLEAN, 16,
2683 NULL((void*)0), 0x1000, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2684 { &hf_tns_ntp_flag_dtest, {
2685 "Data test", "tns.ntp_flag.dtest", FT_BOOLEAN, 16,
2686 NULL((void*)0), 0x0800, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2687 { &hf_tns_ntp_flag_cbio, {
2688 "Callback IO supported", "tns.ntp_flag.cbio", FT_BOOLEAN, 16,
2689 NULL((void*)0), 0x0400, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2690 { &hf_tns_ntp_flag_asio, {
2691 "ASync IO Supported", "tns.ntp_flag.asio", FT_BOOLEAN, 16,
2692 NULL((void*)0), 0x0200, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2693 { &hf_tns_ntp_flag_pio, {
2694 "Packet oriented IO", "tns.ntp_flag.pio", FT_BOOLEAN, 16,
2695 NULL((void*)0), 0x0100, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2696 { &hf_tns_ntp_flag_grant, {
2697 "Can grant connection to another", "tns.ntp_flag.grant", FT_BOOLEAN, 16,
2698 NULL((void*)0), 0x0080, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2699 { &hf_tns_ntp_flag_handoff, {
2700 "Can handoff connection to another", "tns.ntp_flag.handoff", FT_BOOLEAN, 16,
2701 NULL((void*)0), 0x0040, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2702 { &hf_tns_ntp_flag_sigio, {
2703 "Generate SIGIO signal", "tns.ntp_flag.sigio", FT_BOOLEAN, 16,
2704 NULL((void*)0), 0x0020, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2705 { &hf_tns_ntp_flag_sigpipe, {
2706 "Generate SIGPIPE signal", "tns.ntp_flag.sigpipe", FT_BOOLEAN, 16,
2707 NULL((void*)0), 0x0010, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2708 { &hf_tns_ntp_flag_sigurg, {
2709 "Generate SIGURG signal", "tns.ntp_flag.sigurg", FT_BOOLEAN, 16,
2710 NULL((void*)0), 0x0008, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2711 { &hf_tns_ntp_flag_urgentio, {
2712 "Urgent IO supported", "tns.ntp_flag.urgentio", FT_BOOLEAN, 16,
2713 NULL((void*)0), 0x0004, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2714 { &hf_tns_ntp_flag_fdio, {
2715 "Full duplex IO supported", "tns.ntp_flag.dfio", FT_BOOLEAN, 16,
2716 NULL((void*)0), 0x0002, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2717 { &hf_tns_ntp_flag_testop, {
2718 "Test operation", "tns.ntp_flag.testop", FT_BOOLEAN, 16,
2719 NULL((void*)0), 0x0001, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2720
2721
2722
2723
2724 { &hf_tns_line_turnaround, {
2725 "Line Turnaround Value", "tns.line_turnaround", FT_UINT16, BASE_DEC,
2726 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2727 { &hf_tns_value_of_one, {
2728 "Value of 1 in Hardware", "tns.value_of_one", FT_BYTES, BASE_NONE,
2729 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2730
2731 { &hf_tns_connect_data_length, {
2732 "Length of Connect Data", "tns.connect_data_length", FT_UINT16,
2733 BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_byte_bytes)((0 ? (const struct unit_name_string*)0 : ((&units_byte_bytes
))))
, 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2734 { &hf_tns_connect_data_offset, {
2735 "Offset to Connect Data", "tns.connect_data_offset", FT_UINT16, BASE_DEC,
2736 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2737 { &hf_tns_connect_data_max, {
2738 "Maximum Receivable Connect Data", "tns.connect_data_max", FT_UINT32, BASE_DEC,
2739 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2740
2741 { &hf_tns_connect_flags0, {
2742 "Connect Flags 0", "tns.connect_flags0", FT_UINT8, BASE_HEX,
2743 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2744 { &hf_tns_connect_flags1, {
2745 "Connect Flags 1", "tns.connect_flags1", FT_UINT8, BASE_HEX,
2746 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2747
2748 { &hf_tns_conn_flag_nareq, {
2749 "NA services required", "tns.connect_flags.nareq", FT_BOOLEAN, 8,
2750 NULL((void*)0), 0x10, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2751 { &hf_tns_conn_flag_nalink, {
2752 "NA services linked in", "tns.connect_flags.nalink", FT_BOOLEAN, 8,
2753 NULL((void*)0), 0x08, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2754 { &hf_tns_conn_flag_enablena, {
2755 "NA services enabled", "tns.connect_flags.enablena", FT_BOOLEAN, 8,
2756 NULL((void*)0), 0x04, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2757 { &hf_tns_conn_flag_ichg, {
2758 "Interchange is involved", "tns.connect_flags.ichg", FT_BOOLEAN, 8,
2759 NULL((void*)0), 0x02, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2760 { &hf_tns_conn_flag_wantna, {
2761 "NA services wanted", "tns.connect_flags.wantna", FT_BOOLEAN, 8,
2762 NULL((void*)0), 0x01, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2763
2764
2765 { &hf_tns_trace_cf1, {
2766 "Trace Cross Facility Item 1", "tns.trace_cf1", FT_UINT32, BASE_HEX,
2767 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2768 { &hf_tns_trace_cf2, {
2769 "Trace Cross Facility Item 2", "tns.trace_cf2", FT_UINT32, BASE_HEX,
2770 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2771 { &hf_tns_trace_cid, {
2772 "Trace Unique Connection ID", "tns.trace_cid", FT_UINT64, BASE_HEX,
2773 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2774 { &hf_tns_connect_data, {
2775 "Connect Data", "tns.connect_data", FT_STRING, BASE_NONE,
2776 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2777
2778 { &hf_tns_accept_data_length, {
2779 "Accept Data Length", "tns.accept_data_length", FT_UINT16,
2780 BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_byte_bytes)((0 ? (const struct unit_name_string*)0 : ((&units_byte_bytes
))))
, 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2781 { &hf_tns_accept_data, {
2782 "Accept Data", "tns.accept_data", FT_STRING, BASE_NONE,
2783 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2784 { &hf_tns_accept_data_offset, {
2785 "Offset to Accept Data", "tns.accept_data_offset", FT_UINT16, BASE_DEC,
2786 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2787
2788 { &hf_tns_refuse_reason_user, {
2789 "Refuse Reason (User)", "tns.refuse_reason_user", FT_UINT8, BASE_HEX,
2790 NULL((void*)0), 0x0, "Refuse Reason from Application", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2791 { &hf_tns_refuse_reason_system, {
2792 "Refuse Reason (System)", "tns.refuse_reason_system", FT_UINT8, BASE_HEX,
2793 NULL((void*)0), 0x0, "Refuse Reason from System", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2794 { &hf_tns_refuse_data_length, {
2795 "Refuse Data Length", "tns.refuse_data_length", FT_UINT16,
2796 BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_byte_bytes)((0 ? (const struct unit_name_string*)0 : ((&units_byte_bytes
))))
, 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2797 { &hf_tns_refuse_data, {
2798 "Refuse Data", "tns.refuse_data", FT_STRING, BASE_NONE,
2799 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2800
2801 { &hf_tns_abort_reason_user, {
2802 "Abort Reason (User)", "tns.abort_reason_user", FT_UINT8, BASE_HEX,
2803 NULL((void*)0), 0x0, "Abort Reason from Application", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2804 { &hf_tns_abort_reason_system, {
2805 "Abort Reason (User)", "tns.abort_reason_system", FT_UINT8, BASE_HEX,
2806 NULL((void*)0), 0x0, "Abort Reason from System", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2807 { &hf_tns_abort_data, {
2808 "Abort Data", "tns.abort_data", FT_STRING, BASE_NONE,
2809 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2810
2811 { &hf_tns_marker_type, {
2812 "Marker Type", "tns.marker.type", FT_UINT8, BASE_HEX,
2813 VALS(tns_marker_types)((0 ? (const struct _value_string*)0 : ((tns_marker_types)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2814 { &hf_tns_marker_data_byte, {
2815 "Marker Data Byte", "tns.marker.databyte", FT_UINT8, BASE_HEX,
2816 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2817 { &hf_tns_marker_function, {
2818 "Marker Function", "tns.marker.function", FT_UINT8, BASE_DEC,
2819 VALS(tns_marker_functions)((0 ? (const struct _value_string*)0 : ((tns_marker_functions
))))
, 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2820#if 0
2821 { &hf_tns_marker_data, {
2822 "Marker Data", "tns.marker.data", FT_UINT16, BASE_HEX,
2823 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2824#endif
2825
2826 { &hf_tns_control_cmd, {
2827 "Control Command", "tns.control.cmd", FT_UINT16, BASE_HEX,
2828 VALS(tns_control_cmds)((0 ? (const struct _value_string*)0 : ((tns_control_cmds)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2829 { &hf_tns_control_data, {
2830 "Control Data", "tns.control.data", FT_BYTES, BASE_NONE,
2831 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2832
2833 { &hf_tns_redirect_data_length, {
2834 "Redirect Data Length", "tns.redirect_data_length", FT_UINT16,
2835 BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_byte_bytes)((0 ? (const struct unit_name_string*)0 : ((&units_byte_bytes
))))
, 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2836 { &hf_tns_redirect_data, {
2837 "Redirect Data", "tns.redirect_data", FT_STRING, BASE_NONE,
2838 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2839
2840 { &hf_tns_data_flag, {
2841 "Data Flag", "tns.data_flag", FT_UINT16, BASE_HEX,
2842 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2843 { &hf_tns_data_flag_send, {
2844 "Send Token", "tns.data_flag.send", FT_BOOLEAN, 16,
2845 NULL((void*)0), 0x1, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2846 { &hf_tns_data_flag_rc, {
2847 "Request Confirmation", "tns.data_flag.rc", FT_BOOLEAN, 16,
2848 NULL((void*)0), 0x2, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2849 { &hf_tns_data_flag_c, {
2850 "Confirmation", "tns.data_flag.c", FT_BOOLEAN, 16,
2851 NULL((void*)0), 0x4, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2852 { &hf_tns_data_flag_reserved, {
2853 "Reserved", "tns.data_flag.reserved", FT_BOOLEAN, 16,
2854 NULL((void*)0), 0x8, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2855 { &hf_tns_data_flag_more, {
2856 "More Data to Come", "tns.data_flag.more", FT_BOOLEAN, 16,
2857 NULL((void*)0), 0x0020, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2858 { &hf_tns_data_flag_eof, {
2859 "End of File", "tns.data_flag.eof", FT_BOOLEAN, 16,
2860 NULL((void*)0), 0x0040, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2861 { &hf_tns_data_flag_dic, {
2862 "Do Immediate Confirmation", "tns.data_flag.dic", FT_BOOLEAN, 16,
2863 NULL((void*)0), 0x0080, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2864 { &hf_tns_data_flag_rts, {
2865 "Request To Send", "tns.data_flag.rts", FT_BOOLEAN, 16,
2866 NULL((void*)0), 0x0100, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2867 { &hf_tns_data_flag_sntt, {
2868 "Send NT Trailer", "tns.data_flag.sntt", FT_BOOLEAN, 16,
2869 NULL((void*)0), 0x0200, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2870
2871 { &hf_tns_data_id, {
2872 "Data ID", "tns.data_id", FT_UINT32, BASE_HEX,
2873 VALS(tns_data_funcs)((0 ? (const struct _value_string*)0 : ((tns_data_funcs)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2874 { &hf_tns_data_length, {
2875 "Data Length", "tns.data_length", FT_UINT32,
2876 BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_byte_bytes)((0 ? (const struct unit_name_string*)0 : ((&units_byte_bytes
))))
, 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2877
2878 { &hf_tns_data_oci_id, {
2879 "Call ID", "tns.data_oci.id", FT_UINT8, BASE_HEX|BASE_EXT_STRING0x00000200,
2880 &tns_data_oci_subfuncs_ext, 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2881
2882 { &hf_tns_data_tseq, {
2883 "TSeq", "tns.data_tseq", FT_UINT8, BASE_HEX,
2884 NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2885
2886 { &hf_tns_data_piggyback_id, {
2887 /* Also Call ID.
2888 Piggyback is a message what calls a small subset of functions
2889 declared in tns_data_oci_subfuncs. */
2890 "Call ID", "tns.data_piggyback.id", FT_UINT8, BASE_HEX|BASE_EXT_STRING0x00000200,
2891 &tns_data_oci_subfuncs_ext, 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2892
2893 { &hf_tns_data_unused, {
2894 "Unused", "tns.data.unused", FT_BYTES, BASE_NONE,
2895 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2896
2897 { &hf_tns_cursor, {
2898 "Cursor", "tns.data.cursor", FT_UINT32, BASE_DEC,
2899 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2900
2901 { &hf_tns_data_setp_acc_version, {
2902 "Accepted Version", "tns.data_setp_req.acc_vers", FT_UINT8, BASE_DEC,
2903 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2904 { &hf_tns_data_setp_cli_plat, {
2905 "Client Platform", "tns.data_setp_req.cli_plat", FT_STRINGZ, BASE_NONE,
2906 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2907 { &hf_tns_data_setp_version, {
2908 "Version", "tns.data_setp_resp.version", FT_UINT8, BASE_DEC,
2909 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2910 { &hf_tns_data_setp_banner, {
2911 "Server Banner", "tns.data_setp_resp.banner", FT_STRINGZ, BASE_NONE,
2912 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2913
2914 { &hf_tns_data_sns_cli_vers, {
2915 "Client Version", "tns.data_sns.cli_vers", FT_UINT32, BASE_CUSTOM,
2916 CF_FUNC(vsnum_to_vstext_basecustom)((const void *) (size_t) (vsnum_to_vstext_basecustom)), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2917 { &hf_tns_data_sns_srv_vers, {
2918 "Server Version", "tns.data_sns.srv_vers", FT_UINT32, BASE_CUSTOM,
2919 CF_FUNC(vsnum_to_vstext_basecustom)((const void *) (size_t) (vsnum_to_vstext_basecustom)), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2920 { &hf_tns_data_sns_srvcnt, {
2921 "Services", "tns.data_sns.srvcnt", FT_UINT16, BASE_DEC,
2922 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2923
2924 { &hf_tns_data_setdt_charset_in, {
2925 "Charset In", "tns.data_setdt.charset_in", FT_UINT16, BASE_DEC,
2926 VALS(tns_charsets)((0 ? (const struct _value_string*)0 : ((tns_charsets)))), 0x0, "NLS_LANGUAGE charset id", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2927 { &hf_tns_data_setdt_charset_out, {
2928 "Charset Out", "tns.data_setdt.charset_out", FT_UINT16, BASE_DEC,
2929 VALS(tns_charsets)((0 ? (const struct _value_string*)0 : ((tns_charsets)))), 0x0, "NLS_NCHAR charset id", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2930 { &hf_tns_data_setdt_flag, {
2931 "Flag", "tns.data_setdt.flag", FT_UINT8, BASE_HEX,
2932 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2933 { &hf_tns_data_setdt_caphdr, {
2934 "Capability Header", "tns.data_setdt.caphdr", FT_BYTES, BASE_NONE,
2935 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2936 { &hf_tns_data_setdt_caphdr_version, {
2937 "Version", "tns.data_setdt.caphdr.version", FT_UINT24, BASE_HEX,
2938 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2939 { &hf_tns_data_setdt_caphdr_flags, {
2940 "Flags", "tns.data_setdt.caphdr.flags", FT_BYTES, BASE_NONE,
2941 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2942 { &hf_tns_data_setdt_tblhdr, {
2943 "Table Header", "tns.data_setdt.tblhdr", FT_BYTES, BASE_NONE,
2944 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2945 { &hf_tns_data_setdt_idmap, {
2946 "Identity Map", "tns.data_setdt.idmap", FT_BYTES, BASE_NONE,
2947 NULL((void*)0), 0x0, "245 entries: type N -> repr N (default mapping)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2948 { &hf_tns_data_setdt_overrides, {
2949 "Type Overrides", "tns.data_setdt.overrides", FT_NONE, BASE_NONE,
2950 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2951 { &hf_tns_data_setdt_override_client, {
2952 "Client Type", "tns.data_setdt.override.client", FT_UINT8, BASE_DEC,
2953 VALS(tns_data_types)((0 ? (const struct _value_string*)0 : ((tns_data_types)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2954 { &hf_tns_data_setdt_override_repr, {
2955 "Server Repr", "tns.data_setdt.override.repr", FT_UINT8, BASE_DEC,
2956 VALS(tns_data_types)((0 ? (const struct _value_string*)0 : ((tns_data_types)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2957 { &hf_tns_data_setdt_override_format, {
2958 "Format", "tns.data_setdt.override.format", FT_UINT8, BASE_DEC,
2959 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2960
2961 { &hf_tns_data_oer_call_status, {
2962 "Call Status", "tns.data_oer.call_status", FT_INT32, BASE_DEC,
2963 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2964 { &hf_tns_data_oer_rowcount, {
2965 "Row Count", "tns.data_oer.rowcount", FT_INT32, BASE_DEC,
2966 NULL((void*)0), 0x0, "DML affected rows (11g)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2967 { &hf_tns_data_oer_err_code, {
2968 "Error Code", "tns.data_oer.err_code", FT_INT32, BASE_DEC,
2969 NULL((void*)0), 0x0, "ORA-NNNNN (0 = success)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2970 { &hf_tns_data_oer_cursor_id, {
2971 "Cursor Id", "tns.data_oer.cursor_id", FT_INT32, BASE_DEC,
2972 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2973 { &hf_tns_data_oer_n_batch_errcodes, {
2974 "Batch Error Codes", "tns.data_oer.n_batch_errcodes", FT_INT32, BASE_DEC,
2975 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2976 { &hf_tns_data_oer_n_batch_offsets, {
2977 "Batch Error Offsets", "tns.data_oer.n_batch_offsets", FT_INT32, BASE_DEC,
2978 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2979 { &hf_tns_data_oer_n_batch_messages, {
2980 "Batch Error Messages", "tns.data_oer.n_batch_messages", FT_INT32, BASE_DEC,
2981 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2982 { &hf_tns_data_oer_message, {
2983 "Message", "tns.data_oer.message", FT_STRING, BASE_NONE,
2984 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2985
2986 { &hf_tns_data_opi_version2_banner_len, {
2987 "Banner Length", "tns.data_opi.vers2.banner_len", FT_UINT8, BASE_DEC,
2988 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2989 { &hf_tns_data_opi_version2_banner, {
2990 "Banner", "tns.data_opi.vers2.banner", FT_STRING, BASE_NONE,
2991 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2992 { &hf_tns_data_opi_version2_vsnum, {
2993 "Version", "tns.data_opi.vers2.version", FT_UINT32, BASE_CUSTOM,
2994 CF_FUNC(vsnum_to_vstext_basecustom)((const void *) (size_t) (vsnum_to_vstext_basecustom)), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2995
2996 { &hf_tns_data_opi_num_of_params, {
2997 "Number of parameters", "tns.data_opi.num_of_params", FT_UINT8, BASE_DEC,
2998 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
2999 { &hf_tns_data_opi_param_length, {
3000 "Length", "tns.data_opi.param_length", FT_UINT8, BASE_DEC,
3001 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3002 { &hf_tns_data_opi_param_name, {
3003 "Name", "tns.data_opi.param_name", FT_STRING, BASE_NONE,
3004 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3005 { &hf_tns_data_opi_param_value, {
3006 "Value", "tns.data_opi.param_value", FT_STRING, BASE_NONE,
3007 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3008
3009 { &hf_tns_data_iov_num_binds, {
3010 "Number of Binds", "tns.data_iov.num_binds", FT_UINT32, BASE_DEC,
3011 NULL((void*)0), 0x0, "num_iters * 256 + num_requests", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3012 { &hf_tns_data_iov_bind_dir, {
3013 "Bind Direction", "tns.data_iov.bind_dir", FT_UINT8, BASE_DEC,
3014 VALS(tns_iov_bind_dirs)((0 ? (const struct _value_string*)0 : ((tns_iov_bind_dirs)))
)
, 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3015
3016 { &hf_tns_data_dcb_num_columns, {
3017 "Number of Columns", "tns.data_dcb.num_columns", FT_UINT32, BASE_DEC,
3018 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3019 { &hf_tns_data_col_type, {
3020 "Data Type", "tns.data_col.type", FT_UINT8, BASE_DEC,
3021 VALS(tns_data_types)((0 ? (const struct _value_string*)0 : ((tns_data_types)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3022 { &hf_tns_data_col_precision, {
3023 "Precision", "tns.data_col.precision", FT_UINT8, BASE_DEC,
3024 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3025 { &hf_tns_data_col_scale, {
3026 "Scale", "tns.data_col.scale", FT_INT32, BASE_DEC,
3027 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3028 { &hf_tns_data_col_max_length, {
3029 "Max Data Length", "tns.data_col.max_length", FT_UINT32, BASE_DEC,
3030 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3031 { &hf_tns_data_col_charset, {
3032 "Charset", "tns.data_col.charset", FT_UINT32, BASE_DEC,
3033 VALS(tns_charsets)((0 ? (const struct _value_string*)0 : ((tns_charsets)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3034 { &hf_tns_data_col_csform, {
3035 "Charset Form", "tns.data_col.csform", FT_UINT8, BASE_DEC,
3036 VALS(tns_csform_vals)((0 ? (const struct _value_string*)0 : ((tns_csform_vals)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3037 { &hf_tns_data_col_max_size, {
3038 "Max Size", "tns.data_col.max_size", FT_UINT32, BASE_DEC,
3039 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3040 { &hf_tns_data_col_nulls_ok, {
3041 "Nulls Allowed", "tns.data_col.nulls_ok", FT_UINT8, BASE_DEC,
3042 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3043 { &hf_tns_data_col_name, {
3044 "Column Name", "tns.data_col.name", FT_STRING, BASE_NONE,
3045 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3046
3047 { &hf_tns_data_rxh_num_requests, {
3048 "Number of Requests", "tns.data_rxh.num_requests", FT_UINT32, BASE_DEC,
3049 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3050 { &hf_tns_data_rxh_iter_num, {
3051 "Iteration Number", "tns.data_rxh.iter_num", FT_UINT32, BASE_DEC,
3052 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3053 { &hf_tns_data_rxh_num_iters, {
3054 "Number of Iterations", "tns.data_rxh.num_iters", FT_UINT32, BASE_DEC,
3055 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3056
3057 { &hf_tns_data_all8_options, {
3058 "Options", "tns.data_all8.options", FT_UINT32, BASE_HEX,
3059 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3060 { &hf_tns_data_all8_opt_parse, {
3061 "Parse", "tns.data_all8.options.parse", FT_BOOLEAN, 32,
3062 NULL((void*)0), 0x0001, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3063 { &hf_tns_data_all8_opt_bind, {
3064 "Bind Values Present", "tns.data_all8.options.bind", FT_BOOLEAN, 32,
3065 NULL((void*)0), 0x0008, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3066 { &hf_tns_data_all8_opt_define, {
3067 "Define Columns Present", "tns.data_all8.options.define", FT_BOOLEAN, 32,
3068 NULL((void*)0), 0x0010, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3069 { &hf_tns_data_all8_opt_execute, {
3070 "Execute", "tns.data_all8.options.execute", FT_BOOLEAN, 32,
3071 NULL((void*)0), 0x0020, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3072 { &hf_tns_data_all8_opt_commit, {
3073 "Autocommit", "tns.data_all8.options.commit", FT_BOOLEAN, 32,
3074 NULL((void*)0), 0x0100, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3075 { &hf_tns_data_all8_opt_plsql, {
3076 "PL/SQL Block", "tns.data_all8.options.plsql", FT_BOOLEAN, 32,
3077 NULL((void*)0), 0x0400, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3078 { &hf_tns_data_all8_opt_fetch, {
3079 "Fetch", "tns.data_all8.options.fetch", FT_BOOLEAN, 32,
3080 NULL((void*)0), 0x8000, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3081 { &hf_tns_data_all8_fetch_rows, {
3082 "Fetch Rows", "tns.data_all8.fetch_rows", FT_UINT32, BASE_DEC,
3083 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3084 { &hf_tns_data_all8_bind_count, {
3085 "Bind Count", "tns.data_all8.bind_count", FT_UINT32, BASE_DEC,
3086 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3087 { &hf_tns_data_all8_sql, {
3088 "SQL Text", "tns.data_all8.sql", FT_STRING, BASE_NONE,
3089 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3090 { &hf_tns_data_bind_value, {
3091 "Bind Value", "tns.data_bind.value", FT_BYTES, BASE_NONE,
3092 NULL((void*)0), 0x0, "Raw type-encoded bind value", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3093 { &hf_tns_data_fetch_rows, {
3094 "Rows to Fetch", "tns.data_fetch.rows", FT_UINT32, BASE_DEC,
3095 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3096 { &hf_tns_data_lob_op, {
3097 "LOB Operation", "tns.data_lob.op", FT_UINT32, BASE_HEX,
3098 VALS(tns_lob_ops)((0 ? (const struct _value_string*)0 : ((tns_lob_ops)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3099 { &hf_tns_data_lob_offset, {
3100 "Source Offset", "tns.data_lob.offset", FT_UINT32, BASE_DEC,
3101 NULL((void*)0), 0x0, "1-based offset into the LOB", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3102 { &hf_tns_data_col_value, {
3103 "Column Value", "tns.data_col.value", FT_BYTES, BASE_NONE,
3104 NULL((void*)0), 0x0, "Raw type-encoded row column value", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3105
3106 { &hf_tns_data_descriptor_row_count, {
3107 "Row Count", "tns.data_descriptor.row_count", FT_UINT32, BASE_DEC,
3108 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3109 { &hf_tns_data_descriptor_row_size, {
3110 "Row Size", "tns.data_descriptor.row_size", FT_UINT32, BASE_DEC,
3111 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3112
3113 { &hf_tns_reserved_byte, {
3114 "Reserved Byte", "tns.reserved_byte", FT_BYTES, BASE_NONE,
3115 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
3116 { &hf_tns_packet_type, {
3117 "Packet Type", "tns.type", FT_UINT8, BASE_DEC,
3118 VALS(tns_type_vals)((0 ? (const struct _value_string*)0 : ((tns_type_vals)))), 0x0, "Type of TNS packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}
3119
3120 };
3121
3122 static int *ett[] = {
3123 &ett_tns,
3124 &ett_tns_connect,
3125 &ett_tns_accept,
3126 &ett_tns_refuse,
3127 &ett_tns_abort,
3128 &ett_tns_redirect,
3129 &ett_tns_marker,
3130 &ett_tns_attention,
3131 &ett_tns_control,
3132 &ett_tns_data,
3133 &ett_tns_data_flag,
3134 &ett_tns_acc_versions,
3135 &ett_tns_opi_params,
3136 &ett_tns_opi_par,
3137 &ett_tns_sopt_flag,
3138 &ett_tns_ntp_flag,
3139 &ett_tns_conn_flag,
3140 &ett_tns_rows,
3141 &ett_tns_setdt_caphdr,
3142 &ett_tns_setdt_overrides,
3143 &ett_tns_setdt_override,
3144 &ett_tns_oer,
3145 &ett_tns_iov,
3146 &ett_tns_dcb_col,
3147 &ett_tns_all8_options,
3148 &ett_tns_binds,
3149 &ett_tns_bind,
3150 &ett_tns_bind_row,
3151 &ett_tns_rxd_row,
3152 &ett_sql
3153 };
3154
3155 static ei_register_info ei[] = {
3156 { &ei_tns_connect_data_next_packet, { "tns.connect_data.next_packet", PI_REQUEST_CODE0x04000000, PI_CHAT0x00200000, "Long Connect Data (> 221 bytes) carried in subsequent Data packet", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
3157 { &ei_tns_data_descriptor_size_mismatch, { "tns.data_descriptor.size_mismatch", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "Data size from summing row sizes differs from size in descriptor", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
3158 { &ei_tns_data_piggyback_cursors, { "tns.data.piggyback.cursors.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Cursor count is larger than the data left in the packet", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
3159 { &ei_tns_data_count_too_large, { "tns.data.count.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Count is larger than the data left in the packet", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
3160 };
3161
3162 module_t *tns_module;
3163 expert_module_t* expert_tns;
3164
3165 proto_tns = proto_register_protocol("Transparent Network Substrate Protocol", "TNS", "tns");
3166 proto_register_field_array(proto_tns, hf, array_length(hf)(sizeof (hf) / sizeof (hf)[0]));
3167 proto_register_subtree_array(ett, array_length(ett)(sizeof (ett) / sizeof (ett)[0]));
3168 expert_tns = expert_register_protocol(proto_tns);
3169 expert_register_field_array(expert_tns, ei, array_length(ei)(sizeof (ei) / sizeof (ei)[0]));
3170 tns_handle = register_dissector("tns", dissect_tns, proto_tns);
3171
3172 tns_module = prefs_register_protocol(proto_tns, NULL((void*)0));
3173 prefs_register_bool_preference(tns_module, "desegment_tns_messages",
3174 "Reassemble TNS messages spanning multiple TCP segments",
3175 "Whether the TNS dissector should reassemble messages spanning multiple TCP segments. "
3176 "To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
3177 &tns_desegment);
3178}
3179
3180void
3181proto_reg_handoff_tns(void)
3182{
3183 dissector_add_uint_with_preference("tcp.port", TCP_PORT_TNS1521, tns_handle);
3184}
3185
3186/*
3187 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3188 *
3189 * Local variables:
3190 * c-basic-offset: 8
3191 * tab-width: 8
3192 * indent-tabs-mode: t
3193 * End:
3194 *
3195 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
3196 * :indentSize=8:tabSize=8:noTabs=false:
3197 */