Bug Summary

File:builds/wireshark/wireshark/epan/dissectors/packet-saprfc.c
Warning:line 810, column 3
Value stored to 'item_value_length' 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-saprfc.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-08-21-100412-3660-1 -x c /builds/wireshark/wireshark/epan/dissectors/packet-saprfc.c
1/* packet-saprfc.c
2 * Routines for SAP RFC (SAP Remote Function Call Protocol) dissection
3 * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com>
4 * Code contributed by SecureAuth Corp.
5 *
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
13#include <epan/packet.h>
14#include <epan/prefs.h>
15#include <epan/expert.h>
16#include <wsutil/wmem/wmem.h>
17#include <wsutil/saplzclzh.h>
18
19/*
20 * Define default ports. The right range should be 33NN, but as port numbers are proprietary and not
21 * IANA assigned, we leave only the one corresponding to the instance 00.
22 */
23#define SAPRFC_PORT_RANGE"3300" "3300"
24
25#define SAPRFC_DEFAULT_MAX_UNCOMPRESSED_SIZE(16U * 1024U * 1024U) (16U * 1024U * 1024U)
26#define SAPRFC_DEFAULT_MAX_REASSEMBLED_SIZE(16U * 1024U * 1024U) (16U * 1024U * 1024U)
27#define SAPRFC_TABLE_PREFIX_LENGTH8U 8U
28#define SAPRFC_APPC_HEADER_LEN96U 96U
29#define SAPRFC_NORMAL_CLIENT_HEADER_LEN_V164U 64U
30#define SAPRFC_NORMAL_CLIENT_HEADER_LEN_V380U 80U
31
32
33/* SAP RFC Request Types field values */
34static const value_string saprfc_reqtype_values[] = {
35 { 0x00, "GW_UNDEF_TYPE" },
36 { 0x01, "GW_CHECK_GATEWAY" },
37 { 0x02, "GW_CONNECT_GWWP" },
38 { 0x03, "GW_NORMAL_CLIENT" },
39 { 0x04, "GW_REMOTE_GATEWAY" },
40 { 0x05, "STOP_GATEWAY" },
41 { 0x06, "GW_LOCAL_R3" },
42 { 0x07, "GW_SEND_INTERNAL_ERROR" },
43 { 0x08, "GW_SEND_INFO" },
44 { 0x09, "GW_SEND_CMD" },
45 { 0x0a, "GW_WORKPROCESS_DIED" },
46 { 0x0b, "GW_REGISTER_TP" },
47 { 0x0c, "GW_UNREGISTER_TP" },
48 { 0x0d, "GW_CONNECT_DISP" },
49 { 0x0e, "GW_GET_NO_REGISTER_TP" },
50 { 0x0f, "GW_SAP_WP_CLIENT" },
51 { 0x10, "GW_CANCEL_REGISTER_TP" },
52 { 0x11, "REMOTE_GATEWAY" },
53 { 0x12, "GW_CONTAINER_RECEIVED" },
54 /* NULL */
55 { 0x00, NULL((void*)0) }
56};
57
58/* SAP RFC Monitor Command field values */
59static const value_string saprfc_monitor_cmd_values[] = {
60 { 0x01, "NOOP" },
61 { 0x02, "DELETE_CONN" },
62 { 0x03, "CANCEL_CONN" },
63 { 0x04, "RST_SINGLE_ERR_CNT" },
64 { 0x05, "RST_ALL_ERR_CNT" },
65 { 0x06, "INCREASE_TRACE" },
66 { 0x07, "DECREASE_TRACE" },
67 { 0x08, "READ_SEC_INFO" },
68 { 0x09, "REFRESH_SEC_INFO" },
69 { 0x0a, "READ_GWSYS_TBL" },
70 { 0x0b, "READ_CONN_TBL" },
71 { 0x0c, "READ_PROC_TBL" },
72 { 0x0d, "READ_CONN_ATTR" },
73 { 0x0e, "READ_MEMORY" },
74 { 0x0f, "READ_REQ_BLK" },
75 { 0x10, "ACT_STATISTIC" },
76 { 0x11, "DEACT_STATISTIC" },
77 { 0x12, "READ_STATISTIC" },
78 { 0x13, "RESET_STATISTIC" },
79 { 0x14, "READ_PARAMETER" },
80 { 0x19, "DUMP_NIBUFFER" },
81 { 0x20, "RESET_NIBUFFER" },
82 { 0x21, "ACT_EXTPGM_TRACE" },
83 { 0x22, "DEACT_EXTPGM_TRACE" },
84 { 0x23, "ACT_CONN_TRACE" },
85 { 0x24, "DEACT_CONN_TRACE" },
86 { 0x25, "RESET_TRACE" },
87 { 0x26, "SUICIDE" },
88 { 0x27, "READ_SEC_INFO2" },
89 { 0x28, "CANCEL_REG_TP" },
90 { 0x29, "DUMP" },
91 { 0x2a, "READ_GWSYS_TBL2" },
92 { 0x2b, "CHANGE_PARAMETER" },
93 { 0x2c, "GET_CONN_PARTNER" },
94 { 0x2d, "DELETE_CLIENT" },
95 { 0x2e, "DELETE_REMGW" },
96 { 0x2f, "DISCONNECT" },
97 { 0x30, "ENABLE_RESTART" },
98 { 0x31, "DISABLE_RESTART" },
99 { 0x32, "NI_TRACE" },
100 { 0x33, "CLI_INFO" },
101 { 0x34, "GW_INFO" },
102 { 0x35, "CONVID_INFO" },
103 { 0x36, "GET_NO_REG_TP" },
104 { 0x37, "CV_INFO" },
105 { 0x38, "SO_KEEPALIVE" },
106 { 0x39, "READ_CONN_TBL2" },
107 { 0x40, "READ_GWSYS_TBL3" },
108 { 0x41, "RELOAD_ACL" },
109 /* NULL */
110 { 0x00, NULL((void*)0) }
111};
112
113/* SAP RFC APPC Header Request Type field values */
114static const value_string saprfc_header_reqtype_values[] = {
115 { 0x00, "F_NO_REQUEST" },
116 { 0x01, "F_INITIALIZE_CONVERSATION" },
117 { 0x03, "F_ACCEPT_CONVERSATION" },
118 { 0x05, "F_ALLOCATE" },
119 { 0x07, "F_SEND_DATA" },
120 { 0x08, "F_ASEND_DATA" },
121 { 0x09, "F_RECEIVE" },
122 { 0x0a, "F_ARECEIVE" },
123 { 0x0b, "F_DEALLOCATE" },
124 { 0x0d, "F_SET_TP_NAME" },
125 { 0x0f, "F_SET_PARTNER_LU_NAME" },
126 { 0x11, "F_SET_SECURITY_PASSWORD" },
127 { 0x13, "F_SET_SECURITY_USER_ID" },
128 { 0x15, "F_SET_SECURITY_TYPE" },
129 { 0x17, "F_SET_CONVERSATION_TYPE" },
130 { 0x19, "F_EXTRACT_TP_NAME" },
131 { 0x1b, "F_FLUSH" },
132 { 0xc9, "F_SAP_ALLOCATE" },
133 { 0xca, "F_SAP_INIT" },
134 { 0xcb, "F_SAP_SEND" },
135 { 0xcc, "F_ASAP_SEND" },
136 { 0xcd, "F_SAP_SYNC" },
137 { 0xce, "F_SAP_PING" },
138 { 0xcf, "F_SAP_REGTP" },
139 { 0xd0, "F_SAP_UNREGTP" },
140 { 0xd1, "F_SAP_ACCPTP" },
141 { 0xd2, "F_SAP_UNACCPTP" },
142 { 0xd3, "F_SAP_CANCTP" },
143 { 0xd4, "F_SAP_SET_UID" },
144 { 0xd5, "F_SAP_CANCEL" },
145 { 0xd6, "F_SAP_CANCELED" },
146 /* NULL */
147 { 0x00, NULL((void*)0) }
148};
149
150
151/* SAP RFC APPC Header Protocol field values */
152static const value_string saprfc_header_protocol_values[] = {
153 { 0x00, "R2PR" },
154 { 0x01, "INT" },
155 { 0x02, "EXT" },
156 { 0x03, "CPIC" },
157 { 0x05, "NE" },
158 { 0x06, "REG" },
159 { 0x42, "CPIC" },
160 { 0x44, "EXT" },
161 { 0x45, "NE" },
162 { 0x48, "INT" },
163 { 0x61, "REG" },
164 /* NULL */
165 { 0x00, NULL((void*)0) }
166};
167
168/* SAP RFC APPC Header APPC Return Code field values */
169static const value_string saprfc_header_appc_rc_values[] = {
170 { 0x00, "CM_OK" },
171 { 0x01, "CM_ALLOCATE_FAILURE_NO_RETRY" },
172 { 0x02, "CM_ALLOCATE_FAILURE_RETRY" },
173 { 0x03, "CM_CONVERSATION_TYPE_MISMATCH" },
174 { 0x06, "CM_SECURITY_NOT_VALID" },
175 { 0x08, "CM_SYNC_LVL_NOT_SUPPORTED_PGM" },
176 { 0x09, "CM_TPN_NOT_RECOGNIZED" },
177 { 0x0a, "CM_TP_NOT_AVAILABLE_NO_RETRY" },
178 { 0x0b, "CM_TP_NOT_AVAILABLE_RETRY" },
179 { 0x11, "CM_DEALLOCATED_ABEND" },
180 { 0x12, "CM_DEALLOCATED_NORMAL" },
181 { 0x13, "CM_PARAMETER_ERROR" },
182 { 0x14, "CM_PRODUCT_SPECIFIC_ERROR" },
183 { 0x15, "CM_PROGRAM_ERROR_NO_TRUNC" },
184 { 0x16, "CM_PROGRAM_ERROR_PURGING" },
185 { 0x17, "CM_PROGRAM_ERROR_TRUNC" },
186 { 0x18, "CM_PROGRAM_PARAMETER_CHECK" },
187 { 0x19, "CM_PROGRAM_STATE_CHECK" },
188 { 0x1a, "CM_RESOURCE_FAILURE_NO_RETRY" },
189 { 0x1b, "CM_RESOURCE_FAILURE_RETRY" },
190 { 0x1c, "CM_UNSUCCESSFUL" },
191 { 0x23, "CM_OPERATION_INCOMPLETE" },
192 { 0x24, "CM_SYSTEM_EVENT" },
193 { 0x2711, "CM_SAP_TIMEOUT_RETRY" },
194 { 0x2712, "CM_CANCEL_REQUEST" },
195 /* NULL */
196 { 0x00, NULL((void*)0) }
197};
198
199/* SAP RFC APPC Header MCPIC Parameters Client Info values */
200static const value_string saprfc_header_ncpic_parameters_client_info_values[] = {
201 { 0x00, "GW_NO_CLIENT_INFO" },
202 { 0x01, "GW_EXTERNAL_CLIENT" },
203 { 0x02, "GW_R3_CLIENT" },
204 /* NULL */
205 { 0x00, NULL((void*)0) }
206};
207
208/* ABAP/4 data types, taken from RFC SDK's saprfc.h */
209#define TYPC0 0
210#define TYPDATE1 1
211#define TYPP2 2
212#define TYPTIME3 3
213#define TYPX4 4
214#define TYPTABH5 5
215#define TYPNUM6 6
216#define TYPFLOAT7 7
217#define TYPINT8 8
218#define TYPINT29 9
219#define TYPINT110 10
220/* TYPW = 11 */
221#define TYP112 12
222#define TYP213 13
223#define TYPDECF1623 23 /* IEEE 754r decimal floating point 8 bytes */
224#define TYPDECF3424 24 /* IEEE 754r decimal floating point 16 bytes */
225
226static const value_string abap_types_typename_values[] = {
227 { TYPC0, "CHAR" },
228 { TYPDATE1, "DATS" },
229 { TYPP2, "BCD" },
230 { TYPTIME3, "TIMS" },
231 { TYPX4, "RAW" },
232 { TYPTABH5, "ITAB" },
233 { TYPNUM6, "NUMC" },
234 { TYPFLOAT7, "FLTP" },
235 { TYPINT8, "INT" },
236 { TYPINT29, "INT2" },
237 { TYPINT110, "INT1" },
238 { TYP112, "DATE_1" },
239 { TYP213, "DATE_2" },
240 { TYPDECF1623, "DECF16" },
241 { TYPDECF3424, "DECF34" },
242 /* NULL */
243 { 0x00, NULL((void*)0) }
244};
245
246/* SAP RFC Accept Info Flag values */
247#define SAPRFC_ACCEPT_INFO_EINFO0x01 0x01
248#define SAPRFC_ACCEPT_INFO_PING0x02 0x02
249#define SAPRFC_ACCEPT_INFO_SNC0x04 0x04
250#define SAPRFC_ACCEPT_INFO_CONN_EINFO0x08 0x08
251#define SAPRFC_ACCEPT_INFO_CODE_PAGE0x10 0x10
252#define SAPRFC_ACCEPT_INFO_NIPING0x20 0x20
253#define SAPRFC_ACCEPT_INFO_EXTINITOPT0x40 0x40
254#define SAPRFC_ACCEPT_INFO_GW_ACCEPT_DIST_TRACE0x80 0x80
255
256/* SAP RFC APPC Header Info Flags values */
257#define SAPRFC_APPCHDR_INFO1_SYNC_CPIC_FUNCTION0x01 0x01
258#define SAPRFC_APPCHDR_INFO1_WITH_HOSTADDR0x02 0x02
259#define SAPRFC_APPCHDR_INFO1_WITH_GW_SAP_PARAMS_HDR0x04 0x04
260#define SAPRFC_APPCHDR_INFO1_CPIC_SYNC_REQ0x08 0x08
261#define SAPRFC_APPCHDR_INFO1_WITH_ERR_INFO0x10 0x10
262#define SAPRFC_APPCHDR_INFO1_DATA_WITH_TERM_OUTPUT0x20 0x20
263#define SAPRFC_APPCHDR_INFO1_DATA_WITH_TERM_INPUT0x40 0x40
264#define SAPRFC_APPCHDR_INFO1_R3_CPIC_LOGIN_WITH_TERM0x80 0x80
265
266#define SAPRFC_APPCHDR_INFO2_WITH_LONG_LU_NAME0x01 0x01
267#define SAPRFC_APPCHDR_INFO2_WITH_LONG_HOSTADDR0x02 0x02
268#define SAPRFC_APPCHDR_INFO2_GW_IMMEDIATE0x04 0x04
269#define SAPRFC_APPCHDR_INFO2_GW_SNC_ACTIVE0x08 0x08
270#define SAPRFC_APPCHDR_INFO2_GW_WAIT_LOOK_UP0x10 0x10
271#define SAPRFC_APPCHDR_INFO2_SNC_INIT_PHASE0x20 0x20
272#define SAPRFC_APPCHDR_INFO2_GW_STATELESS0x40 0x40
273#define SAPRFC_APPCHDR_INFO2_GW_NO_STATE_CHECK0x80 0x80
274
275#define SAPRFC_APPCHDR_INFO3_GW_WITH_CODE_PAGE0x01 0x01
276#define SAPRFC_APPCHDR_INFO3_GW_ASYNC_RFC0x02 0x02
277#define SAPRFC_APPCHDR_INFO3_GW_CANCEL_HARD0x04 0x04
278#define SAPRFC_APPCHDR_INFO3_GW_CANCEL_SOFT0x08 0x08
279#define SAPRFC_APPCHDR_INFO3_GW_WITH_GUI_TIMEOUT0x10 0x10
280#define SAPRFC_APPCHDR_INFO3_GW_TERMIO_ERROR0x20 0x20
281#define SAPRFC_APPCHDR_INFO3_GW_EXTENDED_INIT_OPTIONS0x40 0x40
282#define SAPRFC_APPCHDR_INFO3_GW_DIST_TRACE0x80 0x80
283
284#define SAPRFC_APPCHDR_INFO4_GW_WITH_DBG_CTL0x01 0x01
285
286/* SAP RFC APPC Header Request Type 2 Flags values */
287#define SAPRFC_APPCHDR_REQTYPE2_F_V_INITIALIZE_CONVERSATION0x01 0x01
288#define SAPRFC_APPCHDR_REQTYPE2_F_V_ALLOCATE0x02 0x02
289#define SAPRFC_APPCHDR_REQTYPE2_F_V_SEND_DATA0x04 0x04
290#define SAPRFC_APPCHDR_REQTYPE2_F_V_RECEIVE0x08 0x08
291#define SAPRFC_APPCHDR_REQTYPE2_F_V_FLUSH0x10 0x10
292
293
294static int proto_saprfc;
295
296static int hf_saprfc_version;
297static int hf_saprfc_reqtype;
298static int hf_saprfc_address;
299static int hf_saprfc_service;
300static int hf_saprfc_codepage;
301static int hf_saprfc_lu;
302static int hf_saprfc_tp;
303static int hf_saprfc_conversation_id;
304static int hf_saprfc_appc_header_version;
305static int hf_saprfc_accept_info; /* (EINFO PING CONN_EINFO EXTINITOPT GW_ACCEPT_DIST_TRACE (0xCB)) */
306static int hf_saprfc_accept_info_EINFO;
307static int hf_saprfc_accept_info_PING;
308static int hf_saprfc_accept_info_SNC;
309static int hf_saprfc_accept_info_CONN_EINFO;
310static int hf_saprfc_accept_info_CODE_PAGE;
311static int hf_saprfc_accept_info_NIPING;
312static int hf_saprfc_accept_info_EXTINITOPT;
313static int hf_saprfc_accept_info_GW_ACCEPT_DIST_TRACE;
314static int hf_saprfc_idx;
315static int hf_saprfc_address6;
316static int hf_saprfc_rc;
317static int hf_saprfc_echo_data;
318static int hf_saprfc_filler;
319
320static int hf_saprfc_monitor_cmd;
321
322static int hf_saprfc_header;
323static int hf_saprfc_header_version;
324static int hf_saprfc_header_reqtype;
325static int hf_saprfc_header_protocol;
326static int hf_saprfc_header_mode;
327static int hf_saprfc_header_uid;
328static int hf_saprfc_header_gw_id;
329static int hf_saprfc_header_err_len;
330static int hf_saprfc_header_info2;
331static int hf_saprfc_header_info2_WITH_LONG_LU_NAME;
332static int hf_saprfc_header_info2_WITH_LONG_HOSTADDR;
333static int hf_saprfc_header_info2_GW_IMMEDIATE;
334static int hf_saprfc_header_info2_GW_SNC_ACTIVE;
335static int hf_saprfc_header_info2_GW_WAIT_LOOK_UP;
336static int hf_saprfc_header_info2_SNC_INIT_PHASE;
337static int hf_saprfc_header_info2_GW_STATELESS;
338static int hf_saprfc_header_info2_GW_NO_STATE_CHECK;
339static int hf_saprfc_header_trace_level;
340static int hf_saprfc_header_time;
341static int hf_saprfc_header_info3;
342static int hf_saprfc_header_info3_GW_WITH_CODE_PAGE;
343static int hf_saprfc_header_info3_GW_ASYNC_RFC;
344static int hf_saprfc_header_info3_GW_CANCEL_HARD;
345static int hf_saprfc_header_info3_GW_CANCEL_SOFT;
346static int hf_saprfc_header_info3_GW_WITH_GUI_TIMEOUT;
347static int hf_saprfc_header_info3_GW_TERMIO_ERROR;
348static int hf_saprfc_header_info3_GW_EXTENDED_INIT_OPTIONS;
349static int hf_saprfc_header_info3_GW_DIST_TRACE;
350static int hf_saprfc_header_timeout;
351static int hf_saprfc_header_info4;
352static int hf_saprfc_header_info4_GW_WITH_DBG_CTL;
353static int hf_saprfc_header_sequence_no;
354static int hf_saprfc_header_sap_params_len;
355static int hf_saprfc_header_info;
356static int hf_saprfc_header_info_SYNC_CPIC_FUNCTION;
357static int hf_saprfc_header_info_WITH_HOSTADDR;
358static int hf_saprfc_header_info_WITH_GW_SAP_PARAMS_HDR;
359static int hf_saprfc_header_info_CPIC_SYNC_REQ;
360static int hf_saprfc_header_info_WITH_ERR_INFO;
361static int hf_saprfc_header_info_DATA_WITH_TERM_OUTPUT;
362static int hf_saprfc_header_info_DATA_WITH_TERM_INPUT;
363static int hf_saprfc_header_info_R3_CPIC_LOGIN_WITH_TERM;
364static int hf_saprfc_header_reqtype2;
365static int hf_saprfc_header_reqtype2_F_V_INITIALIZE_CONVERSATION;
366static int hf_saprfc_header_reqtype2_F_V_ALLOCATE;
367static int hf_saprfc_header_reqtype2_F_V_SEND_DATA;
368static int hf_saprfc_header_reqtype2_F_V_RECEIVE;
369static int hf_saprfc_header_reqtype2_F_V_FLUSH;
370static int hf_saprfc_header_appc_rc;
371static int hf_saprfc_header_sap_rc; /* TODO: Add SAP Return values */
372static int hf_saprfc_header_conversation_id;
373static int hf_saprfc_header_ncpic_parameters;
374static int hf_saprfc_header_ncpic_parameters_sdest;
375static int hf_saprfc_header_ncpic_parameters_lu;
376static int hf_saprfc_header_ncpic_parameters_tp;
377static int hf_saprfc_header_ncpic_parameters_ctype;
378static int hf_saprfc_header_ncpic_parameters_client_info;
379static int hf_saprfc_header_ncpic_parameters_lu_name;
380static int hf_saprfc_header_ncpic_parameters_lu_name_length;
381static int hf_saprfc_header_ncpic_parameters_host_address;
382static int hf_saprfc_header_ncpic_parameters_security_password;
383static int hf_saprfc_header_ncpic_parameters_security_password_length;
384
385static int hf_saprfc_header_comm_idx;
386static int hf_saprfc_header_conn_idx;
387
388static int hf_saprfc_item;
389static int hf_saprfc_item_id1;
390static int hf_saprfc_item_id2;
391static int hf_saprfc_item_length;
392static int hf_saprfc_item_value;
393
394static int hf_saprfc_table;
395static int hf_saprfc_table_structure;
396static int hf_saprfc_table_structure_field;
397static int hf_saprfc_table_structure_field_type;
398static int hf_saprfc_table_structure_field_length;
399static int hf_saprfc_table_row;
400static int hf_saprfc_table_row_field;
401static int hf_saprfc_table_length;
402static int hf_saprfc_table_compress_header;
403static int hf_saprfc_table_uncomplength;
404static int hf_saprfc_table_algorithm;
405static int hf_saprfc_table_magic;
406static int hf_saprfc_table_special;
407static int hf_saprfc_table_return_code;
408static int hf_saprfc_table_content;
409
410static int hf_saprfc_payload;
411
412
413/* TODO: Add CPIC error codes (https://launchpad.support.sap.com/#/notes/63347) */
414/* TODO: Add RFC logon error codes (https://launchpad.support.sap.com/#/notes/320991) */
415
416static int ett_saprfc;
417
418/* Expert info */
419static expert_field ei_saprfc_invalid_decompression;
420static expert_field ei_saprfc_invalid_decompress_length;
421static expert_field ei_saprfc_invalid_table_length;
422static expert_field ei_saprfc_item_length_invalid;
423static expert_field ei_saprfc_unknown_item;
424static expert_field ei_saprfc_short_appc_header;
425
426
427/* Global decompress preference */
428static bool_Bool global_saprfc_decompress = true1;
429static unsigned global_saprfc_max_uncompressed_size = SAPRFC_DEFAULT_MAX_UNCOMPRESSED_SIZE(16U * 1024U * 1024U);
430
431/* Global table reassembling preference */
432static bool_Bool global_saprfc_table_reassembly = true1;
433static unsigned global_saprfc_max_reassembled_size = SAPRFC_DEFAULT_MAX_REASSEMBLED_SIZE(16U * 1024U * 1024U);
434
435/* Global highlight preference */
436static bool_Bool global_saprfc_highlight_items = true1;
437
438/* Protocol handles for both external and internal dissectors */
439static dissector_handle_t saprfc_handle;
440static dissector_handle_t saprfcinternal_handle;
441
442/* Keeps track of table content items */
443static uint32_t global_saprfc_table_content_counter = 0;
444
445
446void proto_register_saprfc(void);
447void proto_reg_handoff_saprfc(void);
448
449
450static bool_Bool
451check_saprfc_compression(tvbuff_t *tvb, uint32_t offset)
452{
453 /* We check for the length, the algorithm value and the presence of magic bytes */
454 if ((tvb_captured_length_remaining(tvb, offset) >= 8) &&
455 ((tvb_get_uint8(tvb, offset+4) == 0x11) || (tvb_get_uint8(tvb, offset+4) == 0x12)) &&
456 (tvb_get_uint16(tvb, offset+5, ENC_LITTLE_ENDIAN0x80000000) == 0x9d1f)){
457 return true1;
458 }
459 return false0;
460}
461
462
463static void
464dissect_saprfc_tables_compressed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
465
466 int rt = 0;
467 int compressed_length;
468 uint32_t offset = 0;
469 uint32_t reported_length = 0;
470 uint32_t uncompress_length = 0;
471 uint32_t table_offset = 0;
472 tvbuff_t *decompressed_tvb = NULL((void*)0);
473 const uint8_t *compressed_buffer = NULL((void*)0);
474 uint8_t *decompressed_buffer = NULL((void*)0);
475
476 proto_item *compression_header = NULL((void*)0);
477 proto_tree *compression_header_tree = NULL((void*)0);
478 proto_item *decompress_return_code = NULL((void*)0);
479 proto_item *rl = NULL((void*)0);
480
481 /* Skip the table prefix preceding the compression header. */
482 offset = SAPRFC_TABLE_PREFIX_LENGTH8U;
483
484 /* Add the compression header subtree */
485 compression_header = proto_tree_add_item(tree, hf_saprfc_table_compress_header, tvb, offset, 8, ENC_NA0x00000000);
486 compression_header_tree = proto_item_add_subtree(compression_header, ett_saprfc);
487
488 table_offset = offset;
489
490 /* Add the uncompressed length */
491 reported_length = tvb_get_letohl(tvb, offset);
492 rl = proto_tree_add_uint(compression_header_tree, hf_saprfc_table_uncomplength, tvb, offset, 4, reported_length);
493 offset += 4;
494 proto_item_append_text(compression_header, ", Uncompressed Len: %u", reported_length);
495 col_append_fstr(pinfo->cinfo, COL_INFO, " Uncompressed Length=%u ", reported_length);
496
497 /* Add the algorithm */
498 proto_tree_add_item(compression_header_tree, hf_saprfc_table_algorithm, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
499 offset++;
500 /* Add the magic bytes */
501 proto_tree_add_item(compression_header_tree, hf_saprfc_table_magic, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
502 offset += 2;
503 /* Add the max bits */
504 proto_tree_add_item(compression_header_tree, hf_saprfc_table_special, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
505 offset++;
506
507 if (global_saprfc_decompress){
508 if (reported_length == 0 || reported_length > global_saprfc_max_uncompressed_size) {
509 expert_add_info_format(pinfo, rl, &ei_saprfc_invalid_decompress_length,
510 "Reported uncompressed payload length %u is invalid or exceeds the configured maximum of %u bytes",
511 reported_length, global_saprfc_max_uncompressed_size);
512 } else {
513 compressed_length = tvb_captured_length_remaining(tvb, table_offset);
514 compressed_buffer = tvb_get_ptr(tvb, table_offset, compressed_length);
515 decompressed_buffer = (uint8_t *)wmem_alloc0(pinfo->pool, reported_length);
516 uncompress_length = reported_length;
517
518 rt = sap_lzclzh_decompress(pinfo->pool, compressed_buffer,
519 compressed_length, decompressed_buffer, &uncompress_length);
520
521 decompress_return_code = proto_tree_add_int_format_value(compression_header_tree,
522 hf_saprfc_table_return_code, tvb, table_offset, 0, rt,
523 "%d (%s)", rt, sap_lzclzh_decompress_error_string(rt));
524 proto_item_set_generated(decompress_return_code);
525
526 if (rt != CS_END_OF_STREAM1) {
527 expert_add_info_format(pinfo, compression_header, &ei_saprfc_invalid_decompression,
528 "Decompression of table failed with return code %d (%s)",
529 rt, sap_lzclzh_decompress_error_string(rt));
530 } else {
531 if (uncompress_length != reported_length) {
532 expert_add_info_format(pinfo, rl, &ei_saprfc_invalid_decompress_length,
533 "The uncompressed table length (%u) differs from the reported length (%u)",
534 uncompress_length, reported_length);
535 }
536
537 decompressed_tvb = tvb_new_child_real_data(tvb, decompressed_buffer,
538 uncompress_length, uncompress_length);
539 add_new_data_source(pinfo, decompressed_tvb, "Uncompressed Table Data");
540
541 /* Add the table subtree using the new tvb. */
542 proto_tree_add_item(tree, hf_saprfc_table_content, decompressed_tvb, 0, -1, ENC_NA0x00000000);
543
544 /* TODO: Dissect SAP RFC Table content */
545 return;
546 }
547 }
548 }
549
550 /* Add the payload subtree */
551 proto_tree_add_item(tree, hf_saprfc_table_content, tvb, offset, -1, ENC_NA0x00000000);
552}
553
554static void
555dissect_saprfc_tables(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset, uint16_t item_length){
556
557 uint8_t *reassemble_buffer = NULL((void*)0), *table_name = NULL((void*)0);
558 uint16_t next_item = 0;
559 uint32_t reassemble_length = 0, reassemble_offset = 0, initial_offset = 0;
560
561 proto_item *table = NULL((void*)0);
562 proto_tree *table_tree = NULL((void*)0);
563 tvbuff_t *compressed_tvb = NULL((void*)0);
564
565 /* Skip table line structure */
566 if (tvb_captured_length_remaining(tvb, offset) < item_length + 6U){
567 expert_add_info(pinfo, tree, &ei_saprfc_invalid_table_length);
568 return;
569 }
570 offset += item_length + 2;
571
572 next_item = tvb_get_ntohs(tvb, offset);
573 offset+=2;
574 if (next_item != 0x0301){
575 return;
576 }
577
578 item_length = tvb_get_ntohs(tvb, offset);
579 offset += 2;
580 if (tvb_captured_length_remaining(tvb, offset) < item_length + 6U){
581 expert_add_info(pinfo, tree, &ei_saprfc_invalid_table_length);
582 return;
583 }
584 table_name = tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000);
585 offset += item_length;
586 offset += 2;
587
588 next_item = tvb_get_ntohs(tvb, offset);
589 offset += 2;
590 if (next_item != 0x0302){
591 return;
592 }
593
594 item_length = tvb_get_ntohs(tvb, offset);
595 offset += 2;
596 if (item_length < 8 || tvb_captured_length_remaining(tvb, offset) < item_length + 6U){
597 expert_add_info(pinfo, tree, &ei_saprfc_invalid_table_length);
598 return;
599 }
600 /* Row width and count are currently not dissected, but are part of the fixed header. */
601 tvb_get_ntohl(tvb, offset);
602 offset += 4;
603 tvb_get_ntohl(tvb, offset);
604 offset += 4;
605 offset += (item_length - 8) + 2;
606
607 next_item = tvb_get_ntohs(tvb, offset);
608 offset += 2;
609 if (next_item != 0x0305){
610 return;
611 }
612
613 item_length = tvb_get_ntohs(tvb, offset);
614 offset += 2;
615 if (item_length < SAPRFC_TABLE_PREFIX_LENGTH8U ||
616 tvb_captured_length_remaining(tvb, offset) < SAPRFC_TABLE_PREFIX_LENGTH8U){
617 expert_add_info(pinfo, tree, &ei_saprfc_invalid_table_length);
618 return;
619 }
620
621 /* Get the reassemble length */
622 initial_offset = offset;
623 reassemble_length = tvb_get_ntohl(tvb, offset + 4);
624 if (reassemble_length < SAPRFC_TABLE_PREFIX_LENGTH8U ||
625 reassemble_length > global_saprfc_max_reassembled_size){
626 expert_add_info_format(pinfo, tree, &ei_saprfc_invalid_table_length,
627 "Reported reassembled table length %u is invalid or exceeds the configured maximum of %u bytes",
628 reassemble_length, global_saprfc_max_reassembled_size);
629 return;
630 }
631 if (item_length > (reassemble_length - reassemble_offset)){
632 item_length = reassemble_length - reassemble_offset;
633 }
634
635 /* Allocate the buffer only in the scope of current packet */
636 reassemble_buffer = (uint8_t *)wmem_alloc(pinfo->pool, reassemble_length);
637 if (!reassemble_buffer){
638 return;
639 }
640
641 /* Reassemble the table content, retaining the actual captured length. */
642 while (reassemble_offset < reassemble_length){
643 if (tvb_captured_length_remaining(tvb, offset) < item_length){
644 break;
645 }
646 tvb_memcpy(tvb, reassemble_buffer + reassemble_offset, offset, item_length);
647 offset += item_length;
648 reassemble_offset += item_length;
649 if (reassemble_offset == reassemble_length){
650 break;
651 }
652
653 /* Skip the closing marker and read the next item identifier. */
654 if (tvb_captured_length_remaining(tvb, offset) < 4){
655 break;
656 }
657 offset += 2;
658 next_item = tvb_get_ntohs(tvb, offset);
659 offset+=2;
660 if (next_item == 0x0305){
661 if (tvb_captured_length_remaining(tvb, offset) < 2){
662 break;
663 }
664 item_length = tvb_get_ntohs(tvb, offset);
665 offset+=2;
666
667 if (item_length > (reassemble_length - reassemble_offset)){
668 item_length = reassemble_length - reassemble_offset;
669 }
670
671 /* If the table content doesn't continue, we've completed */
672 } else {
673 break;
674 }
675 }
676
677 /* Expose only bytes actually copied; retain the declared length as reported length. */
678 compressed_tvb = tvb_new_child_real_data(tvb, reassemble_buffer, reassemble_offset, reassemble_length);
679
680 /* Add the Table subtree */
681 table = proto_tree_add_item(tree, hf_saprfc_table, tvb, initial_offset, offset - initial_offset, ENC_NA0x00000000);
682 table_tree = proto_item_add_subtree(table, ett_saprfc);
683
684 proto_item_append_text(table, ", Name=%s", table_name);
685
686 /* Only complete tables can safely be passed to the decompressor. */
687 if (reassemble_offset == reassemble_length &&
688 check_saprfc_compression(compressed_tvb, SAPRFC_TABLE_PREFIX_LENGTH8U)) {
689 dissect_saprfc_tables_compressed(compressed_tvb, pinfo, table_tree);
690 } else {
691 proto_tree_add_item(table_tree, hf_saprfc_table_content, compressed_tvb,
692 SAPRFC_TABLE_PREFIX_LENGTH8U, -1, ENC_NA0x00000000);
693 if (reassemble_offset != reassemble_length){
694 expert_add_info_format(pinfo, table, &ei_saprfc_invalid_table_length,
695 "Reassembled table contains %u of %u reported bytes",
696 reassemble_offset, reassemble_length);
697 }
698 }
699
700}
701
702static void
703dissect_saprfc_item(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, proto_tree *item_value_tree, uint32_t offset, uint8_t item_id1, uint8_t item_id2, uint16_t item_length){
704
705 if (item_id1==0x01 && item_id2==0x02){
706 const char *value_str = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000);
707 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Function Name: %s", value_str);
708 proto_item_append_text(item, ", Function Name=%s", value_str);
709
710 } else if (item_id1==0x02 && item_id2==0x01){
711 const char *value_str = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000);
712 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Import Parameter Name: %s", value_str);
713 proto_item_append_text(item, ", Import Parameter Name=%s", value_str);
714
715 } else if (item_id1==0x02 && item_id2==0x05){
716 const char *value_str = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000);
717 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Export Parameter Name: %s", value_str);
718 proto_item_append_text(item, ", Export Parameter Name=%s", value_str);
719
720 } else if (item_id1==0x02 && item_id2==0x13){
721 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Type Structure A");
722
723 } else if (item_id1==0x03 && item_id2==0x01){
724 const char *value_str = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000);
725 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Table Name: %s", value_str);
726 proto_item_append_text(item, ", Table Name=%s", value_str);
727
728 } else if (item_id1==0x03 && item_id2==0x02){
729 uint32_t value_uint32;
730
731 if (item_length != 8) {
732 expert_add_info_format(pinfo, item_value_tree, &ei_saprfc_item_length_invalid, "Table Info length is invalid");
733 }
734 value_uint32 = tvb_get_ntohl(tvb, offset);
735 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 4, "Row Width: %d", value_uint32);
736 proto_item_append_text(item, ", Row Width=%d", value_uint32);
737 offset+=4;
738 value_uint32 = tvb_get_ntohl(tvb, offset);
739 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 4, "Total Row Count: %d", value_uint32);
740 proto_item_append_text(item, ", Total Row Count=%d", value_uint32);
741
742 } else if (item_id1==0x03 && item_id2==0x05){
743 global_saprfc_table_content_counter+= 1;
744 if (global_saprfc_table_content_counter==1){
745 offset += 4; /* Skip the first 4 bytes */
746 proto_tree_add_item(item_value_tree, hf_saprfc_table_length, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
747 offset += 4;
748 }
749
750 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Table Content LZ");
751
752 if (global_saprfc_table_content_counter==1){
753 proto_item_append_text(item, ", Table Content LZ (first)");
754 } else {
755 proto_item_append_text(item, ", Table Content LZ");
756 }
757
758 } else if (item_id1==0x03 && item_id2==0x06){
759 global_saprfc_table_content_counter = 0;
760 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Table Content End");
761 proto_item_append_text(item, ", Table Content End");
762
763 } else if (item_id1==0x01 && item_id2==0x36){
764 const char *value_str;
765 uint8_t value_uint8;
766 uint32_t value_uint32;
767
768 value_uint8 = tvb_get_uint8(tvb, offset);
769 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 1, "#: %u", value_uint8);
770 proto_item_append_text(item, ", #=%u", value_uint8);
771 offset+=1;
772 value_str = tvb_bytes_to_str(pinfo->pool, tvb, offset, 16);
773 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 16, "Root-id: %s", value_str);
774 proto_item_append_text(item, ", Root-id=%s", value_str);
775 offset+=16;
776 value_str = tvb_bytes_to_str(pinfo->pool, tvb, offset, 16);
777 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 16, "Coon-id: %s", value_str);
778 proto_item_append_text(item, ", Coon-id=%s", value_str);
779 offset+=16;
780 value_uint32 = tvb_get_ntohl(tvb, offset);
781 proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 4, "#: %d", value_uint32);
782 proto_item_append_text(item, ", #=%u", value_uint32);
783
784 } else if (item_id1==0xFF && item_id2==0xFF){
785 proto_item_append_text(item, ", End of RFC message");
786
787 } else {
788 /* If the preference is set, report the item as unknown in the expert info */
789 if (global_saprfc_highlight_items){
790 expert_add_info_format(pinfo, item, &ei_saprfc_unknown_item, "The RFC item has a unknown type that is not dissected (%u %u)", item_id1, item_id2);
791 }
792 }
793}
794
795static void
796dissect_saprfc_payload(tvbuff_t *tvb, packet_info *info, proto_tree *tree, proto_tree *parent_tree, uint32_t offset){
797
798 uint8_t item_id1, item_id2;
799 uint16_t item_value_length;
800 uint32_t item_length;
801 int remaining_length;
802 unsigned reported_remaining_length;
803 tvbuff_t *item_value_tvb = NULL((void*)0);
804
805 proto_item *item = NULL((void*)0), *item_value = NULL((void*)0);
806 proto_tree *item_tree = NULL((void*)0), *item_value_tree = NULL((void*)0);
807
808 while (tvb_reported_length_remaining(tvb, offset) > 0){
809 item_length = 0;
810 item_value_length = 0;
Value stored to 'item_value_length' is never read
811 item_id2 = 0;
812
813 /* Add the item subtree. We start with a item's length of 1, as we don't have yet the real size of the item */
814 item = proto_tree_add_item(tree, hf_saprfc_item, tvb, offset, 1, ENC_NA0x00000000);
815 item_tree = proto_item_add_subtree(item, ett_saprfc);
816
817 /* Get the first identifier */
818 proto_tree_add_item_ret_uint8(item_tree, hf_saprfc_item_id1, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &item_id1);
819 offset += 1;
820 item_length += 1;
821 proto_item_append_text(item, ": (0x%.2x)", item_id1);
822
823 /* Check if it's an End of message */
824 if (item_id1==0x0c){
825 break; /* ? */
826
827 /* Otherwise follow dissection */
828 } else {
829 /* ID2 and the two-byte value length must be present. */
830 if (tvb_reported_length_remaining(tvb, offset) < 3 ||
831 tvb_captured_length_remaining(tvb, offset) < 3){
832 expert_add_info(info, item, &ei_saprfc_item_length_invalid);
833 return;
834 }
835
836 proto_tree_add_item_ret_uint8(item_tree, hf_saprfc_item_id2, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &item_id2);
837 offset += 1;
838 item_length += 1;
839 proto_item_append_text(item, ", (0x%.2x)", item_id2);
840
841 item_value_length = tvb_get_ntohs(tvb, offset);
842 proto_tree_add_item(item_tree, hf_saprfc_item_length, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
843 offset += 2;
844 item_length += 2;
845 proto_item_append_text(item, ", Length=%d", item_value_length);
846 }
847
848 /* Every regular item includes its value followed by repeated ID markers. */
849 remaining_length = tvb_captured_length_remaining(tvb, offset);
850 reported_remaining_length = tvb_reported_length_remaining(tvb, offset);
851 if (remaining_length < 0 || (uint32_t)remaining_length < (uint32_t)item_value_length + 2U ||
852 reported_remaining_length < (uint32_t)item_value_length + 2U){
853 expert_add_info(info, item, &ei_saprfc_item_length_invalid);
854 if (remaining_length > 0){
855 proto_tree_add_item(item_tree, hf_saprfc_item_value, tvb, offset, remaining_length, ENC_NA0x00000000);
856 }
857 return;
858 }
859
860 /* Now we have the real length of the item, set the proper size */
861 item_length += item_value_length;
862 proto_item_set_len(item, item_length);
863
864 item_value = proto_tree_add_item(item_tree, hf_saprfc_item_value, tvb, offset, item_value_length, ENC_NA0x00000000);
865 item_value_tree = proto_item_add_subtree(item_value, ett_saprfc);
866 item_value_tvb = tvb_new_subset_length(tvb, offset, item_value_length);
867 dissect_saprfc_item(item_value_tvb, info, item, item_value_tree, 0, item_id1, item_id2, item_value_length);
868
869 /* Also send the tables items for reassembling */
870 if (global_saprfc_table_reassembly && item_id1==0x02 && item_id2==0x13){
871 dissect_saprfc_tables(item_value_tvb, info, parent_tree, 0, item_value_length);
872 }
873
874 offset+= item_value_length;
875
876 /* ID1 and ID2 are repeated as closing markers */
877 offset+= 2;
878
879 /* 0xFF 0xFF marks end of RFC message */
880 if (item_id1==0xFF && item_id2==0xFF){
881 break;
882 }
883 }
884
885}
886
887
888static void
889dissect_saprfc_monitor_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint8_t version _U___attribute__((unused)), uint32_t offset){
890 uint8_t opcode;
891
892 opcode = tvb_get_uint8(tvb, offset);
893 col_append_fstr(pinfo->cinfo, COL_INFO, ", Command=%s", val_to_str_const(opcode, saprfc_monitor_cmd_values, "Unknown"));
894
895 proto_tree_add_item(tree, hf_saprfc_monitor_cmd, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
896 //offset+=1;
897 proto_item_append_text(tree, ", Command=%s", val_to_str_const(opcode, saprfc_monitor_cmd_values, "Unknown"));
898
899 // TODO: Dissect RFC monitor command opcodes
900}
901
902
903static void
904dissect_saprfc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset){
905 uint8_t version = 0, reqtype = 0;
906 proto_item *header = NULL((void*)0), *info = NULL((void*)0), *info2 = NULL((void*)0), *info3 = NULL((void*)0), *info4 = NULL((void*)0), *reqtype2 = NULL((void*)0), *params = NULL((void*)0);
907 proto_tree *header_tree = NULL((void*)0), *info_tree = NULL((void*)0), *info2_tree = NULL((void*)0), *info3_tree = NULL((void*)0), *info4_tree = NULL((void*)0), *reqtype2_tree = NULL((void*)0), *params_tree;
908
909 version = tvb_get_uint8(tvb, offset);
910 reqtype = tvb_get_uint8(tvb, offset + 1);
911
912 col_append_fstr(pinfo->cinfo, COL_INFO, "APPC Version=%u, Request Type=%s", version, val_to_str_const(reqtype, saprfc_header_reqtype_values, "Unknown"));
913
914 /* Add the APPC header subtree */
915 header = proto_tree_add_item(tree, hf_saprfc_header, tvb, offset, 28, ENC_NA0x00000000);
916 header_tree = proto_item_add_subtree(header, ett_saprfc);
917
918 proto_item_append_text(header, ", Version=%u, Request Type=%s", version, val_to_str_const(reqtype, saprfc_header_reqtype_values, "Unknown"));
919
920 proto_tree_add_item(header_tree, hf_saprfc_header_version, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
921 offset += 1;
922 proto_tree_add_item(header_tree, hf_saprfc_header_reqtype, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
923 offset += 1;
924 proto_tree_add_item(header_tree, hf_saprfc_header_protocol, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
925 offset += 1;
926 proto_tree_add_item(header_tree, hf_saprfc_header_mode, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
927 offset += 1;
928 proto_tree_add_item(header_tree, hf_saprfc_header_uid, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
929 offset += 2;
930 proto_tree_add_item(header_tree, hf_saprfc_header_gw_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
931 offset += 2;
932 proto_tree_add_item(header_tree, hf_saprfc_header_err_len, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
933 offset += 2;
934
935 info2 = proto_tree_add_item(header_tree, hf_saprfc_header_info2, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
936 info2_tree = proto_item_add_subtree(info2, ett_saprfc);
937 proto_tree_add_item(info2_tree, hf_saprfc_header_info2_WITH_LONG_LU_NAME, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
938 proto_tree_add_item(info2_tree, hf_saprfc_header_info2_WITH_LONG_HOSTADDR, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
939 proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_IMMEDIATE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
940 proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_SNC_ACTIVE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
941 proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_WAIT_LOOK_UP, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
942 proto_tree_add_item(info2_tree, hf_saprfc_header_info2_SNC_INIT_PHASE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
943 proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_STATELESS, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
944 proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_NO_STATE_CHECK, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
945 offset += 1;
946
947 proto_tree_add_item(header_tree, hf_saprfc_header_trace_level, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
948 offset += 1;
949 proto_tree_add_item(header_tree, hf_saprfc_header_time, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
950 offset += 4;
951
952 info3 = proto_tree_add_item(header_tree, hf_saprfc_header_info3, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
953 info3_tree = proto_item_add_subtree(info3, ett_saprfc);
954 proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_WITH_CODE_PAGE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
955 proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_ASYNC_RFC, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
956 proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_CANCEL_HARD, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
957 proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_CANCEL_SOFT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
958 proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_WITH_GUI_TIMEOUT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
959 proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_TERMIO_ERROR, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
960 proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_EXTENDED_INIT_OPTIONS, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
961 proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_DIST_TRACE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
962 offset += 1;
963
964 proto_tree_add_item(header_tree, hf_saprfc_header_timeout, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
965 offset += 4;
966
967 info4 = proto_tree_add_item(header_tree, hf_saprfc_header_info4, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
968 info4_tree = proto_item_add_subtree(info4, ett_saprfc);
969 proto_tree_add_item(info4_tree, hf_saprfc_header_info4_GW_WITH_DBG_CTL, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
970 offset += 1;
971
972 proto_tree_add_item(header_tree, hf_saprfc_header_sequence_no, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
973 offset += 4;
974 proto_tree_add_item(header_tree, hf_saprfc_header_sap_params_len, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
975 offset += 2;
976 offset += 2; /* Skip 2 bytes here */
977
978 info = proto_tree_add_item(header_tree, hf_saprfc_header_info, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
979 info_tree = proto_item_add_subtree(info, ett_saprfc);
980 proto_tree_add_item(info_tree, hf_saprfc_header_info_SYNC_CPIC_FUNCTION, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
981 proto_tree_add_item(info_tree, hf_saprfc_header_info_WITH_HOSTADDR, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
982 proto_tree_add_item(info_tree, hf_saprfc_header_info_WITH_GW_SAP_PARAMS_HDR, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
983 proto_tree_add_item(info_tree, hf_saprfc_header_info_CPIC_SYNC_REQ, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
984 proto_tree_add_item(info_tree, hf_saprfc_header_info_WITH_ERR_INFO, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
985 proto_tree_add_item(info_tree, hf_saprfc_header_info_DATA_WITH_TERM_OUTPUT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
986 proto_tree_add_item(info_tree, hf_saprfc_header_info_DATA_WITH_TERM_INPUT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
987 proto_tree_add_item(info_tree, hf_saprfc_header_info_R3_CPIC_LOGIN_WITH_TERM, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
988 offset += 1;
989
990 reqtype2 = proto_tree_add_item(header_tree, hf_saprfc_header_reqtype2, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
991 reqtype2_tree = proto_item_add_subtree(reqtype2, ett_saprfc);
992 proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_INITIALIZE_CONVERSATION, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
993 proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_ALLOCATE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
994 proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_SEND_DATA, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
995 proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_RECEIVE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
996 proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_FLUSH, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
997 offset += 1;
998
999 proto_tree_add_item(header_tree, hf_saprfc_header_appc_rc, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1000 offset += 4;
1001 proto_tree_add_item(header_tree, hf_saprfc_header_sap_rc, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1002 offset += 4;
1003 proto_tree_add_item(header_tree, hf_saprfc_header_conversation_id, tvb, offset, 8, ENC_ASCII0x00000000);
1004 offset += 8;
1005
1006 /* Dissect the NCPIC Parameters according to the request type */
1007 params = proto_tree_add_item(header_tree, hf_saprfc_header_ncpic_parameters, tvb, offset, 28, ENC_NA0x00000000);
1008 params_tree = proto_item_add_subtree(params, ett_saprfc);
1009 switch (reqtype){
1010 case 0x01:{ /* F_INITIALIZE_CONVERSATION */
1011 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_sdest, tvb, offset, 8, ENC_ASCII0x00000000);
1012 offset += 8;
1013 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_lu, tvb, offset, 8, ENC_ASCII0x00000000);
1014 offset += 8;
1015 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_tp, tvb, offset, 8, ENC_ASCII0x00000000);
1016 offset += 8;
1017 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_ctype, tvb, offset, 1, ENC_ASCII0x00000000);
1018 offset += 1;
1019 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_client_info, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1020 offset += 1;
1021 offset += 2; /* Sum remaining bytes */
1022 break;
1023 }
1024 case 0x0f:{ /* F_SET_PARTNER_LU_NAME */
1025 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_lu_name, tvb, offset, 8, ENC_ASCII0x00000000);
1026 offset += 8;
1027 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_lu_name_length, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1028 offset += 4;
1029 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_host_address, tvb, offset, 16, ENC_NA0x00000000);
1030 offset += 16;
1031 break;
1032 }
1033 case 0x17:{ /* F_SET_SECURITY_TYPE */
1034 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_security_password, tvb, offset, 8, ENC_ASCII0x00000000);
1035 offset += 8;
1036 proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_security_password_length, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1037 offset += 4;
1038 offset += 16; /* Sum remaining bytes */
1039 break;
1040 }
1041 default:{
1042 offset += 28;
1043 }
1044 };
1045
1046 proto_tree_add_item(header_tree, hf_saprfc_header_comm_idx, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1047 offset += 2;
1048 proto_tree_add_item(header_tree, hf_saprfc_header_conn_idx, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1049}
1050
1051static int
1052dissect_saprfc_internal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U___attribute__((unused)))
1053{
1054 uint32_t offset = 0;
1055 proto_item *saprfc, *payload = NULL((void*)0);
1056 proto_tree *saprfc_tree, *payload_tree = NULL((void*)0);
1057
1058 /* Add the main saprfc subtree */
1059 saprfc = proto_tree_add_item(tree, proto_saprfc, tvb, 0, -1, ENC_NA0x00000000);
1060 saprfc_tree = proto_item_add_subtree(saprfc, ett_saprfc);
1061
1062 /* Check the payload length */
1063 if (tvb_reported_length_remaining(tvb, offset) > 0) {
1064 /* Add the payload subtree */
1065 payload = proto_tree_add_item(saprfc_tree, hf_saprfc_payload, tvb, offset, -1, ENC_NA0x00000000);
1066 payload_tree = proto_item_add_subtree(payload, ett_saprfc);
1067
1068 /* Dissect the payload */
1069 dissect_saprfc_payload(tvb, pinfo, payload_tree, saprfc_tree, offset);
1070 }
1071
1072 return tvb_reported_length(tvb);
1073}
1074
1075static int
1076dissect_saprfc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U___attribute__((unused)))
1077{
1078 uint32_t offset = 0;
1079 uint8_t version = 0, req_type = 0;
1080 proto_item *saprfc = NULL((void*)0), *accept_info = NULL((void*)0);
1081 proto_tree *saprfc_tree = NULL((void*)0), *accept_info_tree = NULL((void*)0);
1082
1083 /* Add the protocol to the column */
1084 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SAPRFC");
1085 /* Clear out stuff in the info column */
1086 col_clear(pinfo->cinfo, COL_INFO);
1087
1088 /* Get version and request type values */
1089 if (tvb_reported_length_remaining(tvb, offset) < 2) {
1090 saprfc = proto_tree_add_item(tree, proto_saprfc, tvb, 0, -1, ENC_NA0x00000000);
1091 expert_add_info_format(pinfo, saprfc, &ei_saprfc_item_length_invalid, "SAP RFC header is shorter than 2 bytes");
1092 return tvb_reported_length(tvb);
1093 }
1094 version = tvb_get_uint8(tvb, offset);
1095 req_type = tvb_get_uint8(tvb, offset + 1);
1096
1097 /* Check if the message is valid or it is an APPC header */
1098 /* TODO: We need to find a way of performing this check, as Wireshark is
1099 * state-less seems to be difficult to keep track of the requests/responses.
1100 */
1101 if (version > 0x03){
1102 /* Add the main saprfc subtree */
1103 saprfc = proto_tree_add_item(tree, proto_saprfc, tvb, 0, -1, ENC_NA0x00000000);
1104 saprfc_tree = proto_item_add_subtree(saprfc, ett_saprfc);
1105 if (tvb_reported_length_remaining(tvb, offset) < (int)SAPRFC_APPC_HEADER_LEN96U) {
1106 proto_tree_add_item(saprfc_tree, hf_saprfc_header, tvb, offset, -1, ENC_NA0x00000000);
1107 expert_add_info_format(pinfo, saprfc, &ei_saprfc_short_appc_header, "SAP RFC APPC header is shorter than %u bytes", SAPRFC_APPC_HEADER_LEN96U);
1108 return tvb_reported_length(tvb);
1109 }
1110 dissect_saprfc_header(tvb, pinfo, saprfc_tree, offset);
1111 return tvb_reported_length(tvb);
1112 }
1113
1114 col_append_fstr(pinfo->cinfo, COL_INFO, "Version=%u, Request Type=%s", version, val_to_str_const(req_type, saprfc_reqtype_values, "Unknown"));
1115
1116 /* Add the main saprfc subtree */
1117 saprfc = proto_tree_add_item(tree, proto_saprfc, tvb, 0, -1, ENC_NA0x00000000);
1118 saprfc_tree = proto_item_add_subtree(saprfc, ett_saprfc);
1119
1120 /* Dissect common fields */
1121 proto_tree_add_item(saprfc_tree, hf_saprfc_version, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); offset+=1;
1122 proto_tree_add_item(saprfc_tree, hf_saprfc_reqtype, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); offset+=1;
1123 proto_item_append_text(saprfc_tree, ", Version=%u, Request Type=%s", version, val_to_str_const(req_type, saprfc_reqtype_values, "Unknown"));
1124
1125 /* Dissect the remaining based on the version and request type */
1126 switch (req_type){
1127
1128 case 0x03: /* GW_NORMAL_CLIENT */
1129 case 0x0b:{ /* GW_REGISTER_TP */
1130 unsigned header_len = (version == 0x03) ? SAPRFC_NORMAL_CLIENT_HEADER_LEN_V380U : SAPRFC_NORMAL_CLIENT_HEADER_LEN_V164U;
1131 int remaining = tvb_reported_length_remaining(tvb, 0);
1132 if (remaining < (int)header_len) {
1133 expert_add_info_format(pinfo, saprfc, &ei_saprfc_item_length_invalid, "SAP RFC normal client/register TP header is shorter than %u bytes", header_len);
1134 return tvb_reported_length(tvb);
1135 }
1136 proto_tree_add_item(saprfc_tree, hf_saprfc_address, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1137 offset += 4;
1138 offset += 4; /* Skip 4 bytes here */
1139 proto_tree_add_item(saprfc_tree, hf_saprfc_service, tvb, offset, 10, ENC_ASCII0x00000000);
1140 offset += 10;
1141 proto_tree_add_item(saprfc_tree, hf_saprfc_codepage, tvb, offset, 4, ENC_ASCII0x00000000);
1142 offset += 4;
1143 offset += 6; /* Skip 6 bytes here */
1144 proto_tree_add_item(saprfc_tree, hf_saprfc_lu, tvb, offset, 8, ENC_ASCII0x00000000);
1145 offset += 8;
1146 proto_tree_add_item(saprfc_tree, hf_saprfc_tp, tvb, offset, 8, ENC_ASCII0x00000000);
1147 offset += 8;
1148 proto_tree_add_item(saprfc_tree, hf_saprfc_conversation_id, tvb, offset, 8, ENC_ASCII0x00000000);
1149 offset += 8;
1150 proto_tree_add_item(saprfc_tree, hf_saprfc_appc_header_version, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1151 offset += 1;
1152
1153 accept_info = proto_tree_add_item(saprfc_tree, hf_saprfc_accept_info, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1154 accept_info_tree = proto_item_add_subtree(accept_info, ett_saprfc);
1155 proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_EINFO, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1156 proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_PING, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1157 proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_SNC, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1158 proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_CONN_EINFO, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1159 proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_CODE_PAGE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1160 proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_NIPING, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1161 proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_EXTINITOPT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1162 proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_GW_ACCEPT_DIST_TRACE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1163 offset += 1;
1164
1165 proto_tree_add_item(saprfc_tree, hf_saprfc_idx, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1166 offset += 2;
1167
1168 if (version == 0x03){
1169 proto_tree_add_item(saprfc_tree, hf_saprfc_address6, tvb, offset, 16, ENC_NA0x00000000);
1170 offset += 16;
1171 }
1172
1173 proto_tree_add_item(saprfc_tree, hf_saprfc_rc, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1174 offset += 4;
1175 proto_tree_add_item(saprfc_tree, hf_saprfc_echo_data, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1176 offset += 1;
1177 proto_tree_add_item(saprfc_tree, hf_saprfc_filler, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1178 break;
1179 }
1180 case 0x09:{ /* GW_SEND_CMD */
1181 dissect_saprfc_monitor_cmd(tvb, pinfo, saprfc_tree, version, 2);
1182 break;
1183 }
1184 };
1185
1186 return tvb_reported_length(tvb);
1187}
1188
1189void
1190proto_register_saprfc(void)
1191{
1192 static hf_register_info hf[] = {
1193 { &hf_saprfc_version,
1194 { "Version", "saprfc.version", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Version", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1195 { &hf_saprfc_reqtype,
1196 { "Request Type", "saprfc.reqtype", FT_UINT8, BASE_HEX, VALS(saprfc_reqtype_values)((0 ? (const struct _value_string*)0 : ((saprfc_reqtype_values
))))
, 0x0, "SAP RFC Request Type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1197 { &hf_saprfc_address,
1198 { "IPv4 Address", "saprfc.address", FT_IPv4, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC IPv4 Address", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1199 { &hf_saprfc_service,
1200 { "Service", "saprfc.service", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Service", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1201 { &hf_saprfc_codepage,
1202 { "Codepage", "saprfc.codepage", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Codepage", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1203 { &hf_saprfc_lu,
1204 { "LU", "saprfc.lu", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC LU", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1205 { &hf_saprfc_tp,
1206 { "TP", "saprfc.tp", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC TP", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1207 { &hf_saprfc_conversation_id,
1208 { "Conversation ID", "saprfc.conversation_id", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Conversation ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1209 { &hf_saprfc_appc_header_version,
1210 { "APPC Header Version", "saprfc.appc_hd_version", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Version", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1211 { &hf_saprfc_accept_info,
1212 { "Accept Info Flags", "saprfc.accept_info", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Accept Info Flags", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1213 { &hf_saprfc_accept_info_EINFO,
1214 { "Accept Info Flag EINFO", "saprfc.accept_info.EINFO", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_EINFO0x01, "SAP RFC Accept Info Flag EINFO", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1215 { &hf_saprfc_accept_info_PING,
1216 { "Accept Info Flag PING", "saprfc.accept_info.PING", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_PING0x02, "SAP RFC Accept Info Flag PING", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1217 { &hf_saprfc_accept_info_SNC,
1218 { "Accept Info Flag SNC", "saprfc.accept_info.SNC", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_SNC0x04, "SAP RFC Accept Info Flag SNC", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1219 { &hf_saprfc_accept_info_CONN_EINFO,
1220 { "Accept Info Flag CONN_EINFO", "saprfc.accept_info.CONN_EINFO", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_CONN_EINFO0x08, "SAP RFC Accept Info Flag CONN_EINFO", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1221 { &hf_saprfc_accept_info_CODE_PAGE,
1222 { "Accept Info Flag CODE_PAGE", "saprfc.accept_info.CODE_PAGE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_CODE_PAGE0x10, "SAP RFC Accept Info Flag CODE_PAGE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1223 { &hf_saprfc_accept_info_NIPING,
1224 { "Accept Info Flag NIPING", "saprfc.accept_info.NIPING", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_NIPING0x20, "SAP RFC Accept Info Flag NIPING", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1225 { &hf_saprfc_accept_info_EXTINITOPT,
1226 { "Accept Info Flag EXTINITOPT", "saprfc.accept_info.EXTINITOPT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_EXTINITOPT0x40, "SAP RFC Accept Info Flag EXTINITOPT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1227 { &hf_saprfc_accept_info_GW_ACCEPT_DIST_TRACE,
1228 { "Accept Info Flag GW_ACCEPT_DIST_TRACE", "saprfc.accept_info.GW_ACCEPT_DIST_TRACE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_GW_ACCEPT_DIST_TRACE0x80, "SAP RFC Accept Info Flag GW_ACCEPT_DIST_TRACE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1229 { &hf_saprfc_idx,
1230 { "Index", "saprfc.index", FT_INT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Index", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1231 { &hf_saprfc_address6,
1232 { "IPv6 Address", "saprfc.address6", FT_IPv6, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC IPv6 Address", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1233 { &hf_saprfc_rc,
1234 { "Return Code", "saprfc.rc", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Return Code", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1235 { &hf_saprfc_echo_data,
1236 { "Echo Data", "saprfc.echo_data", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Echo Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1237 { &hf_saprfc_filler,
1238 { "Filler", "saprfc.filler", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Echo Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1239
1240 /* Monitor Commands*/
1241 { &hf_saprfc_monitor_cmd,
1242 { "Command", "saprfc.monitor_cmd", FT_UINT8, BASE_DEC, VALS(saprfc_monitor_cmd_values)((0 ? (const struct _value_string*)0 : ((saprfc_monitor_cmd_values
))))
, 0x0, "SAP RFC Monitor Command", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1243
1244 /* APPC Header */
1245 { &hf_saprfc_header,
1246 { "APPC Header", "saprfc.appcheader", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1247 { &hf_saprfc_header_version,
1248 { "Version", "saprfc.appcheader.version", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Version", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1249 { &hf_saprfc_header_reqtype,
1250 { "Request Type", "saprfc.appcheader.reqtype", FT_UINT8, BASE_HEX, VALS(saprfc_header_reqtype_values)((0 ? (const struct _value_string*)0 : ((saprfc_header_reqtype_values
))))
, 0x0, "SAP RFC APPC Header Request Type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1251 { &hf_saprfc_header_protocol,
1252 { "Protocol", "saprfc.appcheader.protocol", FT_UINT8, BASE_HEX, VALS(saprfc_header_protocol_values)((0 ? (const struct _value_string*)0 : ((saprfc_header_protocol_values
))))
, 0x0, "SAP RFC APPC Header Protocol", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1253 { &hf_saprfc_header_mode,
1254 { "Mode", "saprfc.appcheader.mode", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Mode", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1255 { &hf_saprfc_header_uid,
1256 { "UID", "saprfc.appcheader.uid", FT_INT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header UID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1257 { &hf_saprfc_header_gw_id,
1258 { "Gateway ID", "saprfc.appcheader.gw_id", FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Gateway ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1259 { &hf_saprfc_header_err_len,
1260 { "Error Length", "saprfc.appcheader.err_len", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Error Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1261 { &hf_saprfc_header_info2,
1262 { "Info 2", "saprfc.appcheader.info2", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Info 2", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1263 { &hf_saprfc_header_info2_WITH_LONG_LU_NAME,
1264 { "Info 2 Flag WITH_LONG_LU_NAME", "saprfc.info2.WITH_LONG_LU_NAME", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_WITH_LONG_LU_NAME0x01, "SAP RFC Info 2 Flag WITH_LONG_LU_NAME", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1265 { &hf_saprfc_header_info2_WITH_LONG_HOSTADDR,
1266 { "Info 2 Flag WITH_LONG_HOSTADDR", "saprfc.info2.WITH_LONG_HOSTADDR", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_WITH_LONG_HOSTADDR0x02, "SAP RFC Info 2 Flag WITH_LONG_HOSTADDR", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1267 { &hf_saprfc_header_info2_GW_IMMEDIATE,
1268 { "Info 2 Flag GW_IMMEDIATE", "saprfc.info2.GW_IMMEDIATE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_IMMEDIATE0x04, "SAP RFC Info 2 Flag GW_IMMEDIATE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1269 { &hf_saprfc_header_info2_GW_SNC_ACTIVE,
1270 { "Info 2 Flag GW_SNC_ACTIVE", "saprfc.info2.GW_SNC_ACTIVE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_SNC_ACTIVE0x08, "SAP RFC Info 2 Flag GW_SNC_ACTIVE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1271 { &hf_saprfc_header_info2_GW_WAIT_LOOK_UP,
1272 { "Info 2 Flag GW_WAIT_LOOK_UP", "saprfc.info2.GW_WAIT_LOOK_UP", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_WAIT_LOOK_UP0x10, "SAP RFC Info 2 Flag GW_WAIT_LOOK_UP", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1273 { &hf_saprfc_header_info2_SNC_INIT_PHASE,
1274 { "Info 2 Flag SNC_INIT_PHASE", "saprfc.info2.SNC_INIT_PHASE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_SNC_INIT_PHASE0x20, "SAP RFC Info 2 Flag SNC_INIT_PHASE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1275 { &hf_saprfc_header_info2_GW_STATELESS,
1276 { "Info 2 Flag GW_STATELESS", "saprfc.info2.GW_STATELESS", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_STATELESS0x40, "SAP RFC Info 2 Flag GW_STATELESS", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1277 { &hf_saprfc_header_info2_GW_NO_STATE_CHECK,
1278 { "Info 2 Flag GW_NO_STATE_CHECK", "saprfc.info2.GW_NO_STATE_CHECK", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_NO_STATE_CHECK0x80, "SAP RFC Info 2 Flag GW_NO_STATE_CHECK", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1279 { &hf_saprfc_header_trace_level,
1280 { "Trace Level", "saprfc.appcheader.trace_level", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Trace Level", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1281 { &hf_saprfc_header_time,
1282 { "Time", "saprfc.appcheader.time", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Time", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1283 { &hf_saprfc_header_info3,
1284 { "Info 3", "saprfc.appcheader.info3", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Info 3", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1285 { &hf_saprfc_header_info3_GW_WITH_CODE_PAGE,
1286 { "Info 3 Flag GW_WITH_CODE_PAGE", "saprfc.appcheader.info3.GW_WITH_CODE_PAGE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_WITH_CODE_PAGE0x01, "SAP RFC APPC Header Info 3 Flag GW_WITH_CODE_PAGE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1287 { &hf_saprfc_header_info3_GW_ASYNC_RFC,
1288 { "Info 3 Flag GW_ASYNC_RFC", "saprfc.appcheader.info3.GW_ASYNC_RFC", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_ASYNC_RFC0x02, "SAP RFC APPC Header Info 3 Flag GW_ASYNC_RFC", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1289 { &hf_saprfc_header_info3_GW_CANCEL_HARD,
1290 { "Info 3 Flag GW_CANCEL_HARD", "saprfc.appcheader.info3.GW_CANCEL_HARD", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_CANCEL_HARD0x04, "SAP RFC APPC Header Info 3 Flag GW_CANCEL_HARD", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1291 { &hf_saprfc_header_info3_GW_CANCEL_SOFT,
1292 { "Info 3 Flag GW_CANCEL_SOFT", "saprfc.appcheader.info3.GW_CANCEL_SOFT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_CANCEL_SOFT0x08, "SAP RFC APPC Header Info 3 Flag GW_CANCEL_SOFT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1293 { &hf_saprfc_header_info3_GW_WITH_GUI_TIMEOUT,
1294 { "Info 3 Flag GW_WITH_GUI_TIMEOUT", "saprfc.appcheader.info3.GW_WITH_GUI_TIMEOUT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_WITH_GUI_TIMEOUT0x10, "SAP RFC APPC Header Info 3 Flag GW_WITH_GUI_TIMEOUT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1295 { &hf_saprfc_header_info3_GW_TERMIO_ERROR,
1296 { "Info 3 Flag GW_TERMIO_ERROR", "saprfc.appcheader.info3.GW_TERMIO_ERROR", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_TERMIO_ERROR0x20, "SAP RFC APPC Header Info 3 Flag GW_TERMIO_ERROR", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1297 { &hf_saprfc_header_info3_GW_EXTENDED_INIT_OPTIONS,
1298 { "Info 3 Flag GW_EXTENDED_INIT_OPTIONS", "saprfc.appcheader.info3.GW_EXTENDED_INIT_OPTIONS", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_EXTENDED_INIT_OPTIONS0x40, "SAP RFC APPC Header Info 3 Flag GW_EXTENDED_INIT_OPTIONS", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1299 { &hf_saprfc_header_info3_GW_DIST_TRACE,
1300 { "Info 3 Flag GW_DIST_TRACE", "saprfc.appcheader.info3.GW_DIST_TRACE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_DIST_TRACE0x80, "SAP RFC APPC Header Info 3 Flag GW_DIST_TRACE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1301 { &hf_saprfc_header_timeout,
1302 { "Timeout", "saprfc.appcheader.timeout", FT_INT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Timeout", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1303 { &hf_saprfc_header_info4,
1304 { "Info 4", "saprfc.appcheader.info4", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Info 4", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1305 { &hf_saprfc_header_info4_GW_WITH_DBG_CTL,
1306 { "Info 4 Flag GW_WITH_DBG_CTL", "saprfc.appcheader.info4.GW_WITH_DBG_CTL", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO4_GW_WITH_DBG_CTL0x01, "SAP RFC APPC Header Info 4 Flag GW_WITH_DBG_CTL", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1307 { &hf_saprfc_header_sequence_no,
1308 { "Sequence No", "saprfc.appcheader.sequence_no", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Sequence No", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1309 { &hf_saprfc_header_sap_params_len,
1310 { "SAP Parameters Length", "saprfc.appcheader.sap_params_len", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header SAP Parameters Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1311 { &hf_saprfc_header_info,
1312 { "Info Flags", "saprfc.appcheader.info", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Info Flags", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1313 { &hf_saprfc_header_info_SYNC_CPIC_FUNCTION,
1314 { "Info Flag SYNC_CPIC_FUNCTION", "saprfc.appcheader.info.SYNC_CPIC_FUNCTION", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_SYNC_CPIC_FUNCTION0x01, "SAP RFC APPC Header Info Flag SYNC_CPIC_FUNCTION", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1315 { &hf_saprfc_header_info_WITH_HOSTADDR,
1316 { "Info Flag WITH_HOSTADDR", "saprfc.appcheader.info.WITH_HOSTADDR", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_WITH_HOSTADDR0x02, "SAP RFC APPC Header Info Flag WITH_HOSTADDR", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1317 { &hf_saprfc_header_info_WITH_GW_SAP_PARAMS_HDR,
1318 { "Info Flag WITH_GW_SAP_PARAMS_HDR", "saprfc.appcheader.info.WITH_GW_SAP_PARAMS_HDR", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_WITH_GW_SAP_PARAMS_HDR0x04, "SAP RFC APPC Header Info Flag WITH_GW_SAP_PARAMS_HDR", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1319 { &hf_saprfc_header_info_CPIC_SYNC_REQ,
1320 { "Info Flag CPIC_SYNC_REQ", "saprfc.appcheader.info.CPIC_SYNC_REQ", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_CPIC_SYNC_REQ0x08, "SAP RFC APPC Header Info Flag CPIC_SYNC_REQ", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1321 { &hf_saprfc_header_info_WITH_ERR_INFO,
1322 { "Info Flag WITH_ERR_INFO", "saprfc.appcheader.info.WITH_ERR_INFO", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_WITH_ERR_INFO0x10, "SAP RFC APPC Header Info Flag WITH_ERR_INFO", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1323 { &hf_saprfc_header_info_DATA_WITH_TERM_OUTPUT,
1324 { "Info Flag DATA_WITH_TERM_OUTPUT", "saprfc.appcheader.info.DATA_WITH_TERM_OUTPUT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_DATA_WITH_TERM_OUTPUT0x20, "SAP RFC APPC Header Info Flag DATA_WITH_TERM_OUTPUT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1325 { &hf_saprfc_header_info_DATA_WITH_TERM_INPUT,
1326 { "Info Flag DATA_WITH_TERM_INPUT", "saprfc.appcheader.info.DATA_WITH_TERM_INPUT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_DATA_WITH_TERM_INPUT0x40, "SAP RFC APPC Header Info Flag DATA_WITH_TERM_INPUT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1327 { &hf_saprfc_header_info_R3_CPIC_LOGIN_WITH_TERM,
1328 { "Info Flag R3_CPIC_LOGIN_WITH_TERM", "saprfc.appcheader.info.R3_CPIC_LOGIN_WITH_TERM", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_R3_CPIC_LOGIN_WITH_TERM0x80, "SAP RFC APPC Header Info Flag R3_CPIC_LOGIN_WITH_TERM", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1329 { &hf_saprfc_header_reqtype2,
1330 { "Request Type 2 Flags", "saprfc.appcheader.reqtype2", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Request Type 2", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1331 { &hf_saprfc_header_reqtype2_F_V_INITIALIZE_CONVERSATION,
1332 { "Request Type 2 Flag F_V_INITIALIZE_CONVERSATION", "saprfc.appcheader.reqtype2.F_V_INITIALIZE_CONVERSATION", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_INITIALIZE_CONVERSATION0x01, "SAP RFC Request Type 2 Flag F_V_INITIALIZE_CONVERSATION", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1333 { &hf_saprfc_header_reqtype2_F_V_ALLOCATE,
1334 { "Request Type 2 Flag F_V_ALLOCATE", "saprfc.appcheader.reqtype2.F_V_ALLOCATE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_ALLOCATE0x02, "SAP RFC Request Type 2 Flag F_V_ALLOCATE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1335 { &hf_saprfc_header_reqtype2_F_V_SEND_DATA,
1336 { "Request Type 2 Flag F_V_SEND_DATA", "saprfc.appcheader.reqtype2.F_V_SEND_DATA", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_SEND_DATA0x04, "SAP RFC Request Type 2 Flag F_V_SEND_DATA", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1337 { &hf_saprfc_header_reqtype2_F_V_RECEIVE,
1338 { "Request Type 2 Flag F_V_RECEIVE", "saprfc.appcheader.reqtype2.F_V_RECEIVE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_RECEIVE0x08, "SAP RFC Request Type 2 Flag F_V_RECEIVE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1339 { &hf_saprfc_header_reqtype2_F_V_FLUSH,
1340 { "Request Type 2 Flag F_V_FLUSH", "saprfc.appcheader.reqtype2.F_V_FLUSH", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_FLUSH0x10, "SAP RFC Request Type 2 Flag F_V_FLUSH", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1341 { &hf_saprfc_header_appc_rc,
1342 { "APPC Return Code", "saprfc.appcheader.appc_rc", FT_INT32, BASE_DEC, VALS(saprfc_header_appc_rc_values)((0 ? (const struct _value_string*)0 : ((saprfc_header_appc_rc_values
))))
, 0x0, "SAP RFC APPC Header APPC Return Code", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1343 { &hf_saprfc_header_sap_rc,
1344 { "SAP Return Code", "saprfc.appcheader.sap_rc", FT_INT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header SAP Return Code", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1345 { &hf_saprfc_header_conversation_id,
1346 { "Conversation ID", "saprfc.appcheader.conversation_id", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header Conversation ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1347 { &hf_saprfc_header_ncpic_parameters,
1348 { "NCPIC Parameters", "saprfc.appcheader.ncpic_parameters", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1349 { &hf_saprfc_header_ncpic_parameters_sdest,
1350 { "SDest", "saprfc.appcheader.ncpic_parameters.sdest", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters SDest", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1351 { &hf_saprfc_header_ncpic_parameters_lu,
1352 { "LU", "saprfc.appcheader.ncpic_parameters.lu", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters LU", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1353 { &hf_saprfc_header_ncpic_parameters_tp,
1354 { "TP", "saprfc.appcheader.ncpic_parameters.tp", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters TP", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1355 { &hf_saprfc_header_ncpic_parameters_ctype,
1356 { "CType", "saprfc.appcheader.ncpic_parameters.ctype", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters CType", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1357 { &hf_saprfc_header_ncpic_parameters_client_info,
1358 { "Client Info", "saprfc.appcheader.ncpic_parameters.client_info", FT_UINT8, BASE_HEX, VALS(saprfc_header_ncpic_parameters_client_info_values)((0 ? (const struct _value_string*)0 : ((saprfc_header_ncpic_parameters_client_info_values
))))
, 0x0, "SAP RFC APPC Header NCPIC Parameters Client Info", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1359 { &hf_saprfc_header_ncpic_parameters_lu_name,
1360 { "LU Name", "saprfc.appcheader.ncpic_parameters.lu_name", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters LU Name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1361 { &hf_saprfc_header_ncpic_parameters_lu_name_length,
1362 { "LU Name Length", "saprfc.appcheader.ncpic_parameters.lu_name_length", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters LU Name Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1363 { &hf_saprfc_header_ncpic_parameters_host_address,
1364 { "Host Address", "saprfc.appcheader.ncpic_parameters.host_address", FT_IPv6, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters Host Address", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1365 { &hf_saprfc_header_ncpic_parameters_security_password,
1366 { "Security Password", "saprfc.appcheader.ncpic_parameters.security_password", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters Security Password", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1367 { &hf_saprfc_header_ncpic_parameters_security_password_length,
1368 { "Security Password Length", "saprfc.appcheader.ncpic_parameters.security_password_length", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters Security Password Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1369
1370 { &hf_saprfc_header_comm_idx,
1371 { "Comm Index", "saprfc.appcheader.comm_idx", FT_INT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Comm Index", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1372 { &hf_saprfc_header_conn_idx,
1373 { "Conn Index", "saprfc.appcheader.conn_idx", FT_INT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Conn Index", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1374
1375 /* Payload */
1376 { &hf_saprfc_payload,
1377 { "Message", "saprfc.message", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Message", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1378
1379 /* Item fields */
1380 { &hf_saprfc_item,
1381 { "Item", "saprfc.item", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Item", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1382 { &hf_saprfc_item_id1,
1383 { "ID1", "saprfc.item.id1", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Item ID 1", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1384 { &hf_saprfc_item_id2,
1385 { "ID2", "saprfc.item.id2", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Item ID 2", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1386 { &hf_saprfc_item_length,
1387 { "Length", "saprfc.item.length", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Item Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1388 { &hf_saprfc_item_value,
1389 { "Value", "saprfc.item.value", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Item Value", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1390
1391 /* Table content */
1392 { &hf_saprfc_table,
1393 { "Table", "saprfc.table", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1394 { &hf_saprfc_table_structure,
1395 { "Table Structure", "saprfc.table.structure", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Structure", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1396 { &hf_saprfc_table_structure_field,
1397 { "Table Structure Field", "saprfc.table.structure.field", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Structure Field", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1398 { &hf_saprfc_table_structure_field_type,
1399 { "Table Structure Field Type", "saprfc.table.structure.field.type", FT_UINT8, BASE_DEC, VALS(abap_types_typename_values)((0 ? (const struct _value_string*)0 : ((abap_types_typename_values
))))
, 0x0, "SAP RFC Table Structure Field Type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1400 { &hf_saprfc_table_structure_field_length,
1401 { "Table Structure Field Length", "saprfc.table.structure.field.length", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Structure Field Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1402 { &hf_saprfc_table_row,
1403 { "Table Row", "saprfc.table.row", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Row", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1404 { &hf_saprfc_table_row_field,
1405 { "Table Row Field", "saprfc.table.row.field", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Row Field", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1406 { &hf_saprfc_table_length,
1407 { "Table Content Length", "saprfc.table.length", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Table Content Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1408 { &hf_saprfc_table_compress_header,
1409 { "Compression Header", "saprfc.table.compression", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Compression Header", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1410 { &hf_saprfc_table_uncomplength,
1411 { "Uncompressed Length", "saprfc.table.compression.uncomplength", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Table Uncompressed Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1412 { &hf_saprfc_table_algorithm,
1413 { "Compression Algorithm", "saprfc.table.compression.algorithm", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Table Compression Algorithm", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1414 { &hf_saprfc_table_magic,
1415 { "Magic Bytes", "saprfc.table.compression.magic", FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Table Compression Magic Bytes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1416 { &hf_saprfc_table_special,
1417 { "Special", "saprfc.table.compression.special", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Table Special", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1418 { &hf_saprfc_table_return_code,
1419 { "Decompress Return Code", "saprfc.table.compression.returncode", FT_INT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Decompression routine return code", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1420 { &hf_saprfc_table_content,
1421 { "Content", "saprfc.table.content", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Content", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
1422
1423 };
1424
1425 /* Setup protocol subtree array */
1426 static int *ett[] = {
1427 &ett_saprfc
1428 };
1429
1430 /* Register the expert info */
1431 static ei_register_info ei[] = {
1432 { &ei_saprfc_invalid_decompression, { "saprfc.table.compression.failed", PI_MALFORMED0x07000000, PI_WARN0x00600000, "Decompression of table failed", 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)}}
}},
1433 { &ei_saprfc_invalid_decompress_length, { "saprfc.table.compression.uncomplength.invalid", PI_MALFORMED0x07000000, PI_WARN0x00600000, "The uncompressed table length differs from the reported length", 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)}}
}},
1434 { &ei_saprfc_invalid_table_length, { "saprfc.table.length.invalid", PI_MALFORMED0x07000000, PI_WARN0x00600000, "The table length is invalid", 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)}}
}},
1435 { &ei_saprfc_item_length_invalid, { "saprfc.item.value.invalid_length", PI_MALFORMED0x07000000, PI_WARN0x00600000, "The item length is invalid", 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)}}
}},
1436 { &ei_saprfc_unknown_item, { "saprfc.item.unknown", PI_UNDECODED0x05000000, PI_WARN0x00600000, "The RFC item has a unknown type that is not dissected", 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)}}
}},
1437 { &ei_saprfc_short_appc_header, { "saprfc.appcheader.short", PI_MALFORMED0x07000000, PI_WARN0x00600000, "SAP RFC APPC header is too short", 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)}}
}},
1438 };
1439
1440 module_t *saprfc_module;
1441 expert_module_t* saprfc_expert;
1442
1443 /* Register the protocol */
1444 proto_saprfc = proto_register_protocol("SAP RFC Protocol", "SAPRFC", "saprfc");
1445
1446 proto_register_field_array(proto_saprfc, hf, array_length(hf)(sizeof (hf) / sizeof (hf)[0]));
1447 proto_register_subtree_array(ett, array_length(ett)(sizeof (ett) / sizeof (ett)[0]));
1448
1449 saprfc_expert = expert_register_protocol(proto_saprfc);
1450 expert_register_field_array(saprfc_expert, ei, array_length(ei)(sizeof (ei) / sizeof (ei)[0]));
1451
1452 register_dissector("saprfc", dissect_saprfc, proto_saprfc);
1453 register_dissector("saprfcinternal", dissect_saprfc_internal, proto_saprfc);
1454
1455 /* Register the preferences */
1456 saprfc_module = prefs_register_protocol(proto_saprfc, proto_reg_handoff_saprfc);
1457 prefs_register_bool_preference(saprfc_module, "decompress", "Decompress SAP RFC Protocol tables",
1458 "Whether the SAP RFC Protocol dissector should decompress table content.",
1459 &global_saprfc_decompress);
1460 prefs_register_uint_preference(saprfc_module, "max_uncompressed_size", "Maximum uncompressed table size",
1461 "Maximum number of bytes to allocate for an uncompressed SAP RFC table.",
1462 10, &global_saprfc_max_uncompressed_size);
1463 prefs_register_uint_preference(saprfc_module, "max_reassembled_size", "Maximum reassembled table size",
1464 "Maximum number of bytes to allocate while reassembling an SAP RFC table.",
1465 10, &global_saprfc_max_reassembled_size);
1466
1467 prefs_register_bool_preference(saprfc_module, "table_reassembly", "Reassemble SAP RFC table content",
1468 "Whether the SAP RFC Protocol dissector should reassemble table content included in payloads.",
1469 &global_saprfc_table_reassembly);
1470
1471 prefs_register_bool_preference(saprfc_module, "highlight_unknown_items", "Highlight unknown SAP RFC Items",
1472 "Whether the SAP RFC Protocol dissector should highlight unknown RFC items (might be noise and generate a lot of expert warnings)",
1473 &global_saprfc_highlight_items);
1474}
1475
1476
1477/**
1478 * Register Hand off for the SAP RFC Protocol
1479 */
1480void
1481proto_reg_handoff_saprfc(void)
1482{
1483 static bool_Bool initialized = false0;
1484
1485 if (!initialized) {
1486 saprfc_handle = create_dissector_handle(dissect_saprfc, proto_saprfc);
1487 saprfcinternal_handle = create_dissector_handle(dissect_saprfc_internal, proto_saprfc);
1488 initialized = true1;
1489 }
1490
1491 dissector_add_uint_range_with_preference("tcp.port", SAPRFC_PORT_RANGE"3300", saprfc_handle);
1492}
1493
1494/*
1495 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1496 *
1497 * Local variables:
1498 * c-basic-offset: 8
1499 * tab-width: 8
1500 * indent-tabs-mode: t
1501 * End:
1502 *
1503 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1504 * :indentSize=8:tabSize=8:noTabs=false:
1505 */